#night_api

1 messages ยท Page 1 of 1 (latest)

jovial minnowBOT
#

๐Ÿ‘‹ 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/1271030472570310730

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

brazen ivy
#

Hi, let me help you with this.

snow sleet
#

Thanks Vanya

brazen ivy
#

Can we update the checkout session when a coupon code is applied?
What do you want to update exactly?

snow sleet
#

the shipping price

#

I see this exists
checkout.updateShippingOption(shippingOption?)

brazen ivy
#

Do you use embedded Stripe Checkout?

snow sleet
#

but i'd need an event to know when the coupon has been applied.

brazen ivy
#

Or Stripe-hosted?

snow sleet
brazen ivy
#

You could just create a Coupon that would also cover the shipping amount, have you tried that?

snow sleet
#

I tried, but couldn't find an option

#

did I not look properly?

#

if that works then sorry for wasting your time

#

ill have a look again

#

@brazen ivy I looked again and even tried with fixed discounts, but that always leaves the shipping price

brazen ivy
#

Hmm, let me check.

snow sleet
#

i'll give it a shot

#

give me a few minutes

brazen ivy
#

Ok, I checked and there's no way to apply a discount to a shipping rate unfortunately. So you will have to actually update the rate based on the coupon application.

snow sleet
#

thanks for your time

snow sleet
#

When I initialize stripe I get this: TypeError: stripe.initCustomCheckout is not a function

brazen ivy
#

You're right. Sorry, it is some kind of Beta, that I don't know much about yet. But it might be actually what you're looking for in this case: https://docs.stripe.com/checkout/custom-checkout
It seems to benefit from handling Shipping, Coupons, Taxes etc., but be as flexible as Web Elements.

#

Unfortunately, I don't think it's possible to implement what you're looking for with a standard embedded Checkout.

#

What I recommend as a workaround: apply the discount before creating the Checkout Session. And if the provided Coupon exists, set the available shipping rate to free one.

#

How do customers usually apply the coupon code?

Building a B2B app that also allows employees to get items at a discount
I assume they get to the page with some kind of referral link?

snow sleet
#

I signed up for it, but I don't know how long it'll take to get access

snow sleet
#

so they could just apply them at checkout

#

links could work

brazen ivy
snow sleet
#

but its not what our clients were looking for

brazen ivy
# snow sleet links could work

Let's say, the code would be included in the link, then your app could extract it and check if such Coupon exists, and then choose the shipping rates based on that. This would be my recommended approach.

snow sleet
#

thank you

jovial minnowBOT
snow sleet
#

hello tarzan

brazen ivy
frigid quarry
snow sleet
#

I requested access today

#

but not sure how long it'd take to actually get it

frigid quarry
#

we don't handle that unfortunately

#

you need to contact https://support.stripe.com/?contact=true to get access if you're eligible

frigid quarry
#

they would tell you

snow sleet
#

they said they don't know ๐Ÿ˜ฆ

#

Thanks for your help though, ill figure out another way

frigid quarry
#

who said they didn't know?

#

what's your account ID?

snow sleet
snow sleet
#

but I asked if they could speed up the application process

#

not if I was eligable or not

brittle otter
#

hi! I'm taking over this thread.

#

let me know if you have any other question

snow sleet
#

other than wondering if we can speedupthe beta access request no

brittle otter
#

sorry we know nothing about this, so you'll just need to talk to Stripe support directly.

snow sleet
#

then all good

#

thank