#BRData

1 messages ยท Page 1 of 1 (latest)

coarse saffronBOT
flat lichen
#

Hi ๐Ÿ‘‹ we no longer recommend leveraging OAuth flows that allow people with existing Stripe accounts to connect to your Platform, instead we recommend that you create an account for them (similar to how you do for Express) and provide them with an Account Link so they can provide any necessary onboarding information.

This process is covered in more detail here:
https://stripe.com/docs/connect/standard-accounts

Integrate with Standard accounts to get started using Connect right away, and let Stripe handle the majority of the user experience and user communication.

dawn wren
#

Okay then on a payment intent how do insure that the payment goes to the correct account id?

#

[HttpPost]
public ActionResult Create(PaymentIntentCreateRequest request)
{
var paymentIntentService = new PaymentIntentService();
var paymentIntent = paymentIntentService.Create(new PaymentIntentCreateOptions
{
Amount = CalculateOrderAmount(request.Items),
Currency = "usd",
AutomaticPaymentMethods = new PaymentIntentAutomaticPaymentMethodsOptions
{
Enabled = true,
},
});

  return Json(new { clientSecret = paymentIntent.ClientSecret });
}
#

Where do I include the account id that the money is sent to?

flat lichen
#

If you're using Standard Accounts then you should be using Direct Charges:
https://stripe.com/docs/connect/direct-charges

The code snippets in the above document will show you how to leverage the Stripe-Account header to make requests for your Connected Accounts:
https://stripe.com/docs/api/connected_accounts

With Connect, you can make charges directly on the connected account and take fees in the process.

dawn wren
#

Hmm

#

When using direct charges how do I go about changing my current setup https://stripe.com/docs/payments/quickstart which is there in .net

Learn how to embed a custom Stripe payment form in your website or application. Build a checkout form with Elements to complete a payment using various payment methods.

#

because right now my create method returns a json of the clientsecret - do I not need that anymore if I am using direct charges?

flat lichen
#

I'm not following. You still need the client secret. Did you run into problems when following the instructions from the document for creating Direct Charges? It walks through how to create a Payment Intent.

dawn wren
#

This is what I currently have now:

#

Is this all I need to do:

flat lichen
#

You will need to replace {{CONNECTED_STRIPE_ACCOUNT_ID}} with the ID of the Connected Account, at the very least to get the server-side code correct. What is your frontend approach for processing payments, the Payment Element?

dawn wren
#

Yes ofcourse I know that I am more talking about backend

#

My exact approach right now is from herE:

#

It is basically copy and pasted from there

flat lichen
#

Then yup. Are you encountering errors when trying to run that updated code?

dawn wren
#

No I havent ran it yet because I havent created a connected account (unless there is a test connected account ID I can use) but it doesnt make much sense to me how does adding these two lines "var requestOptions = new RequestOptions();
requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}";" change the payment intent?

#

It seems like Im not altering the payment intent at all by including those two lines of code

flat lichen
#

Did you want to alter the Payment Intent? Those lines change the Account that the intent is created in. Without those the intent would be created on your Platform account, which is not the correct process for Direct Charges, including those lines causes the intent to be created in your Connected Account instead.

dawn wren
#

Yes I want the payment intent to happen on the connected account.

#

Just seems like those two lines dont alter the payment intent to do that as its just altering the requestoptions object which doesnt seem to be used by the paymentintent object?

flat lichen
#

Oh, sorry, I didn't spot the discrepancy between the code you share and our sample code at first. Your code won't use the requestOptions as written, you run .Create before those are created and don't pass the options to that function.

Is this the snippet you're seeing in the docs that I linked?

dawn wren
#

Yes!

coarse saffronBOT
flat lichen
#

Then you will want to replace the Payment Intent creation code from the quick start (looks like lines 53-61) with the code from the Direct Charges doc.

dawn wren
#

Yes but what would I return?

flat lichen
#

The client secret

dawn wren
#

Do I need the service.Create line as well?

#

Along with that how do I get the client secret?

#

is it service.clientSecret?

