I have commerce 2.14 and latest dev version of stripe module including 3D Secure 2 issue (https://www.drupal.org/project/commerce_stripe/issues/3039032).

Payment works but I can see in the stripe UI that some errors occur. See stripe log.png

These Requests are:

{
  "amount": "299"
}

The return Code is as follows:
This PaymentIntent's amount could not be updated because it has a status of succeeded. You may only update the amount of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation.

CommentFileSizeAuthor
#6 3079162-6.patch4.38 KBmglaman
#5 3079162-5.patch586 bytesmglaman
stripe log.png90.82 KBcarsteng

Comments

carstenG created an issue. See original summary.

carsteng’s picture

Related issues: +#3039032: 3D Secure 2
blacklabel_tom’s picture

I can confirm this behaviour

mglaman’s picture

Title: 400 errors in payment logs » OrderPaymentIntentSubscriber cannot run against completed payment intents
Priority: Normal » Major

I made a mistake in the subscriber. It must ignore non-draft orders.

https://git.drupalcode.org/project/commerce_stripe/blob/8.x-1.x/src/Even...

    $plugin = $gateway->entity->getPlugin();
    if (!$plugin instanceof StripeInterface) {
      return;
    }
    $intent_id = $order->getData('stripe_intent');
    if ($intent_id !== NULL) {

There should be a check on the order state.

mglaman’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new586 bytes

The fix is to purge the payment intent from the order once we save the payment, I believe. If we had a data blob on payments we could keep the payment intent there for records.

Needs tests

mglaman’s picture

Issue tags: -Needs tests
StatusFileSize
new4.38 KB

We check the status before running. Our tests now use a not-so-silent event subscriber. Tests this scenario.

ivan616’s picture

I just applied this patch from #6 on our site and I can confirm error was no longer appearing on stripe dashboard.
Also, payment vent through successfully.

ivan616’s picture

Status: Needs review » Reviewed & tested by the community

Review.

  • bojanz committed ef7b6f0 on 8.x-1.x authored by mglaman
    Issue #3079162 by mglaman, carstenG: OrderPaymentIntentSubscriber cannot...
bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Committed #6.

Status: Fixed » Closed (fixed)

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