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

fix to not store as oneclick if shopper does not want to store it card, don't...

fix to not store as oneclick if shopper does not want to store it card, don't autofill checkbox for storing card and fix new card labels
parent df8d2cb2
...@@ -1476,7 +1476,8 @@ class Data extends AbstractHelper ...@@ -1476,7 +1476,8 @@ class Data extends AbstractHelper
} }
// Populate billing agreement data // Populate billing agreement data
$billingAgreement->setCcBillingAgreement($additionalData); $storeOneClick = $order->getPayment()->getAdditionalInformation('store_cc');
$billingAgreement->setCcBillingAgreement($additionalData, $storeOneClick);
if ($billingAgreement->isValid()) { if ($billingAgreement->isValid()) {
if (!$this->agreementResourceModel->getOrderRelation($billingAgreement->getAgreementId(), if (!$this->agreementResourceModel->getOrderRelation($billingAgreement->getAgreementId(),
......
...@@ -80,6 +80,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -80,6 +80,8 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
} }
/** /**
* for async store of billing agreement through the recurring_contract notification
*
* @param $data * @param $data
* @return $this * @return $this
*/ */
...@@ -165,7 +167,13 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -165,7 +167,13 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
return json_decode($this->getData('agreement_data'), true); return json_decode($this->getData('agreement_data'), true);
} }
public function setCcBillingAgreement($contractDetail) /**
* For sync result to store billing agreement
*
* @param $contractDetail
* @return $this
*/
public function setCcBillingAgreement($contractDetail, $storeOneClick)
{ {
$this $this
->setMethodCode('adyen_oneclick') ->setMethodCode('adyen_oneclick')
...@@ -214,6 +222,13 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement ...@@ -214,6 +222,13 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
) { ) {
$recurringType = \Adyen\Payment\Model\RecurringType::ONECLICK; $recurringType = \Adyen\Payment\Model\RecurringType::ONECLICK;
} }
// if shopper decides to not store the card don't save it as oneclick
if (!$storeOneClick &&
$recurringType === \Adyen\Payment\Model\RecurringType::ONECLICK_RECURRING
) {
$recurringType = \Adyen\Payment\Model\RecurringType::RECURRING;
}
} }
$agreementData = [ $agreementData = [
......
...@@ -66,15 +66,15 @@ ...@@ -66,15 +66,15 @@
<code_alt>bcmc</code_alt> <code_alt>bcmc</code_alt>
</type> </type>
<type id="HIPERCARD" order="80"> <type id="HIPERCARD" order="80">
<label>hipercard</label> <label>Hipercard</label>
<code_alt>hipercard</code_alt> <code_alt>hipercard</code_alt>
</type> </type>
<type id="ELO" order="80"> <type id="ELO" order="80">
<label>elo</label> <label>Elo</label>
<code_alt>elo</code_alt> <code_alt>elo</code_alt>
</type> </type>
<type id="AURA" order="80"> <type id="AURA" order="80">
<label>aura</label> <label>Aura</label>
<code_alt>aura</code_alt> <code_alt>aura</code_alt>
</type> </type>
</adyen_credit_cards> </adyen_credit_cards>
......
...@@ -39,7 +39,7 @@ define( ...@@ -39,7 +39,7 @@ define(
defaults: { defaults: {
template: 'Adyen_Payment/payment/cc-form', template: 'Adyen_Payment/payment/cc-form',
creditCardOwner: '', creditCardOwner: '',
setStoreCc: true, setStoreCc: false,
installment: '', installment: '',
creditCardDetailsValid: false creditCardDetailsValid: false
}, },
......
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