gleaming depot
#

๐Ÿ‘‹ stepping in for my teammate! As toby mentioned, the major difference between the quickstart code and the direct charge for Connect code is adding the Stripe Account header when creating the PaymentIntent

dawn wren
#

That is what I currently have

#

is having the .Create method neccessary? Along with that how do I get the clientSecret?

gleaming depot
#

Looks like the direct charge code uses a variable for .Create while the quickstart guide does not. Really up to you how you want to handle

dawn wren
#

Thats fine if I just use .Create

#

But how would I go about returning the clientSecret?

gleaming depot
#

I think you can do something like:
var paymentIntent = service.Create(createOptions, requestOptions);
then obtain the client secret with paymentIntent.ClientSecret

#

I recommend trying this out

dawn wren
#

I think that worked!

#

How would you go about testing this if you dont have a connected stripe account ID as this is not in production yet

#

is there any test account id's I can use?

gleaming depot
#

You can create test connected accounts and go through "onboarding" using an account link

dawn wren
#

Hi, so I just created a stripe test account and got the test account account ID

#

and placed it in my code for testing purposes - but it says the test account is restricted and cant accept payments

gleaming depot
#

Right, exactly. You'll need to create an account link for that test account in order to go through onboarding (this is similar to onboarding that live connected accounts will need to go through before they can accept payments)

dawn wren
#

I did create an account link and it said "youre in test mode" and gave me a button to skip the form

#

Also im getting this error:

gleaming depot
#

Okay, let's take a step back.

#

After creating the account link, you should open that link in a new browser or incognito window. You might see some options to skip certain onboarding steps (or autofill them with test data) but you should make it to a final page that says something like "submit" or "complete". Did you make it to that step?

dawn wren
#

Should I skip this?

#

Or actually put in real information?

#

I would rather fill all of this out with test data, like it asks me for my phone number and I need to verify it and stuff but why would I need to do that in test mode

gleaming depot
#

You shouldn't skip this

dawn wren
#

Seems like that test phone number is not working

gleaming depot
#

ah, you can try your real phone number here

#

this will just be used for login/2fa I believe

dawn wren
#

Is there no way to do a test number?

#

Also more importantly do you have any idea why this is showing up?

#

Is that because the test account isnt verified yet?

gleaming depot
dawn wren
#

Also I put in my phone number

gleaming depot
dawn wren
#

and its now asking for this

#

I dont think this is how to test standard accounts

#

as the documentation says thats only for express and custom accounts

gleaming depot
#

This is good progress! Yes, this is how to onboard test standard accounts. You can use the 1901-01-01 date of birth, any first name, last name, and email address

#

For the address, you can use your real address or use address_full_match for line_1 and real values for city, state, and postal code

dawn wren
#

phone and social?

gleaming depot
#

I believe this is where you can use 000 000 0000 for phone and social (or 0000 if only four digits are needed)

dawn wren
#

The account owner needs to provide more information to Stripe to enable payments and payouts on this account.
INFORMATION NEEDED - DUE NOW
Bank account verification

#

why do I need bank account verification when i setup the stripe test bank

gleaming depot
#

Is this what you saw in the onboarding flow?

dawn wren
#

yes

#

and I put in the bank info

#

the test bank info

gleaming depot
#

That's odd, why would the external account in the screenshot above end in 9991 instead of 6789 if you used the test bank account?

dawn wren
#

did i use the wrong bank account number??

#

Crap... how can i go back and change that

gleaming depot
#

Since it's a standard account, you'll need to log in with the test email and password you set up during test onboarding

#

alternatively, you can create a new test standard connected account, create a new account link, and go through onboarding again. When you get to the payouts page, click on "use test account" to auto fill the details

dawn wren
#

Payments and payouts are paused while Stripe tries to verify recently provided details about this account.
INFORMATION PENDING VERIFICATION
SSN

#

i made a whole new account

#

and now its saying information pending SSN

gleaming depot
#

Okay. If you log into that standard account, do you see a banner at the top of your Dashboard prompting you to complete onboarding?