#Stone.D

1 messages ยท Page 1 of 1 (latest)

rigid fractalBOT
hexed burrow
#

๐Ÿ‘‹ happy to help

#

taking a look at the request

#

as per the request's error message

#

you just need to add the customer_update[shipping] parameter to your request

#

since the customer in question doesn't have a shipping address

misty palm
#

I use builder = new SessionCreateParams.Builder()
.setSuccessUrl(successUrl)
.setCancelUrl(cancelUrl)
.setPaymentIntentData(
SessionCreateParams.PaymentIntentData.builder()
.setReceiptEmail(user.getEmail())
.setSetupFutureUsage(SessionCreateParams.PaymentIntentData.SetupFutureUsage.OFF_SESSION)
.build()
)
.setShippingAddressCollection(shippingBuilder.build())
.setMode(SessionCreateParams.Mode.PAYMENT)
.setAutomaticTax(
SessionCreateParams.AutomaticTax.builder()
.setEnabled(true)
.build());

#

I don't know how to do that.

#

SessionCreateParams.ShippingAddressCollection.Builder shippingBuilder =
SessionCreateParams.ShippingAddressCollection.builder().addAllAllowedCountry(Arrays.asList(SessionCreateParams.ShippingAddressCollection.AllowedCountry.values()));

#

I did not use the map method, but the builder method. I don't know how to set up in builder mode

#

I am tring as your suggestion.

hexed burrow
#

sorry I'm trying to find the right function to add that parameter in our Java SDK

#

this is the function you need to use

#

setCustomerUpdate

misty palm
#

Yes , it works

hexed burrow
#

perfect

hexed burrow
#

they won't work unless you collect shipping address since you have automatic_tax.enabled on your checkout session

misty palm
#

This is my snippet: builder = new SessionCreateParams.Builder()
.setSuccessUrl(successUrl)
.setCancelUrl(cancelUrl)
.setPaymentIntentData(
SessionCreateParams.PaymentIntentData.builder()
.setReceiptEmail(user.getEmail())
.setSetupFutureUsage(SessionCreateParams.PaymentIntentData.SetupFutureUsage.OFF_SESSION)
.build()
)
// .setShippingAddressCollection(shippingBuilder.build())
.setCustomerUpdate(SessionCreateParams.CustomerUpdate.builder().setShipping(SessionCreateParams.CustomerUpdate.Shipping.AUTO).build())
.setMode(SessionCreateParams.Mode.PAYMENT)
.setAutomaticTax(
SessionCreateParams.AutomaticTax.builder()
.setEnabled(true)
.build());
}

hexed burrow
#

seems ok

misty palm
#

But it doesn't work.

#

I get that url by this snippet.

hexed burrow
#

could you please share the new url?

hexed burrow
#

there's something weird

#

in your request it's mentioning customer_update.nameand customer_update.address instead of shipping

#

could you please retry

#

generating a new checkout session

hexed burrow
#

It's not collecting shipping address still

#

let me double check something

misty palm
#

OK

hexed burrow
#

could you please recopy the code you executed?

misty palm
#

yes

hexed burrow
#
                        .setCustomerUpdate(SessionCreateParams.CustomerUpdate.builder().setAddress(Address.AUTO).setName(Name.AUTO).build())```
this is wrong
#

you should uncomment the first one

misty palm
#

As figure?

hexed burrow
#

yes

#

no actually

#

what you're doing here is overriding the first CustomerUpdate object with the second

#

.setCustomerUpdate(SessionCreateParams.CustomerUpdate.builder().setAddress(Address.AUTO).setName(Name.AUTO).setShipping(SessionCreateParams.CustomerUpdate.Shipping.AUTO).build())

#

this should be your only line for setCustomerUpdate

misty palm
#

Not work.

#

ok

hexed burrow
#

sorry I didn't follow

#

what didn't work?

hexed burrow
#

I'm not sure what's happening but the code you're using is not setting shipping: auto on Customer Update

#

you need to debug your code and try to find at which level this is happening

lucid cove
#

Looking in to the proper code to do this with builders. It shouldn't be too different than what you have

misty palm
#

Whether it has anything to do with us in mainland China, because it does not support google pay.

#

Does it have something to do with the settings on the dashboard?

#

Can we continue tomorrow? A bit late for my region.

lucid cove
#

Yes we can, I will try to figure those out and send a message in this thread if I figure it out

misty palm
#

If so, thank you very much.

lucid cove
#

Otherwise, you can message in the main channel tomorow and mention this thread

#

Of course, have a good night!

misty palm
#

Have a good day.

#

Bye