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 f6968a08 authored by Rik ter Beek's avatar Rik ter Beek

Merge pull request #11 from Adyen/develop

Merge branch 'develop'
parents 3b4acc26 55792411
......@@ -42,11 +42,6 @@ class Cc extends \Magento\Payment\Block\Form
*/
protected $_adyenHelper;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $_storeManager;
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Payment\Model\Config $paymentConfig
......@@ -56,13 +51,11 @@ class Cc extends \Magento\Payment\Block\Form
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Payment\Model\Config $paymentConfig,
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
) {
parent::__construct($context, $data);
$this->_paymentConfig = $paymentConfig;
$this->_adyenHelper = $adyenHelper;
$this->_storeManager = $storeManager;
}
......
......@@ -189,6 +189,7 @@ class Json extends \Magento\Framework\App\Action\Action
} else {
return "401";
}
return true;
}
......
......@@ -147,7 +147,7 @@ class Result extends \Magento\Framework\App\Action\Action
'adyen_response' => $response
]);
if (isset($response['handled'])) {
return;
return $response['handled_response'];
}
// set StoreId for retrieving debug log setting
......
......@@ -277,6 +277,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
if($defaultCountry) {
return $defaultCountry;
}
return "";
}
/**
......@@ -335,6 +337,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
// connect to magento log
$client->setLogger($this->_adyenLogger);
$hmacKey = $this->_adyenHelper->getHmac();
// create and add signature
$requestParams["merchantSig"] = \Adyen\Util\Util::calculateSha256Signature($hmacKey, $requestParams);
......
......@@ -544,7 +544,7 @@ class Cron
case Notification::PENDING:
if($this->_getConfigData('send_email_bank_sepa_on_pending', 'adyen_abstract', $this->_order->getStoreId())) {
// Check if payment is banktransfer or sepa if true then send out order confirmation email
$isBankTransfer = $this->_isBankTransfer($this->_paymentMethod);
$isBankTransfer = $this->_isBankTransfer();
if($isBankTransfer || $this->_paymentMethod == 'sepadirectdebit') {
// $this->_order->sendNewOrderEmail(); // send order email
$this->_orderSender->send($this->_order);
......@@ -581,7 +581,7 @@ class Cron
// $this->_uncancelOrder($this->_order);
// FOR POS authorize the payment on the CAPTURE notification
$this->_authorizePayment($this->_order, $this->_paymentMethod);
$this->_authorizePayment();
}
break;
case Notification::CAPTURE_FAILED:
......@@ -603,7 +603,7 @@ class Cron
$this->_debugData['_processNotification info'] = 'Order is already cancelled or holded so do nothing';
} else if ($this->_order->canCancel() || $this->_order->canHold()) {
$this->_debugData['_processNotification info'] = 'try to cancel the order';
$this->_holdCancelOrder($this->_order, true);
$this->_holdCancelOrder(true);
} else {
$this->_debugData['_processNotification info'] = 'try to refund the order';
// refund
......@@ -701,10 +701,10 @@ class Cron
}else {
$this->_debugData[$this->_count]['_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[$this->_count]['_processNotification customer ref'] = printf('CustomerReference is: %1 and storeId is %2', $customerReference, $storeId);
$this->_debugData[$this->_count]['_processNotification customer result'] = $listRecurringContracts;
$this->_debugData['_processNotification error'] = 'Failed to create billing agreement for this order (listRecurringCall did not contain contract)';
$this->_debugData['_processNotification ref'] = printf('recurringDetailReference in notification is %1', $recurringDetailReference) ;
$this->_debugData['_processNotification customer ref'] = printf('CustomerReference is: %1 and storeId is %2', $customerReference, $storeId);
$this->_debugData['_processNotification customer result'] = $listRecurringContracts;
$message = __('Failed to create billing agreement for this order (listRecurringCall did not contain contract)');
}
......@@ -714,7 +714,7 @@ class Cron
}
break;
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;
}
}
......@@ -978,6 +978,7 @@ class Cron
case 'amex':
case 'bcmc':
case 'maestro':
case 'maestrouk':
case 'diners':
case 'discover':
case 'jcb':
......@@ -1106,7 +1107,7 @@ class Cron
// create invoice for the capture notification if you are on manual capture
if($createInvoice == true && $amount == $orderAmount) {
$this->_debugData['_setPaymentAuthorized amount'] = 'amount notification:'.$amount . ' amount order:'.$orderAmount;
$this->_createInvoice($this->_order);
$this->_createInvoice();
}
// if you have capture on shipment enabled don't set update the status of the payment
......@@ -1125,7 +1126,7 @@ class Cron
}
// check for boleto if payment is totally paid
if($this->_paymentMethodCode($this->_order) == "adyen_boleto") {
if($this->_paymentMethodCode() == "adyen_boleto") {
// check if paid amount is the same as orginal amount
$orginalAmount = $this->_boletoOriginalAmount;
......
......@@ -82,6 +82,13 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/
protected $_adyenHelper;
/**
* Request object
*
* @var \Magento\Framework\App\RequestInterface
*/
protected $_request;
/**
* @param \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
......@@ -103,6 +110,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Framework\App\RequestInterface $request,
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Magento\Checkout\Model\Session $checkoutSession,
......@@ -140,6 +148,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
$this->_checkoutSession = $checkoutSession;
$this->_urlBuilder = $urlBuilder;
$this->_adyenHelper = $adyenHelper;
$this->_request = $request;
}
protected $_paymentMethodType = 'api';
......@@ -318,7 +327,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
*/
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
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 @@
namespace Adyen\Payment\Model;
use Adyen\Payment\Api\Data\NotificationInterface;
use Magento\Framework\Object\IdentityInterface;
use Magento\Framework\DataObject\IdentityInterface;
class Notification extends \Magento\Framework\Model\AbstractModel
implements NotificationInterface
{
const AUTHORISATION = 'AUTHORISATION';
const PENDING = 'PENDING';
const AUTHORISED = 'AUTHORISED';
......
......@@ -2,19 +2,11 @@
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "1.0.0.1",
"version": "1.1.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"repositories": [
{
"adyen": {
"type": "vcs",
"url": "git@github.com:Adyen/adyen-php-api-library.git"
}
}
],
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-config": "100.0.*",
......
......@@ -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="1.0.0.2">
<module name="Adyen_Payment" setup_version="1.1.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
......
......@@ -5,6 +5,9 @@
/*jshint browser:true jquery:true*/
/*global alert*/
var config = {
paths: {
'adyen/encrypt' : 'Adyen_Payment/js/view/payment/adyen.encrypt.min'
},
config: {
mixins: {
'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(
'Adyen_Payment/js/action/place-order',
'mage/translate',
'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';
$.validator.addMethod(
'validate-custom-required', function (value) {
......@@ -102,7 +103,7 @@ define(
var cse_key = this.getCSEKey();
var options = {};
var cseInstance = adyen.encrypt.createEncryption(cse_key, options);
var cseInstance = adyenEncrypt.createEncryption(cse_key, options);
var generationtime = self.getGenerationTime();
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