#cincyjoe12_checkout-savedpms
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1248333452944609390
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Here's the area of the code where I handle this
Customer customer = getCustomerByEmail(emailAddress);
SessionCreateParams.PaymentMethodType paymentMethodTypeForCheckoutSession;
if ("us_bank_account".equals(paymentMethod)) {
paymentMethodTypeForCheckoutSession = SessionCreateParams.PaymentMethodType.US_BANK_ACCOUNT;
} else {
paymentMethodTypeForCheckoutSession = SessionCreateParams.PaymentMethodType.CARD;
}
Builder sessionCreateParamsBuilder = SessionCreateParams.builder().setMode(SessionCreateParams.Mode.PAYMENT)
.addPaymentMethodType(paymentMethodTypeForCheckoutSession).setSuccessUrl(paymentSuccessUrl)
.setCancelUrl(paymentCancelUrl)
.addLineItem(SessionCreateParams.LineItem.builder().setQuantity(1L)
.setPriceData(SessionCreateParams.LineItem.PriceData.builder().setCurrency("usd")
.setProductData(SessionCreateParams.LineItem.PriceData.ProductData.builder()
.setName(type).setDescription(invoiceNumStr).build())
.setUnitAmount(paymentAmount.multiply(new BigDecimal(100)).longValue()).build())
.build())
.setPaymentIntentData(SessionCreateParams.PaymentIntentData.builder().setDescription(invoiceNumStr)
.setReceiptEmail(emailAddress).putAllMetadata(paymentIntentMetadataMap).build())
.putAllMetadata(checkoutSessionWebhookMetadataMap);
if (customer != null) {
sessionCreateParamsBuilder.setCustomer(customer.getId());
} else {
sessionCreateParamsBuilder.setCustomerEmail(emailAddress);
}
Checkout Sessions don't offer a way to use existing/saved US Bank account payment methods - every single time they pay with bank account on a Checkout Session it's create a new Payment Method. That's why they're being asked to reverify every single time.
The reports are that its working fine with Plaid. Is that consistent with what you said?
I saw the below in the link: https://docs.stripe.com/payments/ach-debit/set-up-payment?platform=web&payment-ui=stripe-hosted
Are you saying I can't supply this payment method in the payment intent while creating the checkout session?
Are you saying I can't supply this payment method in the payment intent while creating the checkout session?
Correct - if you want to use the saved Payment Method you'd create a Payment Intent instead, not a CHeckout Session (like we mention at https://docs.stripe.com/payments/ach-debit/set-up-payment?platform=web&payment-ui=stripe-hosted#use-the-payment-method)
When a checkout session is created, you can set the payment intent data. On that there appears to be a setup_future_usage. Would this make it so the user doesn't need to manually redo the microdeposit on each transaction? https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
Builder sessionCreateParamsBuilder = SessionCreateParams.builder().setMode(SessionCreateParams.Mode.PAYMENT)
.addPaymentMethodType(paymentMethodTypeForCheckoutSession).setSuccessUrl(paymentSuccessUrl)
.setCancelUrl(paymentCancelUrl)
.addLineItem(SessionCreateParams.LineItem.builder().setQuantity(1L)
.setPriceData(SessionCreateParams.LineItem.PriceData.builder().setCurrency("usd")
.setProductData(SessionCreateParams.LineItem.PriceData.ProductData.builder()
.setName(type).setDescription(invoiceNumStr).build())
.setUnitAmount(paymentAmount.multiply(new BigDecimal(100)).longValue()).build())
.build())
**.setPaymentIntentData(SessionCreateParams.PaymentIntentData.builder().setDescription(invoiceNumStr)
.setReceiptEmail(emailAddress).putAllMetadata(paymentIntentMetadataMap).build()**)
.putAllMetadata(checkoutSessionWebhookMetadataMap);
I could add on .setSetupFutureUsage(<object>)
If you're using a Checkout Session you're still going to need to redo the microdeposit - using setup_future_usage will only help if you use the generated Payment Method to then create a Payment Intent for future payments
ah. Alright, I'll push this back up my chain then. My product lead met with someone at Stripe and they said we could solve this but I'm guessing its because they didn't realize we were using the Prebuilt checkout page
Yeah if you're doing all your payments with the prebuilt checkout page there isn't a way to use a saved ACH payment method.
happy to help!