New Norr Next instructions for Stripe payments

2 months 1 week ago - 2 months 1 week ago #4054 by David Leeman
Topic Author
David Leeman's Avatar
Posts: 45
Hi guys

I've noticed that the new docs have some information on reducing the webhook events list from ALL to the following 4
checkout.session.completed
checkout.session.async_payment_succeded
checkout.session.async_payment_failed
charge.refunded

But, when I apply these events only, the Phoca Cart system is not being informed that the payment is complete; the order remains as pending. So, I simply went back and reverted the webhook to listen to all events. And that solved the problem.

However, I do think that your assertion that ALL events may be too great a load on the hosting server of the site. I think it's possible that you may have missed an event or two from the list required to complete the payment in such a way as to move the Phoca Cart status to reflect the payment being complete.

I cannot really experiment with this without affecting the sites on which this plugin runs so any chance that you could check those events and find the one that may be missing?

It would be great to reduce the events number as I am receiving quite a few major webhook problems that result in emails from Stripe and large error rates around the 401

But, the plugins work great otherwise.

More info: I do run my sites through Cloudflare and Bunny CDN. The Cloudflare WAF has a rule applied that allows the Stripe IP range through on both.

Regards
David
Last edit: 2 months 1 week ago by David Leeman.

2 months 1 week ago - 2 months 1 week ago #4060 by Eugene
Eugene's Avatar
Posts: 887
Hi David,

But, when I apply these events only, the Phoca Cart system is not being informed that the payment is complete; the order remains as pending. So, I simply went back and reverted the webhook to listen to all events. And that solved the problem.
 

It looks like the problem is in the webhook - the webhook that was added in Stripe is not the same as webhook in Phoca Cart payment method.
Maybe you've created a webhook for Stripe payment and later decided to use Stripe Checkout and forgot to create a new webhook. Please check it out.

Like our extensions and support?
Add your voice to the JED listing with a 5 score review:: bit.ly/2ciJBqC
Thanks!
Last edit: 2 months 1 week ago by Eugene.

2 months 1 week ago - 2 months 1 week ago #4062 by David Leeman
Topic Author
David Leeman's Avatar
Posts: 45
Hi Eugene

I am trying to process this to see if I can figure out what I may have done wrong.

In fact I have made a separate Stripe webhook for the Checkout version and applied this correctly.

So I may be confusing two things!

Does Stripe Payment plugin (not checkout) require ALL events or just the 4 in the docs? Or is it just Stripe Checkout that needs the 4 events?

If all else fails then I shall rebuild the webhooks for both sites

Please understand I know that your plugins are working, but I need to find the reason for the 401 errors (they are running at over 90% on Stripe plugin - not Stripe checkout though)

Regards
David

PS, I am correct in thinking that Stripe plugin and Stripe checkout each need their own webhook , is that correct?
 
Last edit: 2 months 1 week ago by David Leeman.

2 months 1 week ago #4069 by Dmitry
Dmitry's Avatar
Posts: 1020
David,

We do not advice to have both Stripe plugins / webhooks enabled. This will lead to unpredictable results, because Stripe is trying to send events to both endpoints and one of them will always fail as both plugins cannot process the same order.

Best regards,
Dmitry

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!

2 months 1 week ago #4073 by Dmitry
Dmitry's Avatar
Posts: 1020
Well probably I am wrong about processing the order, because events for them are different.
And the docs are not complete, events for Stripe (not Checkout) are missing there. For Stripe (not Checkout) you will need:

payment_intent.succeeded
payment_intent.canceled
payment_intent.payment_failed
charge.refunded

See this thread, probably you have the same issue here with your setup.
www.norrnext.com/forum/stripe-for-phoca-...orrectly-with-plugin

Best regards,
Dmitry

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!

2 months 6 days ago #4078 by David Leeman
Topic Author
David Leeman's Avatar
Posts: 45
Hi Dmitry and thank you for your help and advice.

So if I run one webhook for both plugins with the following:
payment_intent.created
charge.succeeded
payment_intent.succeeded
payment_intent.canceled
payment_intent.payment_failed
charge.refunded

Then all bases are covered I think?

Regards
David

2 months 6 days ago - 2 months 6 days ago #4079 by Dmitry
Dmitry's Avatar
Posts: 1020
No no, these should be different.

For Stripe Checkout:
checkout.session.completed
checkout.session.async_payment_succeded
checkout.session.async_payment_failed
charge.refunded

For Stripe:
payment_intent.succeeded
payment_intent.canceled
payment_intent.payment_failed
charge.refunded

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!
Last edit: 2 months 6 days ago by Dmitry.

2 months 6 days ago #4080 by Eugene
Eugene's Avatar
Posts: 887
Hi David,
In addition to Dmitry's post - you cannot use one webhook for both plugins because URL differs.
www.norrnext.com/docs/phoca-cart-add-ons...-phoca-cart#api-keys

Like our extensions and support?
Add your voice to the JED listing with a 5 score review:: bit.ly/2ciJBqC
Thanks!

2 months 6 days ago #4081 by David Leeman
Topic Author
David Leeman's Avatar
Posts: 45
Ok, my mistake, yes of course

Still having my morning caffeine!

Regards
David

2 months 6 days ago - 2 months 6 days ago #4082 by David Leeman
Topic Author
David Leeman's Avatar
Posts: 45
Hi Euegene

I am a little confused.

ok so I have both Stripe plugin and Stripe Checkout plugin.

Is it best to just use one plugin per site - if so this is ok

Or can I use both plugins each with their separate webhook? This is the part I may be confused about - this is how my site is currently set up.
each webhook is then set up as per the latest posts from Dmitry

I went from screenshot example in the docs they show both plugins active on the payment option section of the Phoca Cart checkout

Regards
David
Last edit: 2 months 6 days ago by David Leeman.

You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+2). but not limited. Our staff will be pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days. In case of free extensions we do the best to develop and maintain them either, but their support is not necessary.

Follow us in social media