#shinnosuke-hirota_api

1 messages ¡ Page 1 of 1 (latest)

gilded shuttleBOT
#

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

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

paper graniteBOT
modern eagle
#

Hi there, it looks like payment_method_data[type] is missing in your reuqest, can you share with me the complete code?

carmine garnet
#

var requestParam = PaymentIntentCreateParams.builder()
.setCurrency("jpy")
.setAmount((long) totalAmount)
.setCustomer(stripeCustomerId)
.setPaymentMethod(stripePaymentMethodId)
.setPaymentMethodData(
PaymentMethodData
.builder()
.setType(Type.valueOf("card"))
.setBillingDetails(
BillingDetails
.builder()
.setEmail(userInfo.email())
.setName(userInfo.name())
.setAddress(
Address
.builder()
.setCountry("JP")
.setState(userInfo.region())
.setCity(userInfo.city())
.setLine1(userInfo.address())
.setLine2(userInfo.building())
.setPostalCode(userInfo.postCode())
.build()
).build()
).build()
)
.setCaptureMethod(CaptureMethod.AUTOMATIC)
.build();

#

I don't want to specify some payment services (such as PAYPAL) as PaymentMethodData, but just execute credit card payments by adding customer info

modern eagle
#

Ok, right now you are setting the address as the billing details to the payment method object, why don't you set the address on the customer object directly?

carmine garnet
#

i didn't know that solution
but we would like to attach address to PaymentIntet itself not customer

#

since we would like to accept customer could have mutiple billing address

modern eagle
#

Do you intent to surface the billing address to customer in invoices ?

carmine garnet
#

it sounds better

Do you intent to surface the billing address to customer in invoices ?
I have no intention of doing so at this time.

modern eagle
#

Ok, if it's just your own record keeping purpose, you can just use metadada to store custom information that you want to attach to paymentIntents

carmine garnet
#

thank you so much for your help