#nerdslice_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1250216187476836434
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there!
Hello there
Promo codes aren't supported for the PaymentElement
These codes can only be used with Checkout, PaymentLinks or the customer portal
Ah can they be used when i submit the payment through my php code?
I assume you're creating PaymentIntents directly? If not, can you share more details about how your integration is designed?
Also, are you processing one-off charges or working with Subscriptions or both?
Both, but this is for subscriptions.
Got it, okay
I am using laravel for this, and have it written out to use the cashier model
So you can't add a promo code field to the PaymentElement directly but you can add a discount to the Subscription: https://docs.stripe.com/api/subscriptions/create#create_subscription-discounts
What this means is, if you want a customer to input a promo code, you would then have to determine whether that's a valid code then pass the relevant Promotion Code ID when creating the Subscription. You would then use the latest invoice's client secret to render the PaymentElement