Closed manishapriya94 closed 2 years ago
Checkout.session.create
vs the redirectToCheckout
. 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
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.
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:
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:
Outreach teams adds coupons into dashboard
We'll use 'amount off' which takes a dollar off
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.
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?