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 73d9097d authored by rikterbeek's avatar rikterbeek

several bug fixes

parent 17764e16
...@@ -335,6 +335,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface ...@@ -335,6 +335,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
// connect to magento log // connect to magento log
$client->setLogger($this->_adyenLogger); $client->setLogger($this->_adyenLogger);
$hmacKey = $this->_adyenHelper->getHmac();
// create and add signature // create and add signature
$requestParams["merchantSig"] = \Adyen\Util\Util::calculateSha256Signature($hmacKey, $requestParams); $requestParams["merchantSig"] = \Adyen\Util\Util::calculateSha256Signature($hmacKey, $requestParams);
......
...@@ -701,10 +701,10 @@ class Cron ...@@ -701,10 +701,10 @@ class Cron
}else { }else {
$this->_debugData[$this->_count]['_processNotification error'] = 'Failed to create billing agreement for this order (listRecurringCall did not contain contract)'; $this->_debugData['_processNotification error'] = 'Failed to create billing agreement for this order (listRecurringCall did not contain contract)';
$this->_debugData[$this->_count]['_processNotification ref'] = printf('recurringDetailReference in notification is %1', $recurringDetailReference) ; $this->_debugData['_processNotification ref'] = printf('recurringDetailReference in notification is %1', $recurringDetailReference) ;
$this->_debugData[$this->_count]['_processNotification customer ref'] = printf('CustomerReference is: %1 and storeId is %2', $customerReference, $storeId); $this->_debugData['_processNotification customer ref'] = printf('CustomerReference is: %1 and storeId is %2', $customerReference, $storeId);
$this->_debugData[$this->_count]['_processNotification customer result'] = $listRecurringContracts; $this->_debugData['_processNotification customer result'] = $listRecurringContracts;
$message = __('Failed to create billing agreement for this order (listRecurringCall did not contain contract)'); $message = __('Failed to create billing agreement for this order (listRecurringCall did not contain contract)');
} }
...@@ -714,7 +714,7 @@ class Cron ...@@ -714,7 +714,7 @@ class Cron
} }
break; break;
default: default:
$this->_debugData[$this->_count]['_processNotification info'] = sprintf('This notification event: %s is not supported so will be ignored', $this->_eventCode); $this->_debugData['_processNotification info'] = sprintf('This notification event: %s is not supported so will be ignored', $this->_eventCode);
break; break;
} }
} }
...@@ -978,6 +978,7 @@ class Cron ...@@ -978,6 +978,7 @@ class Cron
case 'amex': case 'amex':
case 'bcmc': case 'bcmc':
case 'maestro': case 'maestro':
case 'maestrouk':
case 'diners': case 'diners':
case 'discover': case 'discover':
case 'jcb': case 'jcb':
......
...@@ -82,6 +82,13 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -82,6 +82,13 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/ */
protected $_adyenHelper; protected $_adyenHelper;
/**
* Request object
*
* @var \Magento\Framework\App\RequestInterface
*/
protected $_request;
/** /**
* @param \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest * @param \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger * @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
...@@ -103,6 +110,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -103,6 +110,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
* @SuppressWarnings(PHPMD.ExcessiveParameterList) * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/ */
public function __construct( public function __construct(
\Magento\Framework\App\RequestInterface $request,
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest, \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Magento\Checkout\Model\Session $checkoutSession, \Magento\Checkout\Model\Session $checkoutSession,
...@@ -140,6 +148,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -140,6 +148,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
$this->_checkoutSession = $checkoutSession; $this->_checkoutSession = $checkoutSession;
$this->_urlBuilder = $urlBuilder; $this->_urlBuilder = $urlBuilder;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_request = $request;
} }
protected $_paymentMethodType = 'api'; protected $_paymentMethodType = 'api';
...@@ -318,7 +327,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -318,7 +327,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/ */
public function getCheckoutRedirectUrl() public function getCheckoutRedirectUrl()
{ {
return $this->_urlBuilder->getUrl('adyen/process/validate3d/'); return $this->_urlBuilder->getUrl('adyen/process/validate3d/',['_secure' => $this->_getRequest()->isSecure()]);
} }
/** /**
...@@ -361,4 +370,14 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -361,4 +370,14 @@ class Cc extends \Magento\Payment\Model\Method\Cc
return $this; return $this;
} }
/**
* Retrieve request object
*
* @return \Magento\Framework\App\RequestInterface
*/
protected function _getRequest()
{
return $this->_request;
}
} }
\ No newline at end of file
...@@ -24,13 +24,12 @@ ...@@ -24,13 +24,12 @@
namespace Adyen\Payment\Model; namespace Adyen\Payment\Model;
use Adyen\Payment\Api\Data\NotificationInterface; use Adyen\Payment\Api\Data\NotificationInterface;
use Magento\Framework\Object\IdentityInterface; use Magento\Framework\DataObject\IdentityInterface;
class Notification extends \Magento\Framework\Model\AbstractModel class Notification extends \Magento\Framework\Model\AbstractModel
implements NotificationInterface implements NotificationInterface
{ {
const AUTHORISATION = 'AUTHORISATION'; const AUTHORISATION = 'AUTHORISATION';
const PENDING = 'PENDING'; const PENDING = 'PENDING';
const AUTHORISED = 'AUTHORISED'; const AUTHORISED = 'AUTHORISED';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "adyen/module-payment", "name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.", "description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module", "type": "magento2-module",
"version": "1.0.0.1", "version": "1.1.1",
"license": [ "license": [
"OSL-3.0", "OSL-3.0",
"AFL-3.0" "AFL-3.0"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
--> -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <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="1.0.0.2"> <module name="Adyen_Payment" setup_version="1.1.1">
<sequence> <sequence>
<module name="Magento_Sales"/> <module name="Magento_Sales"/>
<module name="Magento_Quote"/> <module name="Magento_Quote"/>
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
/*jshint browser:true jquery:true*/ /*jshint browser:true jquery:true*/
/*global alert*/ /*global alert*/
var config = { var config = {
paths: {
'adyen/encrypt' : 'Adyen_Payment/js/view/payment/adyen.encrypt.min'
},
config: { config: {
mixins: { mixins: {
'Adyen_Payment/js/action/place-order': { 'Adyen_Payment/js/action/place-order': {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -29,9 +29,10 @@ define( ...@@ -29,9 +29,10 @@ define(
'Adyen_Payment/js/action/place-order', 'Adyen_Payment/js/action/place-order',
'mage/translate', 'mage/translate',
'Magento_Checkout/js/model/payment/additional-validators', 'Magento_Checkout/js/model/payment/additional-validators',
'Adyen_Payment/js/view/payment/adyen-encrypt' 'adyen/encrypt',
], ],
function (_, $, Component, placeOrderAction, $t, additionalValidators) { function (_, $, Component, placeOrderAction, $t, additionalValidators, adyenEncrypt) {
'use strict'; 'use strict';
$.validator.addMethod( $.validator.addMethod(
'validate-custom-required', function (value) { 'validate-custom-required', function (value) {
...@@ -102,7 +103,7 @@ define( ...@@ -102,7 +103,7 @@ define(
var cse_key = this.getCSEKey(); var cse_key = this.getCSEKey();
var options = {}; var options = {};
var cseInstance = adyen.encrypt.createEncryption(cse_key, options); var cseInstance = adyenEncrypt.createEncryption(cse_key, options);
var generationtime = self.getGenerationTime(); var generationtime = self.getGenerationTime();
var cardData = { var cardData = {
......
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