#tsr_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1309406125929795674
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi
If you're using Checkout Session, Stripe will validate whether a promotion code is valid before applying to the payment
Why are you validating the promotion code yourself?
client wants to show one input field and validate promocode before clicking on checkout...
Which integration are you using? Checkout Session, Payment Element... etc?
in checkout it is showing field to enter promocode... but client wants to enter before clicking on checkout
using checkout session
Do you allow customer enter promotion code in the Checkout Session, i.e. allow_promotion_codes set to true? https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes
If yes, validating before redirecting to Checkout Session doesn't help as customer can still enter other promotion code.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If I set allow_promotion_codes to false, can I still pass a promo code to the checkout during session creation for validation purposes?
Do you mean passing the promotion code directly to discounts.promotion_code: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-discounts-promotion_code?
If so, Checkout Session creation will fail if the promotion code is invalid.
Alternatively, you can use Promotion Code Retrieval API to check it active status: https://docs.stripe.com/api/promotion_codes/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i am creating promocode for a sepecific product, so I can pass while creating checkoutssion then...
Another question: We have two checkout options - normal checkout and buy now, pay later. For the buy now, pay later option, can I display only the available payment options for that specific method?
Could you share what "buy now, pay later option" does? Do you mean you will save customer's payment first then charge later, or are you referring to Buy Now Pay Later payment methods such as Klarna?
yes like klarna
Thanks for sharing! You can manually configure the payment methods to be shown in the Checkout Session by setting payment_method_types: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okay sure , thanks