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 71210b90 authored by rikterbeek's avatar rikterbeek

oneclick implemented billing agreement disable call to adyen, creditcardtype...

oneclick implemented billing agreement disable call to adyen, creditcardtype now set for CreditCard and Oneclick payment method, removed cron controller, added info and error logfile for info and error statements, fix save creditcard checkbox function
parent 260fd42d
...@@ -37,6 +37,16 @@ class Cc extends \Magento\Payment\Block\Form ...@@ -37,6 +37,16 @@ class Cc extends \Magento\Payment\Block\Form
*/ */
protected $_paymentConfig; protected $_paymentConfig;
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $_storeManager;
/** /**
* @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Payment\Model\Config $paymentConfig * @param \Magento\Payment\Model\Config $paymentConfig
...@@ -45,12 +55,39 @@ class Cc extends \Magento\Payment\Block\Form ...@@ -45,12 +55,39 @@ class Cc extends \Magento\Payment\Block\Form
public function __construct( public function __construct(
\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\View\Element\Template\Context $context,
\Magento\Payment\Model\Config $paymentConfig, \Magento\Payment\Model\Config $paymentConfig,
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) { ) {
parent::__construct($context, $data); parent::__construct($context, $data);
$this->_paymentConfig = $paymentConfig; $this->_paymentConfig = $paymentConfig;
$this->_adyenHelper = $adyenHelper;
$this->_storeManager = $storeManager;
} }
public function getCsePublicKey()
{
// get storeId for admin
if (!$this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) {
$storeId = $this->_storeManager->getStore()->getId();
} else {
$storeId = null;
}
$demoMode = $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId);
if($demoMode) {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_test', $storeId);
} else {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_live', $storeId);
}
return $cseKey;
}
/** /**
* Retrieve availables credit card types * Retrieve availables credit card types
* *
......
...@@ -39,4 +39,21 @@ class Cc extends AbstractInfo ...@@ -39,4 +39,21 @@ class Cc extends AbstractInfo
// $this->setTemplate('Magento_OfflinePayments::info/pdf/checkmo.phtml'); // $this->setTemplate('Magento_OfflinePayments::info/pdf/checkmo.phtml');
// return $this->toHtml(); // return $this->toHtml();
// } // }
/**
* Return credit cart type
*
* @return string
*/
public function getCcTypeName()
{
$types = $this->_adyenHelper->getAdyenCcTypes();
$ccType = $this->getInfo()->getCcType();
if (isset($types[$ccType])) {
return $types[$ccType]['name'];
} else {
return __('Unknown');
}
}
} }
...@@ -31,4 +31,9 @@ class Hpp extends AbstractInfo ...@@ -31,4 +31,9 @@ class Hpp extends AbstractInfo
*/ */
protected $_template = 'Adyen_Payment::info/adyen_hpp.phtml'; protected $_template = 'Adyen_Payment::info/adyen_hpp.phtml';
public function isPaymentSelectionOnAdyen()
{
return $this->_adyenHelper->getAdyenHppConfigDataFlag('payment_selection_on_adyen');
}
} }
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
namespace Adyen\Payment\Block\Info; namespace Adyen\Payment\Block\Info;
class Oneclick extends AbstractInfo class Oneclick extends Cc
{ {
/** /**
* @var string * @var string
*/ */
protected $_template = 'Adyen_Payment::info/adyen_oneclick.phtml'; // protected $_template = 'Adyen_Payment::info/adyen_oneclick.phtml';
/** /**
* @return string * @return string
......
...@@ -122,16 +122,16 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -122,16 +122,16 @@ class Result extends \Magento\Framework\App\Action\Action
{ {
$result = true; $result = true;
$this->_debugData['Step1'] = 'Processing ResultUrl'; $this->_adyenLogger->addAdyenResult('Processing ResultUrl');
$storeId = null; $storeId = null;
if (empty($response)) { if (empty($response)) {
$this->_debugData['error'] = 'Response is empty, please check your webserver that the result url accepts parameters'; $this->_adyenLogger->addAdyenResult('Response is empty, please check your webserver that the result url accepts parameters');
throw new \Magento\Framework\Exception\LocalizedException(__('Response is empty, please check your webserver that the result url accepts parameters')); throw new \Magento\Framework\Exception\LocalizedException(__('Response is empty, please check your webserver that the result url accepts parameters'));
} }
// Log the results in log file and adyen_debug table // Log the results in log file and adyen_debug table
$this->_debugData['response'] = $response; $this->_adyenLogger->addAdyenResult($response);
// authenticate result url // authenticate result url
...@@ -182,7 +182,7 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -182,7 +182,7 @@ class Result extends \Magento\Framework\App\Action\Action
{ {
$result = false; $result = false;
$this->_debugData['Step2'] = 'Updating the order'; $this->_adyenLogger->addAdyenResult('Updating the order');
$authResult = $response['authResult']; $authResult = $response['authResult'];
$paymentMethod = isset($response['paymentMethod']) ? trim($response['paymentMethod']) : ''; $paymentMethod = isset($response['paymentMethod']) ? trim($response['paymentMethod']) : '';
...@@ -210,24 +210,24 @@ class Result extends \Magento\Framework\App\Action\Action ...@@ -210,24 +210,24 @@ class Result extends \Magento\Framework\App\Action\Action
case \Adyen\Payment\Model\Notification::PENDING: case \Adyen\Payment\Model\Notification::PENDING:
// do nothing wait for the notification // do nothing wait for the notification
$result = true; $result = true;
$this->_debugData['Step4'] = 'Do nothing wait for the notification'; $this->_adyenLogger->addAdyenResult('Do nothing wait for the notification');
break; break;
case \Adyen\Payment\Model\Notification::CANCELLED: case \Adyen\Payment\Model\Notification::CANCELLED:
$this->_debugData['Step4'] = 'Cancel or Hold the order'; $this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false; $result = false;
break; break;
case \Adyen\Payment\Model\Notification::REFUSED: case \Adyen\Payment\Model\Notification::REFUSED:
// if refused there will be a AUTHORIZATION : FALSE notification send only exception is ideal // if refused there will be a AUTHORIZATION : FALSE notification send only exception is idea
$this->_debugData['Step4'] = 'Cancel or Hold the order'; $this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false; $result = false;
break; break;
case \Adyen\Payment\Model\Notification::ERROR: case \Adyen\Payment\Model\Notification::ERROR:
//attempt to hold/cancel //attempt to hold/cancel
$this->_debugData['Step4'] = 'Cancel or Hold the order'; $this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false; $result = false;
break; break;
default: default:
$this->_debugData['error'] = 'This event is not supported: ' . $authResult; $this->_adyenLogger->addAdyenResult('This event is not supported: ' . $authResult);
$result = false; $result = false;
break; break;
} }
......
...@@ -384,12 +384,31 @@ class Data extends AbstractHelper ...@@ -384,12 +384,31 @@ class Data extends AbstractHelper
} }
} }
/**
* Creditcard type that is selected is different from creditcard type that we get back from the request this
* function get the magento creditcard type this is needed for getting settings like installments
* @param $ccType
* @return mixed
*/
public function getMagentoCreditCartType($ccType)
{
$ccTypesMapper = $this->getCcTypesAltData();
if(isset($ccTypesMapper[$ccType])) {
$ccType = $ccTypesMapper[$ccType]['code'];
}
return $ccType;
}
public function getCcTypesAltData() public function getCcTypesAltData()
{ {
$adyenCcTypes = $this->getAdyenCcTypes(); $adyenCcTypes = $this->getAdyenCcTypes();
$types = array(); $types = array();
foreach ($adyenCcTypes as $key => $data) { foreach ($adyenCcTypes as $key => $data) {
$types[$data['code_alt']] = $data; $types[$data['code_alt']] = $data;
$types[$data['code_alt']]['code'] = $key;
} }
return $types; return $types;
} }
......
...@@ -21,45 +21,23 @@ ...@@ -21,45 +21,23 @@
* Author: Adyen <magento@adyen.com> * Author: Adyen <magento@adyen.com>
*/ */
namespace Adyen\Payment\Controller\Process; namespace Adyen\Payment\Logger\Handler;
use Symfony\Component\Config\Definition\Exception\Exception; use Adyen\Payment\Logger\AdyenLogger;
use Monolog\Logger;
/** class AdyenError extends AdyenBase
* Class Json
* @package Adyen\Payment\Controller\Process
*/
class Cron extends \Magento\Framework\App\Action\Action
{ {
/**
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager;
/** /**
* @var \Magento\Framework\Controller\Result\RawFactory * @var string
*/ */
protected $_resultFactory; protected $fileName = '/var/log/adyen/error.log';
/** /**
* @param \Magento\Framework\App\Action\Context $context * @var int
*/ */
public function __construct( protected $loggerType = AdyenLogger::ERROR;
\Magento\Framework\App\Action\Context $context
) {
parent::__construct($context);
$this->_objectManager = $context->getObjectManager();
$this->_resultFactory = $context->getResultFactory();
}
/** protected $level = AdyenLogger::ERROR;
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function execute()
{
$cron = $this->_objectManager->create('Adyen\Payment\Model\Cron');
$cron->processNotification();
}
} }
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
namespace Adyen\Payment\Logger\Handler;
use Adyen\Payment\Logger\AdyenLogger;
use Monolog\Logger;
class AdyenInfo extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/info.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::INFO;
protected $level = AdyenLogger::INFO;
}
...@@ -127,6 +127,7 @@ class AdyenHppConfigProvider implements ConfigProviderInterface ...@@ -127,6 +127,7 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
$config['payment']['adyenHpp']['redirectUrl'][$code] = $this->getMethodRedirectUrl($code); $config['payment']['adyenHpp']['redirectUrl'][$code] = $this->getMethodRedirectUrl($code);
// get payment methods // get payment methods
$config['payment'] ['adyenHpp']['paymentMethods'] = $this->getAdyenHppPaymentMethods(); $config['payment'] ['adyenHpp']['paymentMethods'] = $this->getAdyenHppPaymentMethods();
} }
} }
......
...@@ -170,6 +170,11 @@ class PaymentRequest extends DataObject ...@@ -170,6 +170,11 @@ class PaymentRequest extends DataObject
$request['recurring'] = $recurring; $request['recurring'] = $recurring;
} }
$this->_adyenLogger->error('storeCC?:' . $payment->getAdditionalInformation("store_cc"));
$this->_adyenLogger->error('recuringtype' . $recurringType);
$this->_adyenLogger->error('recurringcontractType' . $recurringContractType);
$billingAddress = $order->getBillingAddress(); $billingAddress = $order->getBillingAddress();
if($billingAddress) if($billingAddress)
...@@ -447,6 +452,43 @@ class PaymentRequest extends DataObject ...@@ -447,6 +452,43 @@ class PaymentRequest extends DataObject
return $result; return $result;
} }
/**
* Disable a recurring contract
*
* @param string $recurringDetailReference
* @param string $shopperReference
* @param int|Mage_Core_model_Store|null $store
*
* @throws Adyen_Payment_Exception
* @return bool
*/
public function disableRecurringContract($recurringDetailReference, $shopperReference)
{
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account");
$request = array(
"merchantAccount" => $merchantAccount,
"shopperReference" => $shopperReference,
"recurringDetailReference" => $recurringDetailReference
);
// call lib
$service = new \Adyen\Service\Recurring($this->_client);
try {
$result = $service->disable($request);
} catch(\Exception $e) {
$this->_adyenLogger->info($e->getMessage());
}
if(isset($result['response']) && $result['response'] == '[detail-successfully-disabled]') {
return true;
} else {
echo 'hier';die();
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
}
}
/** /**
* Retrieve pspReference from payment object * Retrieve pspReference from payment object
* *
......
...@@ -171,11 +171,11 @@ class Cron ...@@ -171,11 +171,11 @@ class Cron
//fixme somehow the created_at is saved in my timzone //fixme somehow the created_at is saved in my timzone
$dateStart = new \DateTime(); $dateStart = new \DateTime();
// execute notifications from 5 minute or earlier because order could not yet been created by magento // execute notifications from 2 minute or earlier because order could not yet been created by magento
$dateStart = new \DateTime(); $dateStart = new \DateTime();
$dateStart->modify('-10 day'); // TODO: KEEP THIS ON -1 day $dateStart->modify('-1 day');
$dateEnd = new \DateTime(); $dateEnd = new \DateTime();
$dateEnd->modify('-1 minute'); // TODO: DO NOT COMMIT KEEP ON -5 $dateEnd->modify('-2 minute');
$dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true]; $dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true];
// create collection // create collection
......
...@@ -159,6 +159,8 @@ class Cc extends \Magento\Payment\Model\Method\Cc ...@@ -159,6 +159,8 @@ class Cc extends \Magento\Payment\Model\Method\Cc
parent::assignData($data); parent::assignData($data);
$infoInstance = $this->getInfoInstance(); $infoInstance = $this->getInfoInstance();
$infoInstance->setCcType($data['cc_type']);
if($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) { if($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) {
if(isset($data['encrypted_data'])) { if(isset($data['encrypted_data'])) {
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']); $infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
......
...@@ -62,6 +62,13 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -62,6 +62,13 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
protected $_canRefund = true; protected $_canRefund = true;
protected $_canRefundInvoicePartial = true; protected $_canRefundInvoicePartial = true;
/**
* Payment Method feature
*
* @var bool
*/
protected $_canUseInternal = false;
/** /**
* @var \Adyen\Payment\Model\Api\PaymentRequest * @var \Adyen\Payment\Model\Api\PaymentRequest
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
namespace Adyen\Payment\Model\Method; namespace Adyen\Payment\Model\Method;
use Magento\Framework\Webapi\Exception;
/** /**
* Adyen CreditCard payment method * Adyen CreditCard payment method
...@@ -44,9 +45,13 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc ...@@ -44,9 +45,13 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc
protected $_formBlockType = 'Adyen\Payment\Block\Form\Oneclick'; protected $_formBlockType = 'Adyen\Payment\Block\Form\Oneclick';
protected $_infoBlockType = 'Adyen\Payment\Block\Info\Oneclick'; protected $_infoBlockType = 'Adyen\Payment\Block\Info\Oneclick';
// public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) {
// return true; /**
// } * Payment Method not ready for internal use
*
* @var bool
*/
protected $_canUseInternal = false;
/** /**
* Assign data to info model instance * Assign data to info model instance
...@@ -60,6 +65,10 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc ...@@ -60,6 +65,10 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc
parent::assignData($data); parent::assignData($data);
$infoInstance = $this->getInfoInstance(); $infoInstance = $this->getInfoInstance();
// get from variant magento code for creditcard type and set this in ccType
$variant = $data['variant'];
$ccType = $this->_adyenHelper->getMagentoCreditCartType($variant);
$infoInstance->setCcType($ccType);
// save value remember details checkbox // save value remember details checkbox
$infoInstance->setAdditionalInformation('recurring_detail_reference', $data['recurring_detail_reference']); $infoInstance->setAdditionalInformation('recurring_detail_reference', $data['recurring_detail_reference']);
...@@ -76,4 +85,22 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc ...@@ -76,4 +85,22 @@ class Oneclick extends \Adyen\Payment\Model\Method\Cc
return $this; return $this;
} }
public function updateBillingAgreementStatus(\Adyen\Payment\Model\Billing\Agreement $agreement)
{
$targetStatus = $agreement->getStatus();
if($targetStatus == \Magento\Paypal\Model\Billing\Agreement::STATUS_CANCELED) {
try {
$this->_paymentRequest->disableRecurringContract(
$agreement->getReferenceId(),
$agreement->getCustomerReference()
);
} catch(Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
}
}
return $this;
}
} }
\ No newline at end of file
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
--> -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Paypal\Model\Billing\Agreement" type="Adyen\Payment\Model\Billing\Agreement" />
<type name="Adyen\Payment\Logger\Handler\AdyenDebug"> <type name="Adyen\Payment\Logger\Handler\AdyenDebug">
<arguments> <arguments>
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument> <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
...@@ -44,6 +45,16 @@ ...@@ -44,6 +45,16 @@
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument> <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
</arguments> </arguments>
</type> </type>
<type name="Adyen\Payment\Logger\Handler\AdyenInfo">
<arguments>
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
</arguments>
</type>
<type name="Adyen\Payment\Logger\Handler\AdyenError">
<arguments>
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
</arguments>
</type>
<type name="Adyen\Payment\Logger\AdyenLogger"> <type name="Adyen\Payment\Logger\AdyenLogger">
<arguments> <arguments>
<argument name="name" xsi:type="string">AdyenLoggerTest</argument> <argument name="name" xsi:type="string">AdyenLoggerTest</argument>
...@@ -52,6 +63,8 @@ ...@@ -52,6 +63,8 @@
<item name="adyenNotification" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenNotification</item> <item name="adyenNotification" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenNotification</item>
<item name="adyenResult" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenResult</item> <item name="adyenResult" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenResult</item>
<item name="adyenCronjob" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenCronjob</item> <item name="adyenCronjob" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenCronjob</item>
<item name="adyenInfo" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenInfo</item>
<item name="adyenError" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenError</item>
</argument> </argument>
</arguments> </arguments>
</type> </type>
......
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/**
* @var \Magento\Payment\Block\Adminhtml\Transparent\Form $block
*/
$code = $block->escapeHtml($block->getMethodCode());
$ccType = $block->getInfoData('cc_type');
$ccExpMonth = $block->getInfoData('cc_exp_month');
$ccExpYear = $block->getInfoData('cc_exp_year');
?>
<fieldset class="admin__fieldset payment-method" id="payment_form_<?php /* @noEscape */ echo $code; ?>"
style="display:none">
<div class="field admin__field _required">
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_owner">
<span><?php echo $block->escapeHtml(__('Name on Card')); ?></span>
</label>
<div class="admin__field-control">
<input type="text" id="<?php /* @noEscape */ echo $code; ?>_cc_owner" data-encrypted-name="holderName"
title="<?php echo $block->escapeHtml(__('Name on Card')); ?>" class="admin__control-text"
value="<?php /* @noEscape */ echo $block->getInfoData('cc_owner'); ?>"/>
</div>
</div>
<div class="field-type admin__field _required">
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_type">
<span><?php echo $block->escapeHtml(__('Credit Card Type')); ?></span>
</label>
<div class="admin__field-control">
<select id="<?php /* @noEscape */ echo $code; ?>_cc_type" name="payment[cc_type]"
class="required-entry validate-cc-type-select admin__control-select">
<option value=""></option>
<?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
<option value="<?php echo $block->escapeHtml($typeCode); ?>" <?php if ($typeCode == $ccType): ?>selected="selected"<?php endif ?>>
<?php echo $block->escapeHtml($typeName); ?>
</option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field-number admin__field _required">
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_number">
<span><?php echo $block->escapeHtml(__('Credit Card Number')); ?></span>
</label>
<div class="admin__field-control">
<input type="text" id="<?php /* @noEscape */ echo $code; ?>_cc_number" data-encrypted-name="number"
title="<?php echo $block->escapeHtml(__('Credit Card Number')); ?>" class="admin__control-text validate-cc-number"
value="<?php /* @noEscape */ echo $block->getInfoData('cc_number'); ?>"/>
</div>
</div>
<div class="field-date admin__field _required">
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_expiration">
<span><?php echo $block->escapeHtml(__('Expiration Date')); ?></span>
</label>
<div class="admin__field-control">
<select id="<?php /* @noEscape */ echo $code ?>_expiration" data-encrypted-name="expiryMonth"
class="admin__control-select admin__control-select-month validate-cc-exp required-entry">
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $block->escapeHtml($k); ?>"
<?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif ?>>
<?php echo $block->escapeHtml($v); ?>
</option>
<?php endforeach; ?>
</select>
<select id="<?php /* @noEscape */ echo $code ?>_expiration_yr" data-encrypted-name="expiryYear"
class="admin__control-select admin__control-select-year required-entry">
<?php foreach ($block->getCcYears() as $k => $v): ?>
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : '' ?>"
<?php if ($k == $ccExpYear): ?>selected="selected"<?php endif ?>>
<?php echo $block->escapeHtml($v); ?>
</option>
<?php endforeach ?>
</select>
<input type="hidden" id="<?php echo $code ?>_encrypted_form_expiry_generationtime" value="<?php echo date("c"); ?>" data-encrypted-name="generationtime" />
</div>
</div>
<?php if ($block->hasVerification()): ?>
<div class="field-number required admin__field _required">
<label class="admin__field-label" for="<?php /* @noEscape */ echo $code; ?>_cc_cid">
<span><?php echo $block->escapeHtml(__('Card Verification Number')); ?></span>
</label>
<div class="admin__field-control">
<input type="text" title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
class="required-entry validate-cc-cvn admin__control-cvn admin__control-text"
id="<?php /* @noEscape */ echo $code; ?>_cc_cid"
data-encrypted-name="cvc" value="<?php /* @noEscape */ echo $block->getInfoData('cc_cid') ?>"/>
</div>
</div>
<?php endif; ?>
<script>
require(['jquery',
'Magento_Sales/order/create/scripts',
"Magento_Sales/order/create/form",
'Adyen_Payment/js/adyen-encrypt'],
function(jQuery){
//<![CDATA[
var element = $('payment_form_<?php echo $code ?>');
var cse_form = $(element).closest('form');
var cse_key = <?php echo json_encode($block->getCsePublicKey()); ?>;
var cse_options = {
name: 'payment[encrypted_data]'
};
var cse = function() {
if (order.paymentMethod && order.paymentMethod == '<?php echo $code ?>') {
try {
// do not validate because it could be that CVC field does not exists (because MOTO this is not needed)
cse_options.enableValidations = false;
var cseForm = adyen.encrypt.createEncryptedForm(cse_form, cse_key, cse_options);
// encrypt data directly because submit button is not always on the page
var test = cseForm.encrypt();
cseForm.createEncryptedField(test);
} catch (e) {
var encryptionFailed = true;
}
var encryptedForm = document.getElementById(cse_options.name);
if (encryptionFailed || !encryptedForm || encryptedForm.value.length == 0) {
alert("Warning: Adyen Client Side Encryption cannot succeed.");
}
}
}
var cse_initialize = function() {
order.submit = order.submit.wrap(function(originalSaveMethod) {
cse.call(this);
originalSaveMethod();
});
}
if (document.readyState === "complete") {
cse_initialize();
}
else {
Event.observe(window, 'load', cse_initialize);
}
//]]>
});
</script>
</fieldset>
...@@ -45,6 +45,34 @@ $_isDemoMode = $block->isDemoMode(); ...@@ -45,6 +45,34 @@ $_isDemoMode = $block->isDemoMode();
</div> </div>
<?php endif;?> <?php endif;?>
<?php if($block->getCcTypeName() != ""):?>
<?php echo __('Credit Card Type: %1', $block->getCcTypeName()) ?><br/>
<?php endif; ?>
<?php if($_info->getCcLast4() != ""):?>
<?php echo __('Credit Card Number: xxxx-%1', $this->getInfo()->getCcLast4()) ?><br/>
<?php endif;?>
<?php if($_info->getAdditionalInformation('adyen_avs_result') != ""): ?>
<?php echo __('Avs result: %1', $_info->getAdditionalInformation('adyen_avs_result')) ?><br/>
<?php endif; ?>
<?php if($_info->getAdditionalInformation('adyen_cvc_result') != ""): ?>
<?php echo __('Cvc result: %1', $_info->getAdditionalInformation('adyen_cvc_result')) ?><br/>
<?php endif; ?>
<?php if($_info->getAdditionalInformation('adyen_total_fraud_score') != ""): ?>
<?php echo __('Total fraud score: %1', $_info->getAdditionalInformation('adyen_total_fraud_score')) ?><br/>
<?php endif; ?>
<?php if($_info->getAdditionalInformation('adyen_refusal_reason_raw') != ""): ?>
<?php echo __('Raw acquirer response: %1', $_info->getAdditionalInformation('adyen_refusal_reason_raw')) ?><br/>
<?php endif; ?>
<?php if($_info->getAdditionalInformation('adyen_auth_code') != ""): ?>
<?php echo __('Authorisation code: %1', $_info->getAdditionalInformation('adyen_auth_code')) ?><br/>
<?php endif; ?>
<?php if($_info->getAdditionalInformation('adyen_acquirer_reference') != ""): ?>
<?php echo __('Acquirer reference: %1', $_info->getAdditionalInformation('adyen_acquirer_reference')) ?><br/>
<?php endif; ?>
<?php if ($_specificInfo = $block->getSpecificInformation()):?> <?php if ($_specificInfo = $block->getSpecificInformation()):?>
<table class="data-table admin__table-secondary"> <table class="data-table admin__table-secondary">
<?php foreach ($_specificInfo as $_label => $_value):?> <?php foreach ($_specificInfo as $_label => $_value):?>
......
...@@ -50,6 +50,10 @@ $_isDemoMode = $block->isDemoMode(); ...@@ -50,6 +50,10 @@ $_isDemoMode = $block->isDemoMode();
</div> </div>
<?php endif;?> <?php endif;?>
<?php if($_info->getAdditionalInformation('adyen_total_fraud_score') != ""): ?>
<?php echo __('Total fraud score: %1', $_info->getAdditionalInformation('adyen_total_fraud_score')) ?><br/>
<?php endif; ?>
<?php if ($_specificInfo = $block->getSpecificInformation()):?> <?php if ($_specificInfo = $block->getSpecificInformation()):?>
<table class="data-table admin__table-secondary"> <table class="data-table admin__table-secondary">
<?php foreach ($_specificInfo as $_label => $_value):?> <?php foreach ($_specificInfo as $_label => $_value):?>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
// @codingStandardsIgnoreFile
?>
<?php $_code = $block->getMethodCode() ?>
<fieldset class="fieldset payment items ccard <?php echo $_code ?>" id="payment_form_<?php echo $_code ?>" style="display: none;">
<div class="field type required">
<label for="<?php echo $_code ?>_cc_type" class="label"><span><?php echo __('Credit Card Type') ?></span></label>
<div class="control">
<select id="<?php echo $_code ?>_cc_type"
data-mage-init='{"creditCardType":{"creditCardTypeContainer":"#<?php echo $_code ?>_cc_type_ss_div"}}'
name="payment[cc_type]" data-validate='{required:true, "validate-cc-type-select":"#<?php echo $_code ?>_cc_number"}' class="select">
<option value=""><?php echo __('--Please Select--')?></option>
<?php $_ccType = $block->getInfoData('cc_type') ?>
<?php foreach ($block->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
<option value="<?php echo $_typeCode ?>"<?php if ($_typeCode == $_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
<div class="control">
<input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{"required-number":true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
</div>
</div>
<div class="field required">
<label for="<?php echo $_code ?>_cc_owner" class="label"><span><?php echo __('Credit Card Owner') ?></span></label>
<div class="control">
<input type="text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" title="<?php echo __('Credit Card Owner') ?>" class="input-text" value=""/>
</div>
</div>
<div class="field date required" id="<?php echo $_code ?>_cc_type_exp_div">
<label for="<?php echo $_code ?>_expiration" class="label"><span><?php echo __('Expiration Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label month">
<div class="control">
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="select month" data-validate='{required:true, "validate-cc-exp":"#<?php echo $_code ?>_expiration_yr"}'>
<?php $_ccExpMonth = $block->getInfoData('cc_exp_month') ?>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label year">
<div class="control">
<?php $_ccExpYear = $block->getInfoData('cc_exp_year') ?>
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="select year" data-validate='{required:true}'>
<?php foreach ($block->getCcYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<?php if ($block->hasVerification()): ?>
<div class="field cvv required" id="<?php echo $_code ?>_cc_type_cvv_div">
<label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
<div class="control">
<input type="number" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{"required-number":true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' />
<?php $_content = '<img src=\"' . $block->getViewFileUrl('Magento_Checkout::cvv.png') . '\" alt=\"' . __('Card Verification Number Visual Reference') . '\" title=\"' . __('Card Verification Number Visual Reference') . '\" />'; ?>
<div class="note">
<a href="#" class="action cvv" title="<?php echo __('What is this?') ?>" data-mage-init='{"tooltip": {"content": "<?php echo $_content ?>"}}'><span><?php echo __('What is this?') ?></span></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($block->hasSsCardType()): ?>
<div class="field switch solo required" id="<?php echo $_code ?>_cc_type_ss_div">
<div class="nested">
<div class="field switch solo required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Switch/Solo/Maestro Only') ?></span></label>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Issue Number') ?></span></label>
<div class="control">
<input type="text" title="<?php echo __('Issue Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" data-validate='{"validate-cc-ukss":true}'/>
</div>
</div>
<div class="field date required">
<label for="<?php echo $_code ?>_start_month" class="label"><span><?php echo __('Start Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="select month" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="select year" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getSsStartYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="adv container" data-validation-msg="validate-cc-ukss">&nbsp;</div>
</div>
</div>
<?php endif; ?>
<?php echo $block->getChildHtml() ?>
</fieldset>
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
// @codingStandardsIgnoreFile
?>
<?php $_code = $block->getMethodCode() ?>
<fieldset class="fieldset payment items ccard <?php echo $_code ?>" id="payment_form_<?php echo $_code ?>" style="display: none;">
<div class="field type required">
<label for="<?php echo $_code ?>_cc_type" class="label"><span><?php echo __('Credit Card Type') ?></span></label>
<div class="control">
<select id="<?php echo $_code ?>_cc_type"
data-mage-init='{"creditCardType":{"creditCardTypeContainer":"#<?php echo $_code ?>_cc_type_ss_div"}}'
name="payment[cc_type]" data-validate='{required:true, "validate-cc-type-select":"#<?php echo $_code ?>_cc_number"}' class="select">
<option value=""><?php echo __('--Please Select--')?></option>
<?php $_ccType = $block->getInfoData('cc_type') ?>
<?php foreach ($block->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
<option value="<?php echo $_typeCode ?>"<?php if ($_typeCode == $_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
<div class="control">
<input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{"required-number":true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
</div>
</div>
<div class="field required">
<label for="<?php echo $_code ?>_cc_owner" class="label"><span><?php echo __('Credit Card Owner') ?></span></label>
<div class="control">
<input type="text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" title="<?php echo __('Credit Card Owner') ?>" class="input-text" value=""/>
</div>
</div>
<div class="field date required" id="<?php echo $_code ?>_cc_type_exp_div">
<label for="<?php echo $_code ?>_expiration" class="label"><span><?php echo __('Expiration Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label month">
<div class="control">
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="select month" data-validate='{required:true, "validate-cc-exp":"#<?php echo $_code ?>_expiration_yr"}'>
<?php $_ccExpMonth = $block->getInfoData('cc_exp_month') ?>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label year">
<div class="control">
<?php $_ccExpYear = $block->getInfoData('cc_exp_year') ?>
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="select year" data-validate='{required:true}'>
<?php foreach ($block->getCcYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<?php if ($block->hasVerification()): ?>
<div class="field cvv required" id="<?php echo $_code ?>_cc_type_cvv_div">
<label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
<div class="control">
<input type="number" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{"required-number":true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' />
<?php $_content = '<img src=\"' . $block->getViewFileUrl('Magento_Checkout::cvv.png') . '\" alt=\"' . __('Card Verification Number Visual Reference') . '\" title=\"' . __('Card Verification Number Visual Reference') . '\" />'; ?>
<div class="note">
<a href="#" class="action cvv" title="<?php echo __('What is this?') ?>" data-mage-init='{"tooltip": {"content": "<?php echo $_content ?>"}}'><span><?php echo __('What is this?') ?></span></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($block->hasSsCardType()): ?>
<div class="field switch solo required" id="<?php echo $_code ?>_cc_type_ss_div">
<div class="nested">
<div class="field switch solo required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Switch/Solo/Maestro Only') ?></span></label>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Issue Number') ?></span></label>
<div class="control">
<input type="text" title="<?php echo __('Issue Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" data-validate='{"validate-cc-ukss":true}'/>
</div>
</div>
<div class="field date required">
<label for="<?php echo $_code ?>_start_month" class="label"><span><?php echo __('Start Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="select month" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="select year" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getSsStartYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="adv container" data-validation-msg="validate-cc-ukss">&nbsp;</div>
</div>
</div>
<?php endif; ?>
<?php echo $block->getChildHtml() ?>
</fieldset>
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
// @codingStandardsIgnoreFile // @codingStandardsIgnoreFile
?> ?>
<dl class="payment-method checkmemo"> <dl class="payment-method adyen_cc">
<dt class="title"><?php echo $block->escapeHtml($block->getMethod()->getTitle()) ?></dt> <dt class="title"><?php echo $block->escapeHtml($block->getMethod()->getTitle()) ?></dt>
</dl> </dl>
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
// @codingStandardsIgnoreFile
?>
<?php
$_info = $this->getInfo();
?>
<?php $paymentSelectionOnAdyen = $block->isPaymentSelectionOnAdyen();?>
<dl class="payment-method adyen_hpp">
<?php if($paymentSelectionOnAdyen): ?>
<?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?><br/>
<dt class="title"><?php echo $block->escapeHtml($block->getMethod()->getTitle()) ?></dt>
<?php else: ?>
<?php if ($_brandCode = $_info->getAdditionalInformation('brand_code')):?>
<dt class="title"><?php echo $_brandCode; ?></dt>
<?php endif;?>
<?php endif; ?>
</dl>
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
// @codingStandardsIgnoreFile
?>
<dl class="payment-method adyen_oneclick">
<dt class="title"><?php echo $block->escapeHtml($block->getMethod()->getTitle()) ?></dt>
</dl>
...@@ -42,7 +42,8 @@ define( ...@@ -42,7 +42,8 @@ define(
defaults: { defaults: {
template: 'Adyen_Payment/payment/cc-form', template: 'Adyen_Payment/payment/cc-form',
creditCardOwner: '', creditCardOwner: '',
encryptedData: '' encryptedData: '',
setStoreCc: true
}, },
initObservable: function () { initObservable: function () {
this._super() this._super()
...@@ -57,7 +58,8 @@ define( ...@@ -57,7 +58,8 @@ define(
'selectedCardType', 'selectedCardType',
'creditCardOwner', 'creditCardOwner',
'encryptedData', 'encryptedData',
'generationtime' 'generationtime',
'setStoreCc'
]); ]);
return this; return this;
}, },
...@@ -78,7 +80,8 @@ define( ...@@ -78,7 +80,8 @@ define(
additional_data: { additional_data: {
'cc_type': this.creditCardType(), 'cc_type': this.creditCardType(),
'encrypted_data': this.encryptedData(), 'encrypted_data': this.encryptedData(),
'generationtime': this.generationtime() 'generationtime': this.generationtime(),
'store_cc': this.setStoreCc()
} }
}; };
}, },
......
...@@ -113,7 +113,8 @@ define( ...@@ -113,7 +113,8 @@ define(
"po_number": null, "po_number": null,
"additional_data": { "additional_data": {
encrypted_data: encryptedData, encrypted_data: encryptedData,
recurring_detail_reference: self.value recurring_detail_reference: self.value,
variant: self.agreement_data.variant
} }
}; };
......
...@@ -200,10 +200,8 @@ ...@@ -200,10 +200,8 @@
name="payment[store_cc]" name="payment[store_cc]"
autocomplete="off" autocomplete="off"
class="checkbox" class="checkbox"
value="1" data-bind="attr: {title: $t('Remember Me')}, checked: setStoreCc"
checked />
data-bind="attr: {title: $t('Remember Me')}"
data-validate="{required:true}"/>
<label data-bind="attr: {for: getCode() + '_remember_details'}" class="label"> <label data-bind="attr: {for: getCode() + '_remember_details'}" class="label">
<span><!-- ko text: $t('Remember these details')--><!-- /ko --></span> <span><!-- ko text: $t('Remember these details')--><!-- /ko --></span>
</label> </label>
......
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