#_durrell
1 messages ยท Page 1 of 1 (latest)
@ancient cosmos I'm sorry I am really confused about this. Checkout can not be used at all for something like this as far as I know
Checkout is here to collect PaymentMethod details for a payment. It is not compatible with Treasury and I don't think you can make it work this way. At least I wouldn't
Checkout has an expiry of 24 hours so there isn't really a "come back to it" later but it's really just one page
Here is my train of thought. If you use chrome you should be able to see the highlighted parts of the docs I'm linking to.
-
This page shows the
Stripe::Treasury::OutboundPaymentcall I'm trying to make. It says I must first create a PaymentMethod using a SetupIntent.
https://stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments#:~:text=With destination_payment_method%2C you,is attached to. -
This page talks about enabling ACH Direct Debit as a payment method here:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=checkout#enable-ach-direct-debit-as-a-payment-method
Then at the bottom of the page it says we can collect the PaymentMethod here:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=checkout#use-the-payment-method -
The last link above has a "collect" link that goes to this page:
https://stripe.com/docs/payments/save-and-reuse#retrieve-checkout-session
This page talks about receiving a checkout.session.completed event where we can get a Session object with a setup_intent id:
https://stripe.com/docs/payments/save-and-reuse#retrieve-checkout-session:~:text=After you have retrieved the Session object%2C get the value of the setup_intent key%2C which is the ID for the SetupIntent created during the Checkout Session.
Then we retrieve the SetupIntent with that id and we will see that payment_method ID:
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=checkout#retrieve-setup-intent
Will this not even work or is there a better way to do this?
I'm fairly certain this would never work but I haven't really tried. Really you're supposed to use PaymentElement on your own app/website to collect bank details for that flow
So we use the bank option here: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues-paymentMethods-ideal-bank
That will lead to the creation of a Stripe::PaymentMethod that we can use to let the connected account ACH funds from their Stripe::Treasury::FinancialAccount to their external bank? No need to worry about Stripe::SetupIntent records? I thought we needed the SetupIntent to let the PaymentMethod work off session.
Hi there ๐ taking over, as my colleague needs to step away
What have you tried to implement already?
๐
I haven't tried any of this yet. I suspect I need a Stripe::SetupIntent to use the PaymentMethod off session though
The link that Snufkin_stripe shared with me is here: https://stripe.com/docs/payments/save-and-reuse and that takes you to a page that disusses the Checkout Session I referred to above.
You can also select "Custom payment flow" to switch off of Checkout.
In order to recenter on the problem though: where are you getting stuck? I'd really recommend hacking around with this stuff a bit to get a better idea of how these technologies interact. We tend to be most helpful when you've already created some sort of integraitona that gets you close to your end-goal
That makes sense.
It seems like using the Checkout Session would be a lot faster to build and easier to maintain than the custom payment flow though wouldn't you agree?
And they both lead to a Stripe::PaymentMethod that we can use off line correct?
Faster to build, but not as customizable. It's fully Stripe-hosted which means it requires a full redirect to complete payment. The custom flow uses the Payment Element and is largely better for people with specific use-cases and/or a desire to integrate with other Stripe products.
ok. To answer your question, I"m not really stuck, but rather more looking for the best path forward. Your recommendation to use the "custom payment flow" is the sort of direction I was looking for.
Thank you
Sure thing!
To check my understanding, once we have a SetupIntent that has its usage set to "off_session", then for our flow we don't need to use a PaymentIntent to use the PaymentMethod right? Instead we will use the Stripe::Treasury::OutboundPayment to use the PaymentMethod for our custom flow.
As far as I can tell, that is correct