Payment with remote id does not exist

Created on 17 July 2024, 4 months ago
Updated 15 August 2024, 3 months ago

When I go to the webhook logs /admin/commerce/config/stripe-webhook-events I see the exclamation mark next to each row.
Each of the webhook events have the same error:

payment with remote id (pi_XXXXXXXXXXXXXXXXX) does not exist

And 99.99% of them have the status "Skipped", also orders are completed, I see the payment intent entities created, no errors in the logs and all ok in the Stripe Dashboard.

I use the fresh dev version, where cron job to process hooks is set up, and I expect it will find payment intent, update it in webhook log and update it's status.

Is it intended to work like that?
Or should I be worried with this

๐Ÿ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ฆUkraine gilmord ๐Ÿ‡บ๐Ÿ‡ฆUkraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gilmord
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine gilmord ๐Ÿ‡บ๐Ÿ‡ฆUkraine
  • Assigned to TomTech
  • Status changed to Postponed: needs info 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TomTech

    Hi @gilmord,

    Thanks for the report.

    Can you provide the webhook event type for the events that are being skipped with this message? (I can theorize of one scenario where cancelled payment intents might cause this. This might occur if an authenticated customer switched between multiple payment methods...I'd need to test this scenario out. If this is the case, this would be something you can ignore.)

    Are you seeing some successful events, or are you seeing all SKIPPED?

    Is the Stripe account used exclusively by Drupal Commerce, or are payments created in other applications/systems? (If another application is creating stripe payment intents on the same account, some possible solutions would be to either have separate accounts, or add some custom code to filter out event from the other system.)

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine gilmord ๐Ÿ‡บ๐Ÿ‡ฆUkraine

    Can you provide the webhook event type for the events that are being skipped with this message?

    • payment_intent.succeeded
    • payment_intent.payment_failed
    • charge.refunded

    Are you seeing some successful events, or are you seeing all SKIPPED?

    I see only one in "Success" status, which looks like we can ignore it, all the other are SKIPPED

    Is the Stripe account used exclusively by Drupal Commerce, or are payments created in other applications/systems?

    Only Drupal is used for this Stripe account

    This issue looks really strange to me, I am going to debug the process of "payment - webhook - corn" to see where and why it is skipped, I will get back with more details after that.

    This is strange it happens to me only, or maybe no one else checks the webhook logs, as for the users all looks ok - payment accepted, order is paid, and in the Stripe dashboard all looks good also.

  • ๐Ÿ‡จ๐Ÿ‡ณChina kongkx

    In the default multi-step checkout flow, the offsite payment record is handled in "Payment Process" step. commerce_payment record should be created in the "forms" defined in the related OffsitePaymentGateway.

    However, in this module, "Stripe Payment Element" payment info is handled in "Stripe Review" checkout pane. The related record should be created once with the `payment_intent` id and order info, before user interaction, so the webhook processor can handle related payment properly.

    In my opinion,

    1. the form Drupal\commerce_stripe\PluginForm\OffsiteRedirect\PaymentOffsiteForm should be rewritten to display the "Stripe Payment Element".
    2. "Stripe Review" checkout pane is not required when using "Stripe Payment Element" gateway.
    3. The "stored" payment_method may handled asyncly in webhook processor, but not in `StripePaymentElement::onReturn` as not all payment type in stripe support this feature.

Production build 0.71.5 2024