#nova_applypromotioncode-elements-with-checkout-session

1 messages Β· Page 1 of 1 (latest)

velvet yarrowBOT
#

πŸ‘‹ 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/1440382580938637464

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

fallow current
#

Could you share your website that the applyPromotionCode doesn't work, so that I can take a look?

foggy bolt
#
#

Thats an example of a working session, if you need it

fallow current
#

Could you share the direct access to the checkout page, so that I can test it directly instead of filling up all the information?

foggy bolt
#

The checkout page is behind registration and user accounts. We use oauth for our login, so I don't have a spare account laying around

#

This is a live integration as well, let me see if I can't get an account up

#

This is sensitive information, can I DM you with the credentials?

#

I have my personal CC attached to the account

fallow current
#

Give me a moment, let me enable DM feature

#

Could you try DM-ing me now?

foggy bolt
#

Sure, sent the DM now

fallow current
#

Thanks! I've received the credentials, looking into it now

#

The page is always in loading status

foggy bolt
#

Jeeze. I don't have any issues on my end. Can you try navigating directly? Account -> Settings -> Plan Subscription. Select any of the paid plans and click continue checkout

#

I tried logging into the same account and it works on my side. Is there an adblock running on your PC? We noticed they like to block the payment controls

fallow current
#

Can you try navigating directly? Account -> Settings -> Plan Subscription. Select any of the paid plans and click continue checkout
Trying this now

#

I'm getting this error when applying the promo code. It seems that there is undefined object somewhere in your code

foggy bolt
#

I don't get that on my side when I run the code. I can show you my debugger output give me one second

fallow current
#

I can't proceed further with this error. You likely have to identify why this issue occurs since your customers will likely face the same issue as well

foggy bolt
#

What browser are you using, out of curiosity

#

because ive tried on two browsers, the same account and same page you are accessing.

fallow current
#

I tested on Safari. This error was only thrown when I apply promo code and click "Apply"

foggy bolt
#

Can you do me one more huge favour and try it with the platinum plan, just in case my testing has messed up the others.

#

We don't even get so far as to get that error, we get a 'sorry, cant do this' error from the stripe API in the callback to applyPromotionCode

velvet yarrowBOT
charred briar
#

nova_promotion-code

foggy bolt
#

I think I need to clarify something further, sorry. When we click 'Apply' on the promotion code, 3 callouts to the stripe API occur. I have attached one such callout. When the 3 API calls have completed, then our callback is called by the Stripe SDK. This comes back with {error: 'Something went wrong, please try again later.', code: null}

charred briar
#

πŸ‘‹ hi there, River had to step away and I'm catching up on your thread now

foggy bolt
charred briar
#

I've just tried on Google Chrome to use the coupon code TROYTEST100 while purchasing the platinum plan and got the "Failed to apply coupon code: Sorry, something went wrong. Please try again later." error message

foggy bolt
#

Yes, thats the error we are getting from Stripe being dumped, ad-verbatim, to the page.

#

Are we doing something wrong with our integration causing stripe to reject the applyPromotionCode call?

#

I don't see any failed requests in the network inspector, my server is reporting 200 OK on the createCustomerSession call. The stripe live dashboard shows no failed requests, and there is no code given to us by Stripe that signals the promotion code being invalid.

Im sorry but we are so lost >.<

ember bolt
#

All good, don't panic, we're looking πŸ™‚

foggy bolt
#

My apologies, the client launched the other day and their first customer can't check out, so im trying to relay information to him as fast as I can

ember bolt
#

and none of this happens in Test mode? Because your code looks minified and it's really hard to debug a live production account

foggy bolt
#

It wasn't when we did red/blue testing before. Maybe its happening now? I did notice the new custom_checkout API has a loadActions method which isnt being called by us, as we are using an older API version.

#

Let me get you access to the test site

ember bolt
#

make sure you can reproduce in Test mode first

foggy bolt
#

I am setting up a dev side account to test with, give me one moment

#

So it worked in test mode.

#

Checkout session cs_test_b1t1S86LvGbBli1D3OCAjsXpuOe0CGE7VmVqZv7Gm8f45sgxoAYk3trpj2

ember bolt
#

yeah but since it works it won't really help πŸ™

#

Is there a way to get unminified code? Or add logs before/after applyPromotionCode() where you are calling it?

foggy bolt
#

Unminified code deployed to the live site you mean?

ember bolt
#

Yes. I'm trying to read your code but I have to do an entire sign up end to end. Can you put that account in the right state so I can just see the upgrade page?

foggy bolt
#

Oh, sorry I had sent your colleague a pre-setup account for this purpose

#

Can I DM you real quick?

ember bolt
#

I have the account info but I get to an empty state in Test mode but I think it works the second time for some reason

foggy bolt
#
ember bolt
#

but yeah again the code is in a weird state. If I try to add any breakpoint to your code it just sends me elsewhere as if something is borked with the set up

foggy bolt
#

So the framework is vuejs, so the code is transpiled.

#

The minified bits you see are hooks into the runtime.

ember bolt
#

yeah I don't know anything about Vue sadly I just want to add a breakpoint to your code and it doesn't work

foggy bolt
#

Yeah the breakpoint probably won't work since there are no sourcemaps. Let me see if I can generate them for you. This code was written by someone I had the owner let go, so the code is an absolute nightmare. I am walking into this the same as you all, pretty much.

ember bolt
#

Okay, can you add a log before and after that applyPromotionCode() call so I can at least figure out what is called and in which order?

Basically when you call that method it internally "updates" the Checkout Session. I see this on your Test mode attempt but not in Live mode, it's like there's no log

foggy bolt
#

Thats the confusion I am having too. In the callback, I get a 'Something went wrong, please try again later' and then absolutely nothing.

#

