#GiovanniV-treasury-outboundpayment

1 messages · Page 1 of 1 (latest)

fallen gulch
#

Are you 100% sure that customer has a us_bank_account payment method?

shy salmon
#

yes it does. question does the bank account needs to be validated in order to be shown?

fallen gulch
#

I don't believe so - but can you share a Customer ID so I can check?

shy salmon
#

cus_M86ivDtOp4sY46

fallen gulch
#

That customer doesn't have any attached Payment Methods that I see

shy salmon
#

the outbound payment creation does work, but when I go back to list the payment methods I don't see the payment method that was created, which is just surprising. I was hoping we'd have a list to reflect back on to send future ACH/wires.

fallen gulch
#

Can you show me the request that's creating the Payment Method that you expect to be attached?

shy salmon
#

customer = Stripe::Customer.create(
{description: @payee.description},
{stripe_account: current_user.connected_account_id},
)

  result = Stripe::SetupIntent.create(
    {
      customer: customer.id,
      flow_directions: ['outbound'],
      payment_method_types: ['us_bank_account'],
      payment_method_data: {
        type: 'us_bank_account',
        us_bank_account: {
          routing_number: @payee.routing_number,
          account_number: @payee.account_number,
          account_holder_type: @payee.account_holder_type,
        },
        billing_details: {name: @payee.billing_details_name},
      },
    },
    {stripe_account: current_user.connected_account_id}
  )

  puts result

  @payment_method_id = result.payment_method

  payment_result = Stripe::Treasury::OutboundPayment.create({
    financial_account: 'fa_****************', # TODO contextualize this
    amount: 100,
    currency: 'usd',
    customer: customer.id,
    destination_payment_method: @payment_method_id,
    description: 'OutboundPayment to a 3rd party',
  }, {stripe_account: current_user.connected_account_id})

  puts payment_result
fallen gulch
#

What is the status of the Setup Intent after created it?

vague flicker
#

yeah you forgot to confirm the SetupIntent here

#

which doc are you following?

shy salmon
#

requires_confirmation

vague flicker
#

that's your problem! Which doc are you following?

shy salmon
#

the issue is I cannot find the bank account which was recently added

vague flicker
#

you're going too fast

#

you are missing the confirm: true parameter when you create the SetupIntent. Until you confirm, there's no attached PaymentMethod you can use

#

but you'll need to do micro-deposits verification(s) too in that case

shy salmon
#

that makes sense

vague flicker
#

I also am quite confused overall about your code and why you create a Customer

#

That's not the canonical flow and that's not what the docs you shared do as far as I can tell

#

Are you trying to pay out to that person's bank account or to someone else's? Treasury has many different fund flows and being crisp about what you are trying to do exactly is important here

#

GiovanniV-treasury-outboundpayment

shy salmon
#

absolutely I'm trying to build the proper flow right now testing different methods. I think I got it from here ,now that I understand the confirmation confirm: true needs to be required regardless of what the steps we will will follow it will be fine thank you very much

vague flicker
#

gotcha, we're happy to help you further if you can outline which exact flow of funds you're after

shy salmon
#

I appreciate it have a great day

shy salmon
#

Is there anyway to get all payment methods without filtering by customer?

#

I basically want to get a list of all the places we can wire/ACH to.

scenic sluice
#

Does that get you oriented in the right direction?

shy salmon
#

yes thanks

shy salmon
#

1 more question can I get a list of all payment methods of type us_bank_account for a given connected account without regard to the customer.?

scenic sluice
#

I'm not sure I understand. Do you want the payment methods associated with end-customers? Or financial accounts associated with connected accounts? Like, which object do you want from the connected account?

shy salmon
#

is like a report list giving me the list of all payments methods type X for a connected account without regard to the customer Id so a list of all

#

so a way to extract a list of all available payment methods type anything that I'm looking for from one of a connected account this is a report that I need on a platform level

#

with the above giving solution you send me I can find any payment method but I need to state a customer ID in order to look at the payment method for that customer

#

we just need a list with all payment methods related to a particular connected account on a list

#

its coming back empty if I leave our customer field blank

scenic sluice
#

Ah! Okay. I think you can pass in the Stripe account header to make the retrieve request on behalf of the connected account, using its account ID. That may give back all the financial accounts related to the connected account. Have you tried that?

shy salmon
#

no let me try

#

I get a empty list

#

Despite that connected account having a payment method

scenic sluice
#

I see. This product is still fairly new, so I don't have a good way to test this and our docs don't seem to indicate that it's possible to delineate financial accounts by connect account, so I assume that it isn't possible via a simple list all API call

#

Apologies if that was a red herring, but it was the best resolution I could come up with