#zpapier_api

1 messages ¡ Page 1 of 1 (latest)

raven lakeBOT
#

👋 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.

karmic ginkgo
#

Not sure I understand. Can you explain more the issue?

sage flicker
#

Sure, shall I make a screen recording?

karmic ginkgo
#

That would help as well, yes

sage flicker
#

Okay one second..

#

In our code both these actions are triggered with: the shippingoptionchange event

#

But one seems to work, while the other doesn't

karmic ginkgo
#

Can you share your client-side code?

sage flicker
#

Sure, let me try and portion it out - or would you like the entire file?

karmic ginkgo
#

Just the relevant pieces so it's easy for me to take a look

sage flicker
#

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

karmic ginkgo
#

And you're saying this works fine in apple pay

sage flicker
#

Yes completely fine

#

I can show you if you like

karmic ginkgo
#

Sure

sage flicker
#

2 mins..

karmic ginkgo
#

Sure no problem

sage flicker
#

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

karmic ginkgo
#

Yeah doesn't make sense off-hand

#

Hm

#

Can you add a bunch of console.logs?

#

At least 1 in each block

sage flicker
#

Yeah tried that

karmic ginkgo
#

Just so we can narrow it down a bit

sage flicker
#

I've even added a timeout to the ev.updateWith

#

To actually see that trigger

#

I can show you?

karmic ginkgo
#

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?

sage flicker
#

Yeah let me show you now

#

You would need to create an account - but you can use dummy data if you like

#

I'll add some logs and show you now

#

Sorry I just need to compress my video files before I can upload them...

karmic ginkgo
#

That's fine

sage flicker
#

So you can see where I've added the logs too

karmic ginkgo
#

Ok really weird

#

Let me repro

sage flicker
#

And I'll show you how it looks when I just change my address..

karmic ginkgo
#

But I think you're going to have to write in to support so the owning team can investigate this. Looks like a bug

sage flicker
#

Okay nice, how / where do I go about doing that?

sage flicker
# karmic ginkgo Let me repro

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)

karmic ginkgo
#

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

sage flicker
#

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?

karmic ginkgo
#

I'm not sure off-hand. Depends on the root cause I guess

#

But yeah in general I recommend moving toward the express checkout element

#

Especially if this is a newer integration

#

I can't recommend building something new with that flow since we're deprecating it

sage flicker
#

Okay makes sense

#

I'll reach out to the team

#

Thanks for your help!