Since its all iframed, I see no requests going out to stripe.

ember bolt
#

yeah I'm not asking for requests, I want to see logs right now

#

My gut: there's a problem with captcha that is conflicting with your code and just preventing the PromotionCode from being applied at all

foggy bolt
#

Oh my, this wouldn't happen to be an issue in live mode would it?

ember bolt
#

which part? That's just a picture of code πŸ˜“

foggy bolt
#

Im not an expert, but initializing the stripe SDK every time a checkout session is requested

ember bolt
#

I don't see that log in your console on the Live website

foggy bolt
#

Im adding logs everywhere for you, so this log is new

ember bolt
#

ah gotcha

#

It might be but I don't think so

#

you also use an old beta (custom_checkout_beta_6) which I am not super familiar with

foggy bolt
#

We can't update to acacia yet, this is a beta with mode=custom for stripe checkout.

#

I also noticed stripe is sending me invalid payloads on my webhooks all of a sudden. Maybe a breaking change happened internal to stripe by accident?

#

The promotioncode.created event is 401-ing when it didn't use to

ember bolt
#

seems unlikely to me, but do you have an example Event id?

foggy bolt
#

evt_1SUYRwKvrNqDdLmfSf6zugUf

ember bolt
#

yeah the 401 comes from your server so you need to dig into what's causing it. Something in your code must error and decide to show a 401. I sadly can't debug because there's no log returned so I can't even guess waht it could be

foggy bolt
#

Yeah, we are just using the stripe java SDK which is throwing the 401 error

#

Cant parse JSON payload

#

Im building a new container with the sourcemaps now, its about halfway through i think

ember bolt
#

thanks

foggy bolt
#

Okay. So if you make sure you empty cache and hard reload the site, there is now logging

#

As for the sourcemaps, im looking on how to attach them real quick

ember bolt
#

what do I look for to know I got the new code with logs?

#

Like is there a log on load?

foggy bolt
#

Oh, it should spit out console logs and console warnings now who have PlanCheckout.vue as their source

ember bolt
#

yeah I get none of those πŸ™

foggy bolt
#

I had to right click -> inspect -> network -> disable cache

#

The CDN likes to be annoying on new deploys.

ember bolt
#

hum I had disable cache checked already

#

and yeah I still don't get any of the new logs on Live site

foggy bolt
#

When you reload the page, you don't get that at all?

ember bolt
#

nope

#

even with cmd+shift+R

foggy bolt
#

Let me globally invalidates cdn caches

#

Okay, ive invalidated all cdn caches. I checked microsoft edge, no 'disable cache' selected, and i see the logging

ember bolt
#

okay I was asking internally in parallel and I think I know what's going on. My understanding is we have a weird edge-case where if you don't render PaymentElement on that page, the applyPromotionCode() fails only in Live mode

#

To be clear: this never worked for you right? Like it didn't break today, it's just the first time you launch to production?

#

Do you have a UI where you have PaymentElement in there too?

foggy bolt
#

One second, im looking

#

So, no we don't have a payment element if they have a saved payment method

#

Its just a dropdown

ember bolt
#

basically what the team says: if you create PaymentElement, even if you don't mount it, it should work

#

any chance you can try that?

velvet yarrowBOT
foggy bolt
#

That is such a dangerous gotcha if this is true

#

Let me try

ember bolt
#

I agree, I'm am yelling a lot internally now that I discovered this :p

foggy bolt
#

Im still looking into this, for whatever reason my logging isnt triggering on the live site.

#

It works on my local machine this way. Just waiting for the damn thing to propagate to the live box

#

Alright, now that it has propagated I am seeing the coupon apply correctly.

#

It appears I needed to wait for the checkout session to be created as well. When I had it before, it still didnt work

velvet yarrowBOT
scarlet wraith
#

πŸ‘‹ Hi, changing of the guard here.Just getting caught up. Sounds like you've got the immediate issue ironed out?

#

koopajah is working internally to have some of those gotchas addressed. Would you like to stay updated on that progress?

foggy bolt
#

Yes please. We have to update to acacia at some point, but knowing this is solved would be a boon. Perhaps in the meantime, the documentation can be updated so others don't run into this (how I am the first is wild)

scarlet wraith
#

This is being treated as urgent and will likely be resolved before a documentation change will be needed. I will however push for a documentation change if we can't expect a fix in the very near term.
I'm going to send you a link that will allow you file a ticket that is escalated directly to our team with this threads context so we can keep you updated. Just let me know when you've finished submitting so I can grab it.

velvet yarrowBOT
#

Hello @foggy bolt, we have sent you a direct message, please check it at https://discord.com/channels/@me/1440452517711314955

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
velvet yarrowBOT
foggy bolt
#

Hey, my wife got home sorry I missed this. I will fill out the ticket now.

gusty tendon
#

Hi there,
took over for my colleague who had to step away.

#

No problem. Let me know if you run into any issues

foggy bolt
#

Am I supposed to talk to your assistant or is there something I click on?

gusty tendon
#

Did you click on the link in the direct message?

foggy bolt
#

I did. It brought me to your regular support page.

gusty tendon
#

Hm, let me check with my colleagues real quick....

#

Can you go through the AI chat flow? We are apparently working on this workflow currently and hopefully will be fixed in the near future.

foggy bolt
#

Wow, that was simple.

Some feedback for your AI agent if you guys dont mind me:

I know someone coded the cool fading wavy gradient, but at least for me (being nearsighted and a history of glaucoma) it makes it nearly impossible to read the text πŸ™‚

gusty tendon
#

Thanks for the feedback. I will forward it to the product team to consider.

#

Alright, seems like we already received your ticket.

#

Alright, you will receive now emails from us about the progress of the investigation. You should receive an email soon from one of our team members. And you can simply respond to that email if you have further questions.