Skip to content

Commit

Permalink
Apply platform fees when order is fully paid by credit card.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsegura committed Feb 5, 2025
1 parent 64ba223 commit d1ceac8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Service/PaygreenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ public function createPaymentOrder(PaymentInterface $payment)
$paymentOrder->setCancelUrl($this->getCallbackUrl($order, 'paygreen_cancel'));
$paymentOrder->setEligibleAmounts($this->getEligibleAmounts($order));

// platforms is required when fees is set
// Impossible to process fees on Payment Orders setup with non-wallet platforms.
// You must only specify a platform with a wallet behavior (e.g. bank_card)
// $paymentOrder->setPlatforms(['bank_card']);
// $paymentOrder->setFees($order->getFeeTotal());
// We can set platforms fees *ONLY* when the order is paid 100% by credit card
if ('CARD' === $payment->getMethod()->getCode()) {
$paymentOrder->setPlatforms(['bank_card']); // Avoid error "platforms is required when fees is set"
$paymentOrder->setFees($order->getFeeTotal());
}

$response = $this->paygreenClient->createPaymentOrder($paymentOrder);

Expand Down

0 comments on commit d1ceac8

Please sign in to comment.