#achilles_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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/1242462225113940028
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there ๐ the Test your integration section in that doc gives some guidance for testing this flow. Is there something else you were trying to test about it?
Is it possible to collect customers preferred payment method card/bank transfer using checkout?
Yes.
I want to create a checkout with free trial that collects payment method options
params := &stripe.CheckoutSessionParams{
Customer: stripe.String(customerId),
LineItems: subscriptionItems,
Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)),
SuccessURL: &successUrl,
CancelURL: &failureUrl,
ExpiresAt: &expiresAt,
BillingAddressCollection: stripe.String(string(stripe.CheckoutSessionBillingAddressCollectionRequired)),
SubscriptionData: &subscriptionData,
CustomFields: customFields,
}
should i add anything for the above params
also currently my dashboard shows this
Yes, if you test that you'll see it doesn't do what you're describing. You'll also want to set payment_method_collection to always:
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_collection
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but bank transfer is active
We aren't as familiar with the dashboard in this forum, so I don't know what that first screenshot is showing, where it was taken from, or what it's referring to. Is it impacting what you're seeing in your testing?
i didn't set it as it will always default to always
Ah, yup, I missed overlooked that mode was set to subscription.
I want to see bank transfer selection with my current configuration
and don't want to set it manually through api
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay, it's on in your automatic payment method settings, are you not seeing it in the Checkout Sessions you create?
yes
Can you share the ID of a Checkout Session from your testing?
cs_test_b1idXcVXFcrnQz13dV3r3IO0EYcUNVZcHo4XeGvGqBO5aLSsXPJThQwTRP
Thank you, not spotting the problem here yet, but am still looking.
I can see this on retrieving the checkout session from cli
"card": {
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
Ah, I see what it is. While Checkout can support Bank Transfers and Cards in payment mode, it can't support them both in Subscription mode:
https://docs.stripe.com/payments/payment-methods/integration-options#support-bank-transfers
Oh! so how do i collect customer preference for my use case
You would need to collect that manually before progressing to the payment process, so you know which payment flow to send your customer through based on how they want to pay.
Alternatively you could explore migrating from Checkout Sessions to the Payment Element, as the supportablility matrix linked above indicates that integration path doesn't have the limitaton Checkout Sessions do.