#zpapier_api
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/1293941124926410793
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- zpapier_api, 2 hours ago, 33 messages
Not sure I understand. Can you explain more the issue?
Sure, shall I make a screen recording?
That would help as well, yes
Okay one second..
You can see when I add a new address the shipment options is stuck on pending..
But if I just switch to an existing address the shipping options show as expected
In our code both these actions are triggered with: the shippingoptionchange event
But one seems to work, while the other doesn't
Can you share your client-side code?
Sure, let me try and portion it out - or would you like the entire file?
Just the relevant pieces so it's easy for me to take a look
No probs
So we have this listener: this.paymentRequest.on(
"shippingaddresschange",
this.handleShippingAddressChange
);
Which fires this method:
async handleShippingAddressChange(ev) {
const shippingAddressOptionsResponse =
await order.createPaymentProviderAdddress(ev.shippingAddress);
if (
shippingAddressOptionsResponse.data.errors &&
shippingAddressOptionsResponse.data.errors.length > 0
) {
ev.updateWith({
status: "fail",
error: this.t(shippingAddressOptionsResponse.data.errors[0])
});
} else {
const shippingAddressOptions = this.parsedShippingAddressOptions(
shippingAddressOptionsResponse.data.cart.shipments[0].shipping_options
);
const shippingData = await this.setShippingOption(
shippingAddressOptions[0].id
);
this.shipmentOptions = shippingAddressOptions;
if (shippingData) {
ev.updateWith({
status: "success",
displayItems: this.displayItems,
shippingOptions: shippingAddressOptions,
total: {
amount: Math.round(this.total.raw * 100),
label: "Total:"
}
});
}
}
},
In this function we check the address and fetch appropriate shipping options, which we use to populate ev.updateWith at the end there
parsedShippingAddressOptions Just puts the shipping options into an appropriate format that Stripe expects
And you're saying this works fine in apple pay
Sure
2 mins..
Sure no problem
I don't think I can show you the finger print while using Apple Pay but you can see the shipping option updating okay when I change address
And this is running from the same codebase
When I stop screen recording the fingerprint shows up to say I can pay anyway
To me it feels like ev.updateWith is not triggering a re-render of the Google Pay modal UI
But only with new addresses? Which is why it feels a bit strange
Yeah doesn't make sense off-hand
Hm
Can you add a bunch of console.logs?
At least 1 in each block
Yeah tried that
Just so we can narrow it down a bit
I've even added a timeout to the ev.updateWith
To actually see that trigger
I can show you?
So you know for a fact it's reaching this block?
ev.updateWith({
status: "success",
displayItems: this.displayItems,
shippingOptions: shippingAddressOptions,
total: {
amount: Math.round(this.total.raw * 100),
label: "Total:"
}
});```
You logged it?
Yeah let me show you now
You can actually have a go yourself if you would like: https://papier.ngrok.app/ - This is tunneling from my local environment so you will see any changes I make
You would need to create an account - but you can use dummy data if you like
And if you're in the US / using a US address you would need to use - https://papier.ngrok.app/us
I'll add some logs and show you now
Sorry I just need to compress my video files before I can upload them...
That's fine
And I'll show you how it looks when I just change my address..
But I think you're going to have to write in to support so the owning team can investigate this. Looks like a bug
Okay nice, how / where do I go about doing that?
This is it working when I change address with the logs FYI
If you're reproducing on the link I sent you you will need to sign up for an account before you can see the payment button because we only show it to pre-existing users. And you will see it on the basket page (after you've added a notebook to your basket)
Got it. Yeah I don't think there's anything else I can do in here unfortunately. It's hitting the correct block of code. The ev.updatewith isn't succeeding for some reason. I think you'll need to write in at https://support.stripe.com/contact with as many details as possible (code snippet, screen recording, and instructions + link to repro), so the owning team can investigate root cause of the bug
Thanks, does it feel like it could be something that would be fixed by moving over to the express button?
Because we are on the legacy button still
(Because we're just adding Google Pay to what we already had - Apple Pay)
It feels like it wouldn't because the Google Pay modal isn't really related to the button, right?