OFFLINE-GmbH / oc-mall-plugin

:convenience_store: E-commerce solution for October CMS
https://offline-gmbh.github.io/oc-mall-plugin
MIT License
169 stars 114 forks source link

Payment issue after 3DSecure #758

Closed chrisvidal closed 3 years ago

chrisvidal commented 3 years ago

I know it is not directly related to MALL code, but take my change here if anyone already faced this issue

after a 3DS payment, in the method complete, I am trying to confirm the payment by sending a second charge to the payment API (that is their requirement), and even though it is the same code and same params I am using, the second time I have this exception:

OFFLINE.Mall: A payment failed. {"data":[],"response":"[object] (TypeError(code: 0): Argument 1 passed to Omnipay\\Common\\CreditCard::initialize() must be of the type array or null, string given, called in /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/CreditCard.php on line 145 at /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/CreditCard.php:193)
#0 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/CreditCard.php(145): Omnipay\\Common\\CreditCard->initialize('card_test_5mop8...')
#1 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/Message/AbstractRequest.php(201): Omnipay\\Common\\CreditCard->__construct('card_test_5mop8...')
#2 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/Helper.php(88): Omnipay\\Common\\Message\\AbstractRequest->setCard('card_test_5mop8...')
#3 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/Message/AbstractRequest.php(139): Omnipay\\Common\\Helper::initialize(Object(Omnipay\\Omise\\Message\\PurchaseRequest), Array)
#4 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/omnipay/common/src/Common/AbstractGateway.php(322): Omnipay\\Common\\Message\\AbstractRequest->initialize(Array)
#5 /Users/christophevidal/Sites/oc-wunder/plugins/voilaah/omisemall/vendor/dilab/omnipay-omise/src/Gateway.php(66): Omnipay\\Common\\AbstractGateway->createRequest('Omnipay\\\\Omise\\\\M...', Array)
[stacktrace]
chrisvidal commented 3 years ago

ok, the way to handle this is to use the completePurchase and not the purchase Omnipay method, with omitting the card number.