#marco_code

1 messages ยท Page 1 of 1 (latest)

rare pendantBOT
#

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

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

wide star
#

Our front

#

And our back is like this

tawdry zealot
#

Unclear from the code

tawdry zealot
#

And you're listening to the shippingratechange event? Sorry I didn't look at all your code

wide star
#

Yes in attachEventListeners()

this.expressCheckoutElement.on('shippingratechange', async (event) => {
this.log('๐Ÿšš STRIPE EXPRESS: SHIPPING RATE CHANGE event triggered:', event.shippingRate);
await this.handleShippingRateChange(event);
});

tawdry zealot
#

OK and I assume handleShippingRateChange updated the Payment Intent server-side?

wide star
#

Exactly

In updataShippingCarrier, we do that :

$updatedPaymentIntent = \Stripe\PaymentIntent::update($paymentIntentId, [
'amount' => $newStripeAmount,
'metadata' => [
'last_update' => date('Y-m-d H:i:s'),
'carrier_id' => $carrierId,
'carrier_name' => $carrier->name,
'shipping_cost' => $shippingCost,
]
]);

tawdry zealot
#

That will update the Elements group to reflect the latest intent state (amount, currency, etc)

rare pendantBOT
wide star
#

You got it rightn we don't have any call to fetchUpdate in our js

tawdry zealot
#

I'd try adding that after the Payment Intent update resolves

wide star
#

Thanks for the information, I'm gonna add it

broken siren
#

where can i create a thread

#

or do i talk here on this existing thread

tawdry zealot
wide star
#

Unfortunately, this does not seems to resolve my issue

#

What's strange is that in my logger, I can see that the payment intent has been updated, that the new carrier is correctly selected and the new amount is correct, but that does not reflect in the klarna popup

sonic wraith
#

hi! I'm taking over this thread.

wide star
#

Hello, thank you

#

To give you more detail, that's what I get on the cart (with a 12โ‚ฌ carrier)

#

But onece I open Klarna, if I change to a free shipping carrier, the amount is still the same (but it should be 208 instead of 220)

#

On the server side, everything seems correct and the change take effect if I reload the cart page, but as soon as I'm changing the carrier inside of the klarna popup, the popup itself does not take the new shipping fee

sonic wraith
#

can you share the PaymentIntent ID (pi_xxx) with this issue?

wide star
#

pi_3S532KBFRILdnFje1Ex1JLur

sonic wraith
#

that PI was created with amount: 20800. then later updated to amount: 20800. so the maount never actually changed.

wide star
#

I see, but the thing I don't get is why does the popup show's up with an amount of 22000 if it's been created with an intent of 20800

sonic wraith
#

based on the screenshot you shared, the amount is 208โ‚ฌ, and there's an additional 12โ‚ฌ for shipping. so the total is 220โ‚ฌ.

wide star
#

does not "amount" include product + shipping ?

sonic wraith
#

which "amount" are you talking about exactly? the one you set on the PaymentIntent?

wide star
#

Yes, the one that is sent on the paymentIntent creation

#

I get that on my case, the amount sent on the creation is 20800

sonic wraith
#

could you share a link where I can reproduce the issue?

#

or a quick video of the flow?

wide star
#

I make you a video, just a moment please

sonic wraith
#

but this is the Klarna UI, so not really related to Stripe?

wide star
#

So it's not on your support that we can have help if it's related to klarna ui ? Sorry for the question

I tought it would be on your support cause it's all related to strip-express

You got any info on where I could contact someone that can help me ?

rare pendantBOT
lament creek
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

wide star
#

Hello, thank you

lament creek
#

would you mind sharing a url where we could test this ourselves?

wide star
#

Sure wait a min

#

Is that okay if I send it to you by pm ?

lament creek
wide star
#

Okay thank you

lament creek
#

in this case we will continue investigating your ticket asynchronously. so please add as much details as possible. code snippets, url, credentials if necessary, steps to reproduce, etc.