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

Fix enableOneClick property send into api, and if recurring token comes back...

Fix enableOneClick property send into api, and if recurring token comes back this is not a recurring token for bcmc and maestro as they do not support it
parent 84a8f63a
......@@ -74,11 +74,15 @@ class RecurringDataBuilder implements BuilderInterface
$enableRecurring = $this->adyenHelper->getAdyenAbstractConfigData('enable_recurring', $storeId);
if ($enableOneclick) {
$result['enableOneclick'] = true;
$result['enableOneClick'] = true;
} else {
$result['enableOneClick'] = false;
}
if ($enableRecurring) {
$result['enableRecurring'] = true;
} else {
$result['enableRecurring'] = false;
}
if ($payment->getAdditionalInformation('store_cc') === '1') {
......
......@@ -207,8 +207,14 @@ class Agreement extends \Magento\Paypal\Model\Billing\Agreement
$recurringType = $this->adyenHelper->getAdyenPosCloudConfigData('recurring_type');
} else {
$recurringType = $this->adyenHelper->getRecurringTypeFromOneclickRecurringSetting();
}
// for bcmc and maestro recurring is not allowed so don't set this
if ($recurringType === \Adyen\Payment\Model\RecurringType::ONECLICK_RECURRING &&
($contractDetail['paymentMethod'] === "bcmc" || $contractDetail['paymentMethod'] === "maestro")
) {
$recurringType = \Adyen\Payment\Model\RecurringType::ONECLICK;
}
}
$agreementData = [
'card' => [
......
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