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

Coupon Code: Stripe #82

Closed
Tracked by #30
manishapriya94 opened this issue Feb 22, 2022 · 1 comment
Closed
Tracked by #30

Coupon Code: Stripe #82

manishapriya94 opened this issue Feb 22, 2022 · 1 comment
Assignees
Labels

Comments

@manishapriya94
Copy link
Contributor

manishapriya94 commented Feb 22, 2022

User Story:

Coupon codes make it more accessible for people of all backgrounds to be able to participate in civic engagement. In our use case, an advocacy organization can give codes at their discretion via email, social media, or through in person.

Screen Shot 2022-02-22 at 4 45 18 PM

Within checkout.vue we have a space for a promo code. The use case here if that if a person enters a code in the input text box below and if its under the threshold of times discounted:

  1. If you didn't select a donation amount, your total will come out to zero
  2. If you plan on sending donation, your total will not include post cost of 1.00 ('donate and send' button appears)

We might want to also consider adding messaging if a limit has been reached or if the coupon code doesn't work

Implementation:

Stripe currently lays out the following for integrating coupons into checkout:

  1. Outreach teams adds coupons into dashboard

Screen Shot 2022-02-22 at 4 06 36 PM

We'll use 'amount off' which takes a dollar off
  1. It seems you can't apply a coupon directly to the redirectToCheckout method, you have to create a Checkout session first and then use that.

  2. Add a discount to Checkout the sample code is calling Checkout.session.create, not Checkout directly

Quick note
redirectToCheckout Reference Docs doesn't mention a discount or coupon parameter at all, and the sample code again is creating a Checkout session using fetch (to one's own server backend, which is where my expertise ceases and where I'm stifled), to generate a session ID and then passing that into the result where redirectToCheckout is called.

Questions:
Can coupons be done on just client side?
Does coupon exhaust the customizations we have access to?

@ewchong
Copy link

ewchong commented Feb 23, 2022

  • After playing around with it last night, looks like coupons can't be done client side. I got mixed up with the Checkout.session.create vs the redirectToCheckout.
  • I don't think coupons would limit the customizations, this example seems to show everything that page lists.

Currently looks like the backend is setup to use Stripe's custom payment flow. To use Stripe Checkout, will have to switch to calling session.create in the backend. This repo gives a good overview of the differences between the options: stripe-samples/accept-a-payment

kazvee pushed a commit that referenced this issue Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants