#armaan - payment request discounts
1 messages · Page 1 of 1 (latest)
Hi there. One moment
So how/when are you applying discount?
Do you have your own field on the same page that the element is rendered?
Yes the Promo code is on the same page as the element. Users 1) add promo code, 2) click "Apply" which checks validity of the code and modifies the payment intent on the backend if it does and then 3) users can complete their payment
They are siblings in the same React component at the moment - CheckoutForm has PaymentElement and PromoCode components as it's children. CheckoutForm is where we handle payment with confirmPayment
Ah ok. With that flow, you'll have to update the payment element after updating the PI on the backend: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#fetch-updates
Incredible! Thank you for your help