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 2e4de85c authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #101 from Adyen/develop

Merge from 'Develop'
parents 0f8df95a f50664e2
......@@ -301,6 +301,9 @@ class Json extends \Magento\Framework\App\Action\Action
$_SERVER['REDIRECT_REMOTE_AUTHORIZATION'] != '') {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', base64_decode($_SERVER['REDIRECT_REMOTE_AUTHORIZATION']));
} elseif (!empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', base64_decode(substr($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 6)));
} elseif (!empty($_SERVER['HTTP_AUTHORIZATION'])) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
......
......@@ -97,7 +97,7 @@ class Result extends \Magento\Framework\App\Action\Action
if ($result) {
$session = $this->_session;
$session->getQuote()->setIsActive(false)->save();
$this->_redirect('checkout/onepage/success');
$this->_redirect('checkout/onepage/success', ['utm_nooverride' => '1']);
} else {
$this->_cancel($response);
$this->_redirect('checkout/cart');
......
......@@ -95,7 +95,7 @@ class ResultPos extends \Magento\Framework\App\Action\Action
if ($result) {
$session = $this->_session;
$session->getQuote()->setIsActive(false)->save();
$this->_redirect('checkout/onepage/success');
$this->_redirect('checkout/onepage/success', ['utm_nooverride' => '1']);
} else {
$this->_cancel($response);
$this->_redirect('checkout/cart');
......
......@@ -50,6 +50,11 @@ class Validate3d extends \Magento\Framework\App\Action\Action
*/
protected $_paymentRequest;
/**
* @var \Magento\Sales\Api\OrderRepositoryInterface
*/
protected $_orderRepository;
/**
* Validate3d constructor.
*
......@@ -62,12 +67,14 @@ class Validate3d extends \Magento\Framework\App\Action\Action
\Magento\Framework\App\Action\Context $context,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest,
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository
) {
parent::__construct($context);
$this->_adyenLogger = $adyenLogger;
$this->_adyenHelper = $adyenHelper;
$this->_paymentRequest = $paymentRequest;
$this->_orderRepository = $orderRepository;
}
/**
......@@ -86,6 +93,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if 3D secure is active. If not just go to success page
if ($active) {
$this->_adyenLogger->addAdyenResult("3D secure is active");
// check if it is already processed
......@@ -121,7 +129,11 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if authorise3d was successful
if ($result == 'Authorised') {
$order->addStatusHistoryComment(__('3D-secure validation was successful'))->save();
$this->_redirect('checkout/onepage/success');
// set back to false so when pressed back button on the success page it will reactivate 3D secure
$order->getPayment()->setAdditionalInformation('3dActive', '');
$this->_orderRepository->save($order);
$this->_redirect('checkout/onepage/success', ['utm_nooverride' => '1']);
} else {
$order->addStatusHistoryComment(__('3D-secure validation was unsuccessful.'))->save();
$this->_adyenHelper->cancelOrder($order);
......@@ -147,7 +159,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
$this->_view->renderLayout();
}
} else {
$this->_redirect('checkout/onepage/success/');
$this->_redirect('checkout/onepage/success/', ['utm_nooverride' => '1']);
}
}
......
......@@ -777,7 +777,7 @@ class Data extends AbstractHelper
{
if (strlen($paymentMethod) >= 9 && substr($paymentMethod, 0, 9) == 'afterpay_') {
return true;
} else if($paymentMethod == 'klarna') {
} else if($paymentMethod == 'klarna' || $paymentMethod == 'ratepay') {
return true;
} else {
return false;
......
......@@ -438,9 +438,10 @@ class Cron
);
}
// if payment method is klarna or openinvoice/afterpay show the reservartion number
// if payment method is klarna, ratepay or openinvoice/afterpay show the reservartion number
if (($this->_paymentMethod == "klarna" || $this->_paymentMethod == "afterpay_default" ||
$this->_paymentMethod == "openinvoice") && ($this->_klarnaReservationNumber != null &&
$this->_paymentMethod == "openinvoice" || $this->_paymentMethod == "ratepay"
) && ($this->_klarnaReservationNumber != null &&
$this->_klarnaReservationNumber != "")) {
$klarnaReservationNumberText = "<br /> reservationNumber: " . $this->_klarnaReservationNumber;
} else {
......@@ -1191,6 +1192,7 @@ class Cron
case 'paypal':
case 'klarna':
case 'afterpay_default':
case 'ratepay':
case 'sepadirectdebit':
$manualCaptureAllowed = true;
break;
......@@ -1358,14 +1360,7 @@ class Cron
$this->_createInvoice();
}
// if you have capture on shipment enabled don't set update the status of the payment
$captureOnShipment = $this->_getConfigData(
'capture_on_shipment', 'adyen_abstract', $this->_order->getStoreId()
);
if (!$captureOnShipment) {
$status = $this->_getConfigData('payment_authorized', 'adyen_abstract', $this->_order->getStoreId());
}
// virtual order can have different status
if ($this->_order->getIsVirtual()) {
......
......@@ -5,7 +5,7 @@ Adyen Payment plugin for Magento2
composer require adyen/module-payment
## Manual ##
<a href="https://docs.adyen.com/manuals/magento/magento2-integration" target="_blank">https://docs.adyen.com/manuals/magento/magento2-integration</a>
<a href="https://docs.adyen.com/developers/magento#magento2integration" target="_blank">https://docs.adyen.com/developers/magento#magento2integration</a>
## Setup Cron ##
Make sure that your magento cron is running every minute. We are using a cronjob to process the notifications. The cronjob will be executed every minute. It only executes the notifications that have been received at least 2 minutes ago. We have built in this 2 minutes so we are sure Magento has created the order and all save after events are executed. A handy tool to get insight into your cronjobs is AOE scheduler. You can download this tool through Magento Connect or GitHub
......
......@@ -2,7 +2,7 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "2.0.2",
"version": "2.0.3",
"license": [
"OSL-3.0",
"AFL-3.0"
......
......@@ -56,7 +56,7 @@
<config_path>payment/adyen_hpp/hmac_live</config_path>
</field>
<group id="adyen_hpp_openinvoice_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="100">
<label>Klarna\Afterpay Settings</label>
<label>Klarna\RatePay\Afterpay Settings</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<field id="show_gender" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Gender</label>
......
......@@ -24,7 +24,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Adyen_Payment" setup_version="2.0.2">
<module name="Adyen_Payment" setup_version="2.0.3">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
......
view/base/web/images/logos/mc.png

3.35 KB | W: | H:

view/base/web/images/logos/mc.png

1.64 KB | W: | H:

view/base/web/images/logos/mc.png
view/base/web/images/logos/mc.png
view/base/web/images/logos/mc.png
view/base/web/images/logos/mc.png
  • 2-up
  • Swipe
  • Onion skin
view/base/web/images/logos/mc_small.png

1.83 KB | W: | H:

view/base/web/images/logos/mc_small.png

862 Bytes | W: | H:

view/base/web/images/logos/mc_small.png
view/base/web/images/logos/mc_small.png
view/base/web/images/logos/mc_small.png
view/base/web/images/logos/mc_small.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -22,7 +22,7 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<head>
<css src="Adyen_Payment::css/styles.css"/>
</head>
......
......@@ -27,11 +27,11 @@ define(
'mage/storage',
'Magento_Checkout/js/model/error-processor',
'Magento_Customer/js/model/customer',
'Magento_Checkout/js/model/full-screen-loader'
'Magento_Checkout/js/model/full-screen-loader',
'Magento_CheckoutAgreements/js/model/agreements-assigner'
],
function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader) {
function ($, quote, urlBuilder, storage, errorProcessor, customer, fullScreenLoader, agreementsAssigner) {
'use strict';
var agreementsConfig = window.checkoutConfig.checkoutAgreements;
return function () {
......@@ -39,20 +39,8 @@ define(
payload,
paymentData = quote.paymentMethod();
// check if agreement is enabled if so add it to payload
if (agreementsConfig.isEnabled) {
var agreementForm = $('.payment-method._active form[data-role=checkout-agreements]'),
agreementData = agreementForm.serializeArray(),
agreementIds = [];
agreementData.forEach(function(item) {
agreementIds.push(item.value);
});
paymentData.extension_attributes = {agreement_ids: agreementIds};
}
// use core code to assign the agreement
agreementsAssigner(paymentData);
/** Checkout for guest and registered customer. */
if (!customer.isLoggedIn()) {
......
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