#cincyjoe12_checkout-savedpms

1 messages ¡ Page 1 of 1 (latest)

jolly pendantBOT
#

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

worthy schooner
#

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);
    }
amber wing
#

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.

worthy schooner
#

The reports are that its working fine with Plaid. Is that consistent with what you said?

amber wing
worthy schooner
#

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>)

amber wing
#

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

worthy schooner
#

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

amber wing
#

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.

worthy schooner
#

yepp, and that's where we're at

#

Thanks!

amber wing
#

happy to help!