#spider_api

1 messages · Page 1 of 1 (latest)

jagged cosmosBOT
#

👋 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/1428817380259139726

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

amber basin
#

@limpid knot Our overall goal is to allow someone, if they already have any of apple pay, google pay, link, or amazon pay, to use it for both address and payment. However, because we charges sales tax, we cannot calculate the total cost until we have their address. We’re running into problems being able to let someone do, for example, apple pay, where the total is dynamically changed in the apple pay screen as they confirm or change their address, so we are able to calculate the final amount in shippingaddresschange event, but not able to update the wallet total amount shown for user.

limpid knot
#
  const response = await fetch('/calculate-shipping', {
    data: JSON.stringify({
      shippingAddress: address
    })
  });
  const result = await response.json();
  resolve({
    lineItems: result.updatedLineItems,
  });
};```
amber basin
#

@limpid knot Updating the line items works, but it doesn’t update the total shown on the wallet screen, as shown in the image below. How can I update that?

limpid knot
#

Did you also update the payment intent?

amber basin
#

Yes @limpid knot , I also updated the payment intent, but it doesn’t show the updated pricing. Do we need to make a call to Stripe so it knows the payment intent was updated, or does it refresh automatically?

limpid knot
#

I thought updating line items was enough, but let me check with my colleague to get a better understanding

amber basin
#

Thanks @limpid knot

limpid knot
#

Are you loading the element with payment intent client secret?

#

Or using the deferred intents flow where you just pass an amount into the element and create the payment intent later?

amber basin
#

@limpid knot I am loading the element with payment intent client secret

limpid knot
#

Still waiting to hear back from my colleague

jagged cosmosBOT
limpid knot
#

Ok so we're still looking into whether this is possible or not with creating intent up-front

#

The ECE was designed for the deferred intent flow, so this is possible in that flow

#

Where you pass an amount into Elements and wait to create the intent until after submitting

amber basin
#

Thanks @limpid knot let me try this out