#mike_06860

1 messages · Page 1 of 1 (latest)

plain helmBOT
maiden wolf
#

With custom accounts you shouldn't do direct charges

#

That flow is meant for standard accounts

compact stump
#

how can I generate a client secret so I can add the bank or debit card for payout on the custom account though?

#

I was trying to use the Stripe Elements component so I don't have to collect bank/card info in my app

maiden wolf
#

Oh you should do financial connections for that

compact stump
#

I was using this code to try and generate a secret (note that accountId would be the connect account ID):

 public async Task<string> InitiatePayment(string accountId)
        {
            var options = new SetupIntentCreateOptions()
            {
                AutomaticPaymentMethods = new SetupIntentAutomaticPaymentMethodsOptions() { Enabled = false },
                PaymentMethodTypes = new List<string>() { "card", "us_bank_account" }
            };


            var svc = new SetupIntentService();
            var intent = await svc.CreateAsync(options, new RequestOptions() { StripeAccount=accountId}).ConfigureAwait(false);

            return intent.ClientSecret;
        }

and this is the important part of the client-side code:

 savePaymentMethod(): void {
    const name = this.stripeTest.get('name').value;
    const elements = this.paymentElement.elements;
    this.stripeService
      .confirmSetup({ elements, confirmParams: { return_url: `${environment.baseUrl}/` } })
      .subscribe((result: any) => {
        console.log(result);
      });
  }
maiden wolf
#

You shouldn't do that though

#

See the above link

compact stump
#

got it, I need to use the "FlowDirection" outbound on the SetupIntentCreateOptions, then use the "collectBankAccountForSetup" method instead of the confirmSetup on the js side?

maiden wolf
#

Yeah

#

Because you shouldn't use payment element

#

You need to collect details through financial connections

compact stump
#

does the payout method get saved on the account, or do they have to it every time they request a payout?

maiden wolf
#

If you follow the flow at the above link it'll be saved