#nina_ece-shipping

1 messages ¡ Page 1 of 1 (latest)

glacial shardBOT
#

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

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

latent arch
#

nina_ece-shipping

#

It looks like you get that error if you explicitly set shipping on PaymentIntent creation server-side but then try to override it client-side and it's blocked.
So I think if you use ECE you shouldn't set shipping on creation at all on the PI and let ECE pass it during confirmation

wide sequoia
#

If I want to pass the shipping address in the service side when I create PI. How can I do it when I invoke confirm in ECE?

latent arch
#

you can't. You'd have to disable shipping collection in ECE in that case since you already have collected shipping. Does that make sense?

wide sequoia
#

I don't think so. I can't remove the shipping collection in ECE. The customer need to choose their shipping address

#

I mean if it is possible to remove shipping when I invoke confirmPayment

        elements,
        clientSecret,
        confirmParams: {
          return_url: returnUrl,
          payment_method_options: {
            card: { setup_future_usage: 'off_session' },
          },
          payment_method_data: {
            billing_details: {
              name: `${state.checkoutInfo.shippingFirstName} ${state.checkoutInfo.shippingLastName}`,
              email: state.checkoutInfo.email,
              phone: state.checkoutInfo.phone,
            },
          },
        },
        redirect: 'if_required',
      };
      const result = await stripe.confirmPayment(confirmPaymentParams);```
latent arch
#

The customer need to choose their shipping address
but then why do you have it on PaymentIntent creation in that case if you want the customer to pick one in ECE?

wide sequoia
#

In my code, the previous integration of the Payment Element passed in the shipping information when creating the Payment Intent. I want to reuse that logic.

latent arch
#

that way PaymentElement passes whatever you collected and ExpressCheckoutElement passes what was collected in the UI with it

wide sequoia
#

Thank you your suggestion.