#DavidS-treasury

1 messages ยท Page 1 of 1 (latest)

thorn lion
#

When you say you're 'on treasury', what do you mean? There isn't anything related to treasury in your questions

amber silo
#

Hi. I mean our platform has been approved to use Treasury. I was just trying to set the context for my question. My ultimate goal is to create a Payment Method that can be used in a Treasury Outbound Transfer flow. Hope that makes sense!

thorn lion
#

Ahhh, okay. Thanks. Just making sure there wasn't a mixup of verbiage

amber silo
#

Stripe::Treasury::OutboundTransfer.create({
financial_account: 'fa_1LIGeaQMuGbmhFUFhN0apI1J',
amount: 101,
currency: 'usd',
statement_descriptor: 'Backyard Settlement - 20220707',
destination_payment_method: 'pm_1LIdD3KhuGLhTNZZffPOKePg',
destination_payment_method_options: {us_bank_account: {network: 'ach'}},
},
{
stripe_account: 'acct_1LIGdGQMuGbmhFUF',
})

#

โ˜๏ธ that's the request we are sending, which has the Connected account ID, Payment method ID, and Financial account ID.

#

I'll grab the request ID too - one second ๐Ÿ™‚

trail solstice
#

๐Ÿ‘‹ stepping in here as two-shoes needs to step away

amber silo
#

Hi!

#

Here is the request ID two-shoes was asking about: req_70bpRtLNx3xRyJ

trail solstice
#

Thanks!

#

Taking a look

amber silo
#

Thank ๐Ÿ™‚

trail solstice
#

I see, you are trying to use setup_intent_data.on_behalf_of

#

Yeah I don't htink that is going to work

amber silo
trail solstice
#

No you are fine. I'm not overly familiar with Treasury as it is one of our newer products. I'm getting caught up here

amber silo
#

Gotcha. ๐Ÿ™‚ Yeah, I've noticed some of the docs are still a bit of a work in progress, so I figured I'd reach out!

trail solstice
#

Okay

#

So I think what you are actually trying to do right now is an Outbound Payment

#

Outbound Transfers would be for PaymentMethods that are on the same account

#

So if you created the Checkout Session on the Connected Account, then you could use an Outbound Transfer

#

But since the PaymentMethod is on your platform, and you are across entities, I believe you want an Outbound Payment here.

#

Which are you intending to utilize?

amber silo
#

I believe I'm intending to use Outbound Transfer. This piece that is failing is the final step in a larger flow for us which goes like this:

  • Platform (we) have money in our Platform Financial Account
  • We use an Outbound Payment to move money from our Financial Account to the Connected Account's Financial Account (that is working great!)
  • Later, the Connected Account wants to transfer money out of their Financial Account to an external bank account which they own using an Outbound Transfer
#

I'm pretty sure Outbound Transfer is what we want for the last step. The issue is that it's failing because the Payment Method says it's not connected to the Connected Account. But the Setup Intent that created the Payment Method says it actually IS connected to the correct Connected Account. That's where I'm stumped. ๐Ÿ˜›

trail solstice
#

Thanks that helps

#

" But the Setup Intent that created the Payment Method says it actually IS connected to the correct Connected Account. That's where I'm stumped."

#

This isn't true

#

The PaymentMethod is on the platform

#

Since that is where the Checkout Session was created

#

You would need to pass the Stripe Account header and create the PaymentMethod on the Connected Account

#

OR you can clone the PaymentMethod from your Platform to the Connected Account

#

Then you should be able to create the outbound transfer successfully

amber silo
#

Okay, that sounds like a good approach. A couple of follow-up questions:
(1) How can you tell the Payment Method is on the platform? I mean, what field in the Payment Method object indicates that?
(2) Is there a way for me to pass the Stripe Account header in to the call where I am creating the Checkout Session (which in turn is creating the Setup Intent)?

trail solstice
#
  1. Mostly you would know based on how it is created and how you store your data. But that said, you can attempt to retrieve or list the PaymentMethod. If you can retrieve it on your platform (without passing the Connect Account header in the request), then it is on your platform.
amber silo
#

Thank you! Starting the Checkout Session in setup mode with the Stripe-Account header set to the Connected Account's ID created a Payment Method that is on the Connected Account instead of the platform. ๐Ÿ™‚

There is a new issue now. The Payment Method isn't attached to the Connected Account, so Outbound Transfer is still failing.

  • Newly created payment method under the Connected Account: pm_1LJ40MQMuGbmhFUFXgmFdpu9
  • New request that errored out: req_cBYYGSuGZf5Wsm
#

Is there a way to attach this payment method to the Connected Account, or better yet, is there a way to initiate the Checkout Session in setup mode so that the attachment happens automatically? Sorry, I don't expect you to teach me how to use Stripe API ๐Ÿ™‚ I've just been stuck on this for a while and tried initiating the Checkout Session in various ways that haven't worked. Thanks!

trail solstice
#

No need to apologize

#

These are good questions

#

Looking

amber silo
#

Thanks!!

trail solstice
#

Okay so yeah this is where I was confused by your flow before. When you want to set up a PaymentMethod as a financial account for outbound transfers on your Connected Account then you have to use a SetupIntent and pass attach_to_self. I have never seen the Checkout flow before... but it might work. Can you try to create a new SetupIntent and then pass attach_to_self and the PaymentMethod ID?

#

By never seen the Checkout flow... I mean never seen someone try to use Checkout to collect the PaymentMethod and want to use it as a financial account

amber silo
#

Yep, I can try that. I assume it will work! My concern is that I will have then lost the context of the old Setup Intent, which includes the ID of a Mandate. The Checkout flow is really nice, because it handles the Mandate, instant verification, etc. without having to go down the Stripe Elements (js) route. Is it possible to transfer the old Mandate acceptance over to the new Setup Intent that I'll be creating in the method you proposed?

#

I have to step away for a family thing, but I'll check back in tonight or first thing in the morning. Thank you so much for helping me make progress on this!