Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction not found on processing payment_intent.succeeded webhook #318

Closed
teachmeter opened this issue Jan 20, 2025 · 3 comments
Closed

Comments

@teachmeter
Copy link

Description

Whenever a stripe payment_intent.succeeded webhook is delivered the following message log appears in the system

2025-01-19 14:53:25 [web.WARNING] [stripe] Transaction with the reference “pi_REDACTED” not found when processing webhook evt_REDACTER {"memory":9237800}

In the backend we have a redirect transcation. The reference code from the API seems to be the checkout session.
Then after the client pays and comes back then the success webhook is triggered but it doesn't find the transaction as it is looking for a payment transaction.

Shouldn't the case 'payment_intent.succeeded' also be included in this situation to create the transaction the success webhook is searching for?

At first we saw the the webhooks didn't work ok because of the missing sercret and Webhooks reporting a warning instead of an error which i don't necessarily agree if there is no further information about it in the backend nor in stripe.
Now with the warning and a response of ok the stripe still doesn't show errors as technically the webhooks are working but not really.

Steps to reproduce

  1. Make an order
  2. Pay with stripe redirections
  3. Get back to the system

Additional info

  • Craft CMS version: Craft Pro 5.5.5
  • Stripe for Craft Commerce version: 5.0.4.3
  • PHP version: 8.3.3
  • Database driver & version: MySQL 27.1
  • Plugins & versions:
    Blitz 5.9.7
    CKEditor 4.4.0
    Craft Commerce 5.2.8
    Feed Me 6.6.1
    Formie 3.0.14
    Hyper dev-craft-5
    Navigation 3.0.5
    Ray 2.1.1
    Retcon 3.2.1
    SEO 5.1.7
    Sprig 3.5.1
    Stripe for Craft Commerce 5.0.4.3
Copy link

linear bot commented Jan 20, 2025

@lukeholder
Copy link
Member

Thanks for reporting this.

It sounds like we could look to implement a way to create a new transaction if the payment intent reference doesn't exist if there is an order ID in the metadata of the payment success webhook,

I can't give a timeline but this is on the list. Thanks.

In the meantime for those transaction webhooks that can in with "missing sercret", you could manually create the transaction in the database for the order and put the payment intent ID in the reference and resend the webhook which should update the order and transaction with the latest data.

@nfourtythree
Copy link
Contributor

Stripe for Commerce version 5.0.6 and 4.1.6 have been released with this fix included.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants