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

Subscription does not get processed by the plugin when using Checkout Twig Tag and coupons #392

Open
rckywng opened this issue Apr 10, 2024 · 4 comments
Assignees

Comments

@rckywng
Copy link

rckywng commented Apr 10, 2024

Description

When going to a Stripe Checkout form, via the Checkout Twig Tag, and using a coupon which gives the user 100% discount – upon successful return to the Craft site, the plugin has not processed the subscription. This means it appears the user has not subscribed in Craft, when they have on Stripe.

Looking at the logs, the error is coming from the createCartOrder() function in the PaymentIntents service: "Unable to find the paymentIntentId or subscriptionId related to the cart".

Non-coupon transactions are working fine. Whether there is a coupon or not, Stripe is sending a subscription value and no payment_intent value in the webhook. So it doesn't seem the problem is there.

It looks like the function is looking for a subscription and invoice to get the payment_intent and failing.

Any help would be greatly appreciated.

Steps to reproduce

  1. Create a subscription plan and a coupon/code which gives the user 100% discount on the plan.
  2. Set up a form for the subscription plan using the Checkout Twig Tag.
  3. Sign up to the subscription and apply the discount (so total payment is 0).
  4. When you return to the Craft, the order/membership is not processed.

Additional info

  • Craft version: Craft Pro 4.7.4
  • PHP version: 8.0.30
  • Database driver & version: MariaDB 10.11.5
  • Plugin version: 5.5.1
  • Is SCA and Stripe Checkout enabled?: Yes
@rckywng
Copy link
Author

rckywng commented Apr 19, 2024

Hey @andrelopez, hope we're not being to pushy here but the org I'm working with are wondering if there would be a timeline for handling such issues?

This feature is pretty critical right now as we expected this functionality to work as is. We are evaluating if we should take another approach instead so would be good to know what your thoughts are.

@andrelopez
Copy link
Member

Hi sorry the slow response here, I will take a look over the weekend, hopefully have a follow up by Monday

@andrelopez andrelopez self-assigned this Apr 21, 2024
@andrelopez
Copy link
Member

Hi @rckywng this ticket it's related to #393 as well. We need to bring support to Stripe API 2023-08-16 as we currently supports 2020-08-27

This will be a big change in the source code and will require some time to test all edge cases after the API upgrade, I made good progress over the weekend and I hope to release this update soon!

@rckywng
Copy link
Author

rckywng commented Apr 24, 2024

Hi @andrelopez, thanks for the update.

  • Do you have a rough idea of when the update may be ready for release (eg would it be days, weeks, months)?
  • Does a 100% discount work if we don't use the Checkout Twig Tag, or does this apply to all checkout types (just wondering if we can change direction here)?

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

No branches or pull requests

2 participants