We got a payment failure (3DS) ; the payment was created as new with the amount of zero but the order was placed because of the miss of a DeclineException in the gateway to avoid the checkout to reach the complete checkout step.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicolasgraph created an issue. See original summary.

nicolasgraph’s picture

Status: Active » Needs work

This would need tests.
Waiting #3515036 to be fixed.

nicolasgraph’s picture

Status: Needs work » Active

Manual tests failed. The order is still placed.

nicolasgraph changed the visibility of the branch 4.x to hidden.

nicolasgraph’s picture

Ok, I get it, in my failing manual test case, onNotify() is not called, the payment is managed through onReturn() which do... nothing.
While the payment entity creation can be managed by onNotify() only, the remote payment validation must be processed by onReturn() too to throw the DeclineException in case of failure.

nicolasgraph’s picture

Status: Active » Needs work

I confirm the current MR state do fix my issue in live mode.
Still needs attention and ideally, some tests.

dom.’s picture

I have added a 5.x branch with Commerce 3.x support on Drupal 11 and also updating the underneath Payplug library to the latest (3.6.0). There may be something fixed on there side for this.

I created a brand new Commerce Kickstart env with Commerce Payplug on Commerce 3.x and tried the basics: anonymous cart payment both with a valid Visa card and a failing DS MasterCard and both scenarios worked as expected (I was blocked at offsite payment gate using the mastercard)

Test cards available here: https://docs.payplug.com/api/apiref.html#api-testing

Could you have a new try with those updates and let me know how to reproduce otherwise ?

dom.’s picture

Version: 4.0.0 » 5.x-dev
nicolasgraph’s picture

Thanks for your reply @dom.
Unfortunatly I was not able to reproduce the bug in test mode.
In test mode, I'm not redirected to the site on payment failure, while in live mode I am.
The 5.x branch do not fix the issue bescause onReturn() is still empty and that's the method called when Payplug redirects to the site in my case.
Also I didn't try the v3 but I suspect #3295358 to be a duplicate.

nicolasgraph’s picture

Merging 5.x introduced errors ; waiting #3428466 to land before to continue.

nicolasgraph changed the visibility of the branch 5.x to hidden.

nicolasgraph’s picture

nicolasgraph’s picture

Status: Needs work » Needs review
nicolasgraph’s picture

Status: Needs review » Needs work

We get the following error on return:

Drupal\commerce_payment\Exception\PaymentGatewayException: Request body is not valid JSON. in Drupal\commerce_payplug\Plugin\Commerce\PaymentGateway\OffsitePayPlug->onReturn() (line 173 of /home/user/web/modules/contrib/commerce_payplug/src/Plugin/Commerce/PaymentGateway/OffsitePayPlug.php).

Indeed, the payload was empty for this payment return.
I guess we need to retrieve the remote payment to truly validate its status on return, as done in the Magento module.
This mean we need to create the payment entity early, from the remote payment creation response, to store the remote ID to request later on.

nicolasgraph’s picture

Error described in #17 may be caused by a server error we fixed ; last orders were placed with no error.
I keep an eye on this to fix or merge asap.

nicolasgraph’s picture

Status: Needs work » Needs review
maetvatech’s picture

Status: Needs review » Reviewed & tested by the community

  • nicolasgraph committed 0f1b956f on 5.x
    Issue #3515023 by nicolasgraph, dom., maetvatech: Order placed on...
nicolasgraph’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.