#vishal4799-quote-discount
1 messages ยท Page 1 of 1 (latest)
Thanks for the quick response. So I understood that even if the transaction with a coupon is never completed still it consider the coupon used to create the transaction is redeemed. Could you help me with the scenario where/how can I keep track of redeemed coupons without any payment?
We don't really have any solution for this in the API today unfortunately. You'd have to keep track of all redemptions yourself and track them after the quote's invoice is paid
no problem. Also, I had another query about my scenario. I am not 100% sure of the way I use Stripe APIs for my use case. Could please go through the below and let me know what I am doing is correct or there is an optimized way using other APIs?
For example, one time payment of 100$ with tax (using customer's billing address) and coupon:
- Create a customer with a billing address
- Create a quote (I really dont need a quote but I use "create a quote" API to calculate tax with a customer created in the above step)
- Create a paymentIntent using the total amount return in a quote (which includes the tax amount too).
- Ask for payment details on UI using card element.
- Confirm the paymentIntent using the card details entered in the above step.
oh boy
I would definitely never recommend hacking the Quotes API just to get tax calculation, though I understand the appeal
But yeah otherwise that works and there's no better way today, though you could use Checkout instead and let us do all that for you: https://stripe.com/docs/payments/checkout
I actually explored the checkout. My client doesn't want any redirection as we cache so much data in the client browser and it's hard to deal with when we use checkout.
I also tried to find a UI component that can be embedded in the Angular app and does everything (asking calculating tax, applying coupon and card details) but found only Card component that I am using to collect the card details.
Please let me know if there is a component in Stripe and I missed it.
there is no such UI right now, Checkout does all of that and that's highly recommended but otherwise you have to build all of this yourself
I see. Checkout is not an option for me :(.
What I am doing is not the optimum way so apart from a little more work in terms of implementation, do you see any major problem with my design?
especially security concerns
no major problem or security concerns!
Thanks for your answers. I believe my use-case is very common and there are many applications out there in the market that want to implement payment using APIs only so my feedback to Stripe is, have some APIs that fulfill all the tasks checkout offers.
We are directly working on this right now. We're rebuilding the Orders API to support automatic tax calculation (like Quote does) and it's in private beta! Hopefully more info next year!
Great. Glad to know. Bye for now. Is it ok to keep this thread open as I am going to have some heck design to implement discounts?
We can keep it open for now though we usually close it after a couple hours of inactivity. But you can always ask follow up questions in #dev-help
Sure thanks. It's just that I dont want to explain my use case again to someone else. ๐