#nova_applypromotioncode-elements-with-checkout-session
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/1440382580938637464
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Could you share your website that the applyPromotionCode doesn't work, so that I can take a look?
MyBREB is your all-in-one local hub for real estate listings, rentals, jobs, events, new and used items, and municipal services. Whether you're a buyer, seller, agent, or small business, our marketplace connects you to the best deals, trusted service providers, and powerful advertising opportunities. Real estate professionals can showcase proper...
Thats an example of a working session, if you need it
Could you share the direct access to the checkout page, so that I can test it directly instead of filling up all the information?
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
Sure, sent the DM now
Thanks! I've received the credentials, looking into it now
The page is always in loading status
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
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
I don't get that on my side when I run the code. I can show you my debugger output give me one second
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
What browser are you using, out of curiosity
because ive tried on two browsers, the same account and same page you are accessing.
I tested on Safari. This error was only thrown when I apply promo code and click "Apply"
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
nova_promotion-code
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}
π hi there, River had to step away and I'm catching up on your thread now
Hi! The JSON file attached is an example of one of the stripe calls to https://r.stripe.com/b
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
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 >.<
All good, don't panic, we're looking π
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
and none of this happens in Test mode? Because your code looks minified and it's really hard to debug a live production account
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
make sure you can reproduce in Test mode first
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
The dev site is https://www.mybreb.dev. The same credentials I sent your colleague should work there too.
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?
Unminified code deployed to the live site you mean?
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?
Oh, sorry I had sent your colleague a pre-setup account for this purpose
Can I DM you real quick?
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
Can you get here? https://www.mybreb.dev/dashboard/plan-checkout?plan_id=364dca20-5f57-44e3-86dd-4c16d28139ae&checkout_session_mode=CUSTOM¤cy=CAD&period=YEARLY
MyBREB is your all-in-one local hub for real estate listings, rentals, jobs, events, new and used items, and municipal services. Whether you're a buyer, seller, agent, or small business, our marketplace connects you to the best deals, trusted service providers, and powerful advertising opportunities. Real estate professionals can showcase proper...
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
So the framework is vuejs, so the code is transpiled.
The minified bits you see are hooks into the runtime.
yeah I don't know anything about Vue sadly I just want to add a breakpoint to your code and it doesn't work
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.
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
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.
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
Oh my, this wouldn't happen to be an issue in live mode would it?
which part? That's just a picture of code π
Im not an expert, but initializing the stripe SDK every time a checkout session is requested
I don't see that log in your console on the Live website
Im adding logs everywhere for you, so this log is new
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
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
seems unlikely to me, but do you have an example Event id?
evt_1SUYRwKvrNqDdLmfSf6zugUf
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
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
thanks
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
what do I look for to know I got the new code with logs?
Like is there a log on load?
Oh, it should spit out console logs and console warnings now who have PlanCheckout.vue as their source
yeah I get none of those π
You are on the live site at bestrealestatebuy.com correct?
I had to right click -> inspect -> network -> disable cache
The CDN likes to be annoying on new deploys.
hum I had disable cache checked already
and yeah I still don't get any of the new logs on Live site
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
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?
One second, im looking
So, no we don't have a payment element if they have a saved payment method
Its just a dropdown
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?
I agree, I'm am yelling a lot internally now that I discovered this :p
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
π 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?
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)
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.
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.
Hey, my wife got home sorry I missed this. I will fill out the ticket now.
Hi there,
took over for my colleague who had to step away.
No problem. Let me know if you run into any issues
Am I supposed to talk to your assistant or is there something I click on?
Did you click on the link in the direct message?
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.
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 π
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.