We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 3f7ebc9e authored by attilak's avatar attilak

Merge branch 'develop' into 7.0.0-rc.1

# Conflicts:
#	Gateway/Validator/CheckoutResponseValidator.php
#	etc/events.xml
#	view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
#	view/frontend/web/js/view/payment/method-renderer/adyen-google-pay-method.js
parents 10062ad9 9efc5be7
name: Main CI workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [7.2, 7.3, 7.4]
steps:
- uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v1,
- name: Test plugin installation
run: |
echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
composer install --prefer-dist
env:
CI: true
MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }}
MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }}
language: php
sudo: false
php:
- 7.1
- 7.2
- 7.3
install:
- echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json
- composer install --prefer-dist
script:
- php vendor/bin/phpcs
- vendor/bin/phpunit -c Test/phpunit.xml
\ No newline at end of file
......@@ -67,6 +67,7 @@ class CheckoutResponseValidator extends AbstractValidator
$payment->setAdditionalInformation('3dActive', false);
$isValid = true;
$errorMessages = [];
$resultCode = array_key_exists("resultCode", $response) ? $response['resultCode']:'';
// validate result
if (!empty($response['resultCode'])) {
......
......@@ -1066,7 +1066,8 @@ class Data extends AbstractHelper
{
if (strpos($paymentMethod, 'afterpay') !== false ||
strpos($paymentMethod, 'klarna') !== false ||
strpos($paymentMethod, 'ratepay') !== false
strpos($paymentMethod, 'ratepay') !== false ||
strpos($paymentMethod, 'facilypay_') !== false
) {
return true;
}
......
......@@ -349,7 +349,7 @@ class Cron
\Magento\Framework\Notification\NotifierInterface $notifierPool,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone,
\Adyen\Payment\Helper\Config $configHelper,
PaymentTokenManagement $paymentTokenManagement,
PaymentTokenManagement $paymentTokenManagement,
PaymentTokenFactoryInterface $paymentTokenFactory,
PaymentTokenRepositoryInterface $paymentTokenRepository,
EncryptorInterface $encryptor,
......@@ -512,10 +512,13 @@ class Cron
// check if success is true of false
if (strcmp($this->_success, 'false') == 0 || strcmp($this->_success, '0') == 0) {
/*
* Only cancel the order when it is in state pending, payment review or
* Only cancel the order when it is in state new, pending_payment, or payment review
* After order creation alternative payment methods (HPP) has state new and status pending
* while card payments has payment_review state and status
* if the ORDER_CLOSED is failed (means split payment has not be successful)
*/
if ($this->_order->getState() === \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT ||
if ($this->_order->getState() === \Magento\Sales\Model\Order::STATE_NEW ||
$this->_order->getState() === \Magento\Sales\Model\Order::STATE_PENDING_PAYMENT ||
$this->_order->getState() === \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW ||
$this->_eventCode == Notification::ORDER_CLOSED
) {
......@@ -523,7 +526,7 @@ class Cron
// if payment is API check, check if API result pspreference is the same as reference
if ($this->_eventCode == NOTIFICATION::AUTHORISATION
&& $this->_getPaymentMethodType() == 'api') {
&& $this->_getPaymentMethodType() == 'api') {
// don't cancel the order becasue order was successfull through api
$this->_adyenLogger->addAdyenNotificationCronjob(
'order is not cancelled because api result was succesfull'
......@@ -537,13 +540,20 @@ class Cron
if ($previousAdyenEventCode != "AUTHORISATION : TRUE" ||
$this->_eventCode == Notification::ORDER_CLOSED
) {
// Move the order from PAYMENT_REVIEW to NEW, so that can be cancelled
if ($this->_order->getState() === \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW &&
$this->configHelper->getNotificationsCanCancel($this->_order->getStoreId())
) {
$this->_order->setState(\Magento\Sales\Model\Order::STATE_NEW);
if ($this->configHelper->getNotificationsCanCancel($this->_order->getStoreId())) {
// Move the order from PAYMENT_REVIEW to NEW, so that can be cancelled
if ($this->_order->getState() === \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW
) {
$this->_order->setState(\Magento\Sales\Model\Order::STATE_NEW);
}
$this->_holdCancelOrder(false);
} else {
$this->_adyenLogger->addAdyenNotificationCronjob(
'order is not cancelled because "notifications_can_cancel" configuration' .
'is false.'
);
}
$this->_holdCancelOrder(false);
} else {
$this->_order->setData('adyen_notification_event_code', $previousAdyenEventCode);
$this->_adyenLogger->addAdyenNotificationCronjob(
......@@ -1269,7 +1279,7 @@ class Cron
$billingAgreement->load($recurringDetailReference, 'reference_id');
// check if BA exists
if (!($billingAgreement && $billingAgreement->getAgreementId() > 0
&& $billingAgreement->isValid())) {
&& $billingAgreement->isValid())) {
// create new
$this->_adyenLogger->addAdyenNotificationCronjob("Creating new Billing Agreement");
$this->_order->getPayment()->setBillingAgreementData(
......
......@@ -22,7 +22,7 @@
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Observer\Adminhtml;
namespace Adyen\Payment\Observer;
use Adyen\Payment\Helper\Data as AdyenHelper;
use Adyen\Payment\Logger\AdyenLogger;
......
......@@ -2,7 +2,7 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "6.6.5",
"version": "6.6.6",
"license": [
"OSL-3.0",
"AFL-3.0"
......
<?xml version="1.0"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="sales_order_shipment_save_before">
<observer name="adyen_shipment_save_before" instance="Adyen\Payment\Observer\Adminhtml\BeforeShipmentObserver" />
</event>
</config>
......@@ -47,4 +47,7 @@
<event name="sales_model_service_quote_submit_before">
<observer name="adyen_sales_order_charged_currency" instance="Adyen\Payment\Observer\AdyenSalesOrderChargedCurrencyObserver" />
</event>
<event name="sales_order_shipment_save_before">
<observer name="adyen_shipment_save_before" instance="Adyen\Payment\Observer\BeforeShipmentObserver" />
</event>
</config>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_WebsiteRestriction:etc/webrestrictions.xsd">
<action path="adyen_process_json" type="generic" />
</config>
\ No newline at end of file
<action path="adyen_transparent_redirect" type="generic" />
</config>
......@@ -162,12 +162,7 @@ define(
}
}
// for BCMC as this is not a core payment method inside magento use maestro as brand detection
if (creditCardType == 'BCMC') {
self.creditCardType('MI');
} else {
self.creditCardType(creditCardType);
}
self.creditCardType(creditCardType);
} else {
self.creditCardType('');
self.installments(0);
......
......@@ -123,8 +123,7 @@ define(
totalPriceStatus: 'FINAL',
// empty onSubmit to resolve javascript issues.
onSubmit: function () {
},
onSubmit: function () {},
onChange: function (state) {
if (!!state.isValid) {
self.googlePayToken(state.data.paymentMethod.googlePayToken);
......@@ -151,9 +150,13 @@ define(
googlepay.isAvailable().then(function() {
self.googlePayAllowed(true);
googlepay.mount(self.googlePayNode);
self.googlePayNode.addEventListener('click', function () {
$(self.googlePayNode).find('button').prop('disabled', !self.validate(true));
// TODO check if it's better
/*
self.googlePayNode.addEventListener('click', function () {
self.validate();
});
});
*/
}, function(error) {
console.log(error);
self.googlePayAllowed(false);
......
......@@ -38,6 +38,10 @@
</label>
</div>
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="payment-method-content" data-bind="event: { change: onPaymentMethodContentChange }">
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment