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 e1dc67f0 authored by Alessio Zampatti's avatar Alessio Zampatti Committed by GitHub

Merge pull request #602 from Adyen/develop

Release 5.1.0
parents 3590a809 f57578c5
...@@ -389,7 +389,19 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -389,7 +389,19 @@ class Result extends \Magento\Framework\App\Action\Action
$request['paymentData'] = $this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation("paymentData"); $request['paymentData'] = $this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation("paymentData");
} }
$request["details"] = $response; $request["details"] = $response;
if (!empty($this->_session->getLastRealOrder()) &&
!empty($this->_session->getLastRealOrder()->getPayment()) &&
!empty($this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation("details"))
) {
$details = $this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation("details");
$key = array_search('returnUrlQueryString', $details[0]);
if ($key !== false) {
$request["details"] = array("returnUrlQueryString" => http_build_query($response));
}
}
try { try {
$response = $service->paymentsDetails($request); $response = $service->paymentsDetails($request);
......
...@@ -63,13 +63,37 @@ class CcAuthorizationDataBuilder implements BuilderInterface ...@@ -63,13 +63,37 @@ class CcAuthorizationDataBuilder implements BuilderInterface
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_SECURITY_CODE); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::ENCRYPTED_SECURITY_CODE);
$payment->unsAdditionalInformation(AdyenCcDataAssignObserver::HOLDER_NAME); $payment->unsAdditionalInformation(AdyenCcDataAssignObserver::HOLDER_NAME);
// if installments is set add it into the request // if installments is set and card type is credit card add it into the request
if ($payment->getAdditionalInformation(AdyenCcDataAssignObserver::NUMBER_OF_INSTALLMENTS) && $numberOfInstallments = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::NUMBER_OF_INSTALLMENTS) ?: 0;
$payment->getAdditionalInformation(AdyenCcDataAssignObserver::NUMBER_OF_INSTALLMENTS) > 0 $comboCardType = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::COMBO_CARD_TYPE) ?: 'credit';
) { if ($numberOfInstallments > 0) {
$requestBody['installments']['value'] = $payment->getAdditionalInformation(AdyenCcDataAssignObserver::NUMBER_OF_INSTALLMENTS); $requestBody['installments']['value'] = $numberOfInstallments;
}
// if card type is debit then change the issuer type and unset the installments field
if ($comboCardType == 'debit') {
if ($selectedDebitBrand = $this->getSelectedDebitBrand($payment->getAdditionalInformation('cc_type'))) {
$requestBody['additionalData']['overwriteBrand'] = true;
$requestBody['selectedBrand'] = $selectedDebitBrand;
$requestBody['paymentMethod']['type'] = $selectedDebitBrand;
}
unset($requestBody['installments']);
} }
$request['body'] = $requestBody; $request['body'] = $requestBody;
return $request; return $request;
} }
/**
* @param string $brand
* @return string
*/
private function getSelectedDebitBrand($brand)
{
if ($brand == 'VI') {
return 'electron';
}
if ($brand == 'MC') {
return 'maestro';
}
return null;
}
} }
\ No newline at end of file
...@@ -184,6 +184,9 @@ class CheckoutResponseValidator extends AbstractValidator ...@@ -184,6 +184,9 @@ class CheckoutResponseValidator extends AbstractValidator
// Flag to show we are in the checkoutAPM flow // Flag to show we are in the checkoutAPM flow
$payment->setAdditionalInformation('checkoutAPM', true); $payment->setAdditionalInformation('checkoutAPM', true);
if (!empty($response['details'])) {
$payment->setAdditionalInformation('details', $response['details']);
}
if ($redirectUrl && $paymentData && $redirectMethod) { if ($redirectUrl && $paymentData && $redirectMethod) {
$payment->setAdditionalInformation('redirectUrl', $redirectUrl); $payment->setAdditionalInformation('redirectUrl', $redirectUrl);
$payment->setAdditionalInformation('redirectMethod', $redirectMethod); $payment->setAdditionalInformation('redirectMethod', $redirectMethod);
......
...@@ -1098,43 +1098,6 @@ class Data extends AbstractHelper ...@@ -1098,43 +1098,6 @@ class Data extends AbstractHelper
return false; return false;
} }
/**
* @return mixed
*/
/**
* @param $paymentMethod
* @return bool
*/
public function isPaymentMethodBcmcMobileQRMethod($paymentMethod)
{
if (strpos($paymentMethod, 'bcmc_mobile_QR') !== false) {
return true;
}
return false;
}
/**
* The payment method for wechat should be only wechatweb until we support the others too.
*
* @param $paymentMethod
* @return bool
*/
public function isPaymentMethodWechatpayExceptWeb($paymentMethod)
{
if (strpos($paymentMethod, 'wechatpay') !== false) {
if (strpos($paymentMethod, 'wechatpayWeb') !== false) {
return false;
}
return true;
}
return false;
}
public function getRatePayId() public function getRatePayId()
{ {
return $this->getAdyenHppConfigData("ratepay_id"); return $this->getAdyenHppConfigData("ratepay_id");
...@@ -1156,18 +1119,6 @@ class Data extends AbstractHelper ...@@ -1156,18 +1119,6 @@ class Data extends AbstractHelper
return false; return false;
} }
/**
* @param $paymentMethod
* @return bool
*/
public function isPaymentMethodBoletoMethod($paymentMethod)
{
if (strpos($paymentMethod, 'boleto') !== false) {
return true;
}
return false;
}
/** /**
* @return bool * @return bool
*/ */
......
...@@ -135,41 +135,7 @@ class PaymentMethods extends AbstractHelper ...@@ -135,41 +135,7 @@ class PaymentMethods extends AbstractHelper
$quote = $this->quoteRepository->getActive($quoteId); $quote = $this->quoteRepository->getActive($quoteId);
$store = $quote->getStore(); $store = $quote->getStore();
$paymentMethods = $this->addHppMethodsToConfig($store, $country); $paymentMethods = $this->fetchAlternativeMethods($store, $country);
return $paymentMethods;
}
/**
* @param $store
* @return array
*/
protected function addHppMethodsToConfig($store, $country)
{
$paymentMethods = [];
$ccEnabled = $this->config->getValue(
'payment/' . \Adyen\Payment\Model\Ui\AdyenCcConfigProvider::CODE . '/active',
\Magento\Store\Model\ScopeInterface::SCOPE_STORES,
$store->getCode()
);
$ccTypes = array_keys($this->adyenHelper->getCcTypesAltData());
foreach ($this->fetchAlternativeMethods($store, $country) as $methodCode => $methodData) {
/*
* skip payment methods if it is a creditcard that is enabled in adyen_cc or a boleto method or wechat but
* not wechatpay
*/
if (($ccEnabled && in_array($methodCode, $ccTypes)) ||
$this->adyenHelper->isPaymentMethodBoletoMethod($methodCode) ||
$this->adyenHelper->isPaymentMethodBcmcMobileQRMethod($methodCode) ||
$this->adyenHelper->isPaymentMethodWechatpayExceptWeb($methodCode)
) {
continue;
}
$paymentMethods[$methodCode] = $methodData;
}
return $paymentMethods; return $paymentMethods;
} }
...@@ -215,10 +181,6 @@ class PaymentMethods extends AbstractHelper ...@@ -215,10 +181,6 @@ class PaymentMethods extends AbstractHelper
if (isset($responseData['paymentMethods'])) { if (isset($responseData['paymentMethods'])) {
foreach ($responseData['paymentMethods'] as $paymentMethod) { foreach ($responseData['paymentMethods'] as $paymentMethod) {
if ($paymentMethod['type'] == "scheme") {
continue;
}
$paymentMethodCode = $paymentMethod['type']; $paymentMethodCode = $paymentMethod['type'];
$paymentMethod = $this->fieldMapPaymentMethod($paymentMethod); $paymentMethod = $this->fieldMapPaymentMethod($paymentMethod);
......
...@@ -188,7 +188,7 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -188,7 +188,7 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
!isset($contractDetail['expiryDate']) || !isset($contractDetail['expiryDate']) ||
!isset($contractDetail['paymentMethod']) !isset($contractDetail['paymentMethod'])
) { ) {
$this->_errors[] = __('"In the Additional data in API response section, select: Card summary, Expiry Date, Cardholder name, Recurring details and Variant to create billing agreements immediately after the payment is authorized."'); $this->_errors[] = __('"In the Additional data in API response section, select: Card bin, Card summary, Expiry Date, Cardholder name, Recurring details and Variant to create billing agreements immediately after the payment is authorized."');
return $this; return $this;
} }
// Billing agreement is CC // Billing agreement is CC
......
...@@ -414,6 +414,10 @@ class Cron ...@@ -414,6 +414,10 @@ class Cron
if ($previousAdyenEventCode != "AUTHORISATION : TRUE" || if ($previousAdyenEventCode != "AUTHORISATION : TRUE" ||
$this->_eventCode == Notification::ORDER_CLOSED $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->_order->setState(\Magento\Sales\Model\Order::STATE_NEW);
}
$this->_holdCancelOrder(false); $this->_holdCancelOrder(false);
} else { } else {
$this->_order->setData('adyen_notification_event_code', $previousAdyenEventCode); $this->_order->setData('adyen_notification_event_code', $previousAdyenEventCode);
...@@ -929,6 +933,12 @@ class Cron ...@@ -929,6 +933,12 @@ class Cron
break; break;
} }
// Order is already Cancelled
if ($this->_order->isCanceled()){
$this->_adyenLogger->addAdyenNotificationCronjob("Order is already cancelled, skipping OFFER_CLOSED");
break;
}
/* /*
* For cards, it can be 'visa', 'maestro',... * For cards, it can be 'visa', 'maestro',...
* For alternatives, it can be 'ideal', 'directEbanking',... * For alternatives, it can be 'ideal', 'directEbanking',...
......
...@@ -173,7 +173,7 @@ class AdyenCcConfigProvider implements ConfigProviderInterface ...@@ -173,7 +173,7 @@ class AdyenCcConfigProvider implements ConfigProviderInterface
} }
/** /**
* Retrieve availables credit card types * Retrieve available credit card types
* *
* @return array * @return array
*/ */
...@@ -195,9 +195,8 @@ class AdyenCcConfigProvider implements ConfigProviderInterface ...@@ -195,9 +195,8 @@ class AdyenCcConfigProvider implements ConfigProviderInterface
} }
/** /**
* Retrieve availables credit card type codes by alt code * Retrieve available credit card type codes by alt code
* *
* @param string $methodCode
* @return array * @return array
*/ */
protected function getCcAvailableTypesByAlt() protected function getCcAvailableTypesByAlt()
...@@ -293,3 +292,4 @@ class AdyenCcConfigProvider implements ConfigProviderInterface ...@@ -293,3 +292,4 @@ class AdyenCcConfigProvider implements ConfigProviderInterface
return $this->_request; return $this->_request;
} }
} }
...@@ -47,6 +47,7 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver ...@@ -47,6 +47,7 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver
const TIMEZONE_OFFSET = 'timezone_offset'; const TIMEZONE_OFFSET = 'timezone_offset';
const LANGUAGE = 'language'; const LANGUAGE = 'language';
const GUEST_EMAIL = 'guestEmail'; const GUEST_EMAIL = 'guestEmail';
const COMBO_CARD_TYPE = 'combo_card_type';
/** /**
* @var array * @var array
...@@ -67,7 +68,8 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver ...@@ -67,7 +68,8 @@ class AdyenCcDataAssignObserver extends AbstractDataAssignObserver
self::SCREEN_HEIGHT, self::SCREEN_HEIGHT,
self::TIMEZONE_OFFSET, self::TIMEZONE_OFFSET,
self::LANGUAGE, self::LANGUAGE,
self::GUEST_EMAIL self::GUEST_EMAIL,
self::COMBO_CARD_TYPE
]; ];
/** /**
......
...@@ -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": "5.0.2", "version": "5.1.0",
"license": [ "license": [
"OSL-3.0", "OSL-3.0",
"AFL-3.0" "AFL-3.0"
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</field> </field>
<field id="sepa_flow" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1"> <field id="sepa_flow" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Sepa Payment flow</label> <label>Sepa Payment flow</label>
<tooltip>If you are not sure just leave it at 'Sale’. Sale means it is always immidiate capture with auth/cap it will follow the Capture Delay. If you want to enable 'Auth/Capt' for SEPA Direct Debit, please contact support@adyen.com</tooltip> <tooltip>If you are not sure just leave it at 'Sale’. Sale means it is always immediate capture with auth/cap it will follow the Capture Delay. If you want to enable 'Auth/Capt' for SEPA Direct Debit, please contact support@adyen.com</tooltip>
<source_model>Adyen\Payment\Model\Config\Source\SepaFlow</source_model> <source_model>Adyen\Payment\Model\Config\Source\SepaFlow</source_model>
<config_path>payment/adyen_abstract/sepa_flow</config_path> <config_path>payment/adyen_abstract/sepa_flow</config_path>
</field> </field>
......
...@@ -52,4 +52,7 @@ ...@@ -52,4 +52,7 @@
"You will be redirected to the Adyen App", "You will be redirected to the Adyen App" "You will be redirected to the Adyen App", "You will be redirected to the Adyen App"
"Continue to Adyen App", "Continue to Adyen App" "Continue to Adyen App", "Continue to Adyen App"
"Do not use Installments", "Do not use Installments" "Do not use Installments", "Do not use Installments"
"(Please provide a card with the type from the list above)", "(Please provide a card with the type from the list above)" "(Please provide a card with the type from the list above)", "(Please provide a card with the type from the list above)"
\ No newline at end of file "Select debit or credit card","Select debit or credit card"
"Credit","Credit"
"Debit","Debit"
\ No newline at end of file
...@@ -47,6 +47,7 @@ define( ...@@ -47,6 +47,7 @@ define(
return Component.extend({ return Component.extend({
// need to duplicate as without the button will never activate on first time page view // need to duplicate as without the button will never activate on first time page view
isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null), isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null),
comboCardOption: ko.observable('credit'),
defaults: { defaults: {
template: 'Adyen_Payment/payment/cc-form', template: 'Adyen_Payment/payment/cc-form',
...@@ -294,7 +295,8 @@ define( ...@@ -294,7 +295,8 @@ define(
'screen_width': browserInfo.screenWidth, 'screen_width': browserInfo.screenWidth,
'screen_height': browserInfo.screenHeight, 'screen_height': browserInfo.screenHeight,
'timezone_offset': browserInfo.timeZoneOffset, 'timezone_offset': browserInfo.timeZoneOffset,
'language': browserInfo.language 'language': browserInfo.language,
'combo_card_type': this.comboCardOption()
} }
}; };
this.vaultEnabler.visitAdditionalData(data); this.vaultEnabler.visitAdditionalData(data);
...@@ -468,11 +470,19 @@ define( ...@@ -468,11 +470,19 @@ define(
: false : false
}, },
hasInstallments: function () { hasInstallments: function () {
return window.checkoutConfig.payment.adyenCc.hasInstallments; return this.comboCardOption() === 'credit' && window.checkoutConfig.payment.adyenCc.hasInstallments;
}, },
getAllInstallments: function () { getAllInstallments: function () {
return window.checkoutConfig.payment.adyenCc.installments; return window.checkoutConfig.payment.adyenCc.installments;
}, },
areComboCardsEnabled: function () {
if (quote.billingAddress() === null) {
return false;
}
var countryId = quote.billingAddress().countryId;
var currencyCode = quote.totals().quote_currency_code;
return currencyCode === "BRL" && countryId === "BR";
},
setPlaceOrderHandler: function (handler) { setPlaceOrderHandler: function (handler) {
this.placeOrderHandler = handler; this.placeOrderHandler = handler;
}, },
......
...@@ -43,6 +43,7 @@ define( ...@@ -43,6 +43,7 @@ define(
var paymentMethod = ko.observable(null); var paymentMethod = ko.observable(null);
var messageComponents; var messageComponents;
var shippingAddressCountryCode = quote.shippingAddress().countryId; var shippingAddressCountryCode = quote.shippingAddress().countryId;
var unsupportedPaymentMethods = ['scheme', 'boleto', 'bcmc_mobile_QR', 'wechatpay'];
/** /**
* Shareble adyen checkout component * Shareble adyen checkout component
* @type {AdyenCheckout} * @type {AdyenCheckout}
...@@ -70,7 +71,7 @@ define( ...@@ -70,7 +71,7 @@ define(
'bankLocationId' 'bankLocationId'
]); ]);
return this; return this;
},initialize: function () { }, initialize: function () {
var self = this; var self = this;
this._super(); this._super();
...@@ -87,9 +88,9 @@ define( ...@@ -87,9 +88,9 @@ define(
// reset variable: // reset variable:
adyenPaymentService.setPaymentMethods(); adyenPaymentService.setPaymentMethods();
adyenPaymentService.retrieveAvailablePaymentMethods(function() { adyenPaymentService.retrieveAvailablePaymentMethods(function () {
let paymentMethods = adyenPaymentService.getAvailablePaymentMethods(); var paymentMethods = adyenPaymentService.getAvailablePaymentMethods();
if (JSON.stringify(paymentMethods).indexOf("ratepay") > -1) { if (JSON.stringify(paymentMethods).indexOf("ratepay") > -1) {
var ratePayId = window.checkoutConfig.payment.adyenHpp.ratePayId; var ratePayId = window.checkoutConfig.payment.adyenHpp.ratePayId;
var dfValueRatePay = self.getRatePayDeviceIdentToken(); var dfValueRatePay = self.getRatePayDeviceIdentToken();
...@@ -133,7 +134,7 @@ define( ...@@ -133,7 +134,7 @@ define(
}, },
getAdyenHppPaymentMethods: function () { getAdyenHppPaymentMethods: function () {
var self = this; var self = this;
let currentShippingAddressCountryCode = quote.shippingAddress().countryId; var currentShippingAddressCountryCode = quote.shippingAddress().countryId;
// retrieve new payment methods if country code changed // retrieve new payment methods if country code changed
if (shippingAddressCountryCode != currentShippingAddressCountryCode) { if (shippingAddressCountryCode != currentShippingAddressCountryCode) {
...@@ -145,14 +146,19 @@ define( ...@@ -145,14 +146,19 @@ define(
var paymentMethods = adyenPaymentService.getAvailablePaymentMethods(); var paymentMethods = adyenPaymentService.getAvailablePaymentMethods();
var paymentList = _.map(paymentMethods, function (value) { var paymentList = _.reduce(paymentMethods, function (accumulator, value) {
if (!self.isPaymentMethodSupported(value.type)) {
return accumulator;
}
var result = {}; var result = {};
/** /**
* Returns the payment method's brand code (in checkout api it is the type) * Returns the payment method's brand code (in checkout api it is the type)
* @returns {*} * @returns {*}
*/ */
result.getBrandCode = function() { result.getBrandCode = function () {
return self.getBrandCodeFromPaymentMethod(value); return self.getBrandCodeFromPaymentMethod(value);
}; };
...@@ -180,7 +186,7 @@ define( ...@@ -180,7 +186,7 @@ define(
* @param bool * @param bool
* @returns {*} * @returns {*}
*/ */
result.isPlaceOrderAllowed = function(bool) { result.isPlaceOrderAllowed = function (bool) {
self.isPlaceOrderActionAllowed(bool); self.isPlaceOrderActionAllowed(bool);
return result.placeOrderAllowed(bool); return result.placeOrderAllowed(bool);
}; };
...@@ -191,11 +197,11 @@ define( ...@@ -191,11 +197,11 @@ define(
* @param bool * @param bool
* @returns {*} * @returns {*}
*/ */
result.isPlaceOrderAllowed = function(bool) { result.isPlaceOrderAllowed = function (bool) {
self.isPlaceOrderActionAllowed(bool); self.isPlaceOrderActionAllowed(bool);
return result.placeOrderAllowed(bool); return result.placeOrderAllowed(bool);
}; };
result.afterPlaceOrder = function() { result.afterPlaceOrder = function () {
return self.afterPlaceOrder(); return self.afterPlaceOrder();
}; };
/** /**
...@@ -282,7 +288,7 @@ define( ...@@ -282,7 +288,7 @@ define(
result.findIssuersProperty = function () { result.findIssuersProperty = function () {
var issuerKey = false; var issuerKey = false;
if (typeof value.details !== 'undefined') { if (typeof value.details !== 'undefined') {
$.each(value.details, function(key, detail) { $.each(value.details, function (key, detail) {
if (typeof detail.items !== 'undefined' && detail.key == 'issuer') { if (typeof detail.items !== 'undefined' && detail.key == 'issuer') {
issuerKey = key; issuerKey = key;
} }
...@@ -317,7 +323,7 @@ define( ...@@ -317,7 +323,7 @@ define(
* Returns the issuers for a payment method * Returns the issuers for a payment method
* @returns {*} * @returns {*}
*/ */
result.getIssuers = function() { result.getIssuers = function () {
if (result.hasIssuersAvailable()) { if (result.hasIssuersAvailable()) {
return value.details[result.findIssuersProperty()].items; return value.details[result.findIssuersProperty()].items;
} }
...@@ -502,11 +508,31 @@ define( ...@@ -502,11 +508,31 @@ define(
result.bankLocationId = ko.observable(null); result.bankLocationId = ko.observable(null);
} }
return result; accumulator.push(result);
}); return accumulator;
}, []);
return paymentList; return paymentList;
}, },
/**
* Some payment methods we do not want to render as it requires extra implementation
* or is already implemented in a separate payment method.
* Using a match as we want to prevent to render all Boleto and most of the WeChat types
* @param paymentMethod
* @returns {boolean}
*/
isPaymentMethodSupported: function (paymentMethod) {
if (paymentMethod == 'wechatpayWeb') {
return true;
}
for (var i = 0; i < unsupportedPaymentMethods.length; i++) {
var match = paymentMethod.match(unsupportedPaymentMethods[i]);
if (match) {
return false;
}
}
return true;
},
getGenderTypes: function () { getGenderTypes: function () {
return _.map(window.checkoutConfig.payment.adyenHpp.genderTypes, function (value, key) { return _.map(window.checkoutConfig.payment.adyenHpp.genderTypes, function (value, key) {
return { return {
...@@ -575,13 +601,13 @@ define( ...@@ -575,13 +601,13 @@ define(
return true; return true;
}, },
placeRedirectOrder: function(data) { placeRedirectOrder: function (data) {
// Place Order but use our own redirect url after // Place Order but use our own redirect url after
var self = this; var self = this;
fullScreenLoader.startLoader(); fullScreenLoader.startLoader();
var messageContainer = this.messageContainer; var messageContainer = this.messageContainer;
if(brandCode()) { if (brandCode()) {
messageContainer = self.messageComponents['messages-' + brandCode()]; messageContainer = self.messageComponents['messages-' + brandCode()];
} }
...@@ -599,7 +625,7 @@ define( ...@@ -599,7 +625,7 @@ define(
$("#messages-" + brandCode()).text(response['responseJSON'].message).slideDown(); $("#messages-" + brandCode()).text(response['responseJSON'].message).slideDown();
} }
setTimeout(function(){ setTimeout(function () {
$("#messages-" + brandCode()).slideUp(); $("#messages-" + brandCode()).slideUp();
}, 10000); }, 10000);
self.isPlaceOrderActionAllowed(true); self.isPlaceOrderActionAllowed(true);
...@@ -630,9 +656,9 @@ define( ...@@ -630,9 +656,9 @@ define(
}, },
validate: function (brandCode) { validate: function (brandCode) {
var form = '#payment_form_' + this.getCode() + '_' + brandCode; var form = '#payment_form_' + this.getCode() + '_' + brandCode;
var validate = $(form).validation() && $(form).validation('isValid'); var validate = $(form).validation() && $(form).validation('isValid');
if(!validate) { if (!validate) {
return false; return false;
} }
...@@ -691,11 +717,11 @@ define( ...@@ -691,11 +717,11 @@ define(
* @param arr * @param arr
* @returns {*} * @returns {*}
*/ */
filterUndefinedItemsInArray: function(arr) { filterUndefinedItemsInArray: function (arr) {
return arr.filter(function(item){ return arr.filter(function (item) {
return typeof item !== 'undefined'; return typeof item !== 'undefined';
}); });
} }
}); });
} }
); );
\ No newline at end of file
...@@ -73,6 +73,24 @@ ...@@ -73,6 +73,24 @@
<br/> <br/>
<!-- /ko --> <!-- /ko -->
<!-- ko if: (areComboCardsEnabled())-->
<div class="field required">
<label for="adyen-combo-card-select">
<!--ko text: $t('Select debit or credit card')--><!-- /ko -->
</label>
<div class="control">
<select id="adyen-combo-card-select"
class="select"
name="payment[combo_card_method]"
data-bind="value: comboCardOption"
>
<option value="credit"><!--ko text: $t('Credit Card')--><!-- /ko --></option>
<option value="debit"><!--ko text: $t('Debit Card')--><!-- /ko --></option>
</select>
</div>
</div>
<!-- /ko -->
<div class="field number cardContainerField"> <div class="field number cardContainerField">
<div class="checkout-component-dock" afterRender="renderSecureFields()" data-bind="attr: { id: 'cardContainer'}"></div> <div class="checkout-component-dock" afterRender="renderSecureFields()" data-bind="attr: { id: 'cardContainer'}"></div>
</div> </div>
......
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