Skip to content

Commit

Permalink
Merge pull request #515 from Invertus/payment-fee-fix
Browse files Browse the repository at this point in the history
fixed issue with payment fee and single click credit card method
  • Loading branch information
margud authored Jan 25, 2022
2 parents 09c2ed3 + c1ff7e1 commit 4042457
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
31 changes: 14 additions & 17 deletions src/Provider/PaymentOption/CreditCardPaymentOptionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,20 @@ public function getPaymentOption(MolPaymentMethod $paymentMethod)
$paymentFee = $this->paymentFeeProvider->getPaymentFee($paymentMethod);

if ($paymentFee) {
$paymentOption->setInputs([
[
'type' => 'hidden',
'name' => 'mollieCardToken',
'value' => '',
],
[
'type' => 'hidden',
'name' => 'payment-fee-price',
'value' => $paymentFee,
],
[
'type' => 'hidden',
'name' => 'payment-fee-price-display',
'value' => sprintf($this->module->l('Payment Fee: %1s'), Tools::displayPrice($paymentFee)),
],
]);
$paymentOption->setInputs(
array_merge($paymentOption->getInputs(), [
[
'type' => 'hidden',
'name' => 'payment-fee-price',
'value' => $paymentFee,
],
[
'type' => 'hidden',
'name' => 'payment-fee-price-display',
'value' => sprintf($this->module->l('Payment Fee: %1s'), Tools::displayPrice($paymentFee)),
],
])
);
}

return $paymentOption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,20 @@ public function getPaymentOption(MolPaymentMethod $paymentMethod)
$paymentFee = $this->paymentFeeProvider->getPaymentFee($paymentMethod);

if ($paymentFee) {
$paymentOption->setInputs([
[
'type' => 'hidden',
'name' => 'payment-fee-price',
'value' => $paymentFee,
],
[
'type' => 'hidden',
'name' => 'payment-fee-price-display',
'value' => sprintf($this->module->l('Payment Fee: %1s'), Tools::displayPrice($paymentFee)),
],
]);
$paymentOption->setInputs(
array_merge($paymentOption->getInputs(), [
[
'type' => 'hidden',
'name' => 'payment-fee-price',
'value' => $paymentFee,
],
[
'type' => 'hidden',
'name' => 'payment-fee-price-display',
'value' => sprintf($this->module->l('Payment Fee: %1s'), Tools::displayPrice($paymentFee)),
],
])
);
}

return $paymentOption;
Expand Down

0 comments on commit 4042457

Please sign in to comment.