Skip to content

Commit

Permalink
Merge pull request #236 from synolia/qa
Browse files Browse the repository at this point in the history
SYL-214 - fix cannot pay using oney
  • Loading branch information
TheGrimmChester authored Apr 13, 2023
2 parents 543945c + 4980f3b commit b8c20ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PayPlug\SyliusPayPlugPlugin\Entity\Card;
use PayPlug\SyliusPayPlugPlugin\Exception\UnknownApiErrorException;
use PayPlug\SyliusPayPlugPlugin\Gateway\ApplePayGatewayFactory;
use PayPlug\SyliusPayPlugPlugin\Gateway\OneyGatewayFactory;
use PayPlug\SyliusPayPlugPlugin\Gateway\PayPlugGatewayFactory;
use PayPlug\SyliusPayPlugPlugin\PaymentProcessing\AbortPaymentProcessor;
use Payum\Core\Action\ActionInterface;
Expand Down Expand Up @@ -127,7 +128,14 @@ public function execute($request): void
unset($details['status']);
}

if (ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY !== $details['payment_method']) {
if (!in_array(
$details['payment_method'],
array_merge(
[ApplePayGatewayFactory::PAYMENT_METHOD_APPLE_PAY],
OneyGatewayFactory::PAYMENT_CHOICES
),
true
)) {
// clean other detail values
if ($details->offsetExists('payment_context')) {
unset($details['payment_context']);
Expand Down

0 comments on commit b8c20ce

Please sign in to comment.