#Slush

1 messages · Page 1 of 1 (latest)

vivid valeBOT
gaunt dagger
#

Hi there

gleaming minnow
#

Hey so this is actually going to change a lot of our business logic. So I would like to give you a quick rundown of what were looking for and what is the easiest approach you would take in this situation.

#

So we are a website that allows people to sell things on it. But we would like to take a transaction fee for every purchase on our website. So lets say someone sells a product on our website for example a pair of sunglasses. It costs $50. The website takes a transaction fee of $5. I need the $50 to go to the seller and the $5 to go to my account. What is the easiest way to go about this? Also what would the customer have to do to create their account to accept payments? I would like to make this as easy and painless as possible for the person who is selling the items on my site.

#

I have a database so I can store any stripe ID's associated with the seller account etc...

gaunt dagger
#

So you want to charge a customer $50 but then take a $5 fee and also transfer the $50 to the seller?

#

Or you plan on charging $55?

gleaming minnow
#

It would be in total $55.

#

$55 of it would be charged to the customer - $50 of it would go to the seller - $5 of it would go to us (the website owner)

gaunt dagger
#

Gotcha, then you don't actually need Separate Charges & Transfers as noted above.

gleaming minnow
#

What would be the easiest way to alter that code to allow this to happen ^^

gaunt dagger
#

You can simply do this with Destination Charges

#

Which are simpler

#

So you want to onboard Connected Accounts

#

Express is the easiest and what I would recommend here

#

Then you use transfer_data to determine how much you want to transfer and you keep the rest as your fee

gleaming minnow
#

Reading over this documentation now

#

Still a bit confused.

#

TransferData = new PaymentIntentTransferDataOptions
{
Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}",
},

#

So I would add that into my code

#

Or I would add this into my code:

#

ApplicationFeeAmount = 123,
TransferData = new PaymentIntentTransferDataOptions
{
Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}",
},

#

And then I set the Destination to the sellers account

#

And would the application fee amount go right to my account automatically?

gaunt dagger
#

Yep you set the destination to the sellers account. You can either take an app fee (yes it goes right to your account) or you use transfer_data.amount to specify how much to transfer and then the rest remains in your platform account

gleaming minnow
#

But if I use the ApplicationFeeAmount variable instead it will send that to me?

#

And the "Amount" Variable will be sent to that Destination Variable?

gaunt dagger
#

Yes that's correct

gleaming minnow
#

So the ApplicationFeeAmount does that subtract it from the "Amount" or is that added onto the Amount?

#

So if I set the amount to 2000 ($20)

#

And the application fee to 500 ($5)

#

Will the customer be charged $25 or $20

#

Also how do I get their CONNECTED_STRIPE_ACCOUNT_ID do I need to have them go to stripe.com and create an account and input the ID? What's the easiest way for my customer to input that into my website?

modest mountain
#

Hi there. Taking over for bismarck as they have to step out. The amount is always what the customer will be charged. Application fee is taken out of that. I recommend trying this all out in test mode, so you can get a feel for how everything happend.

#

For CONNECTED_STRIPE_ACCOUNT_ID, do they already have a Stripe connect account?

gleaming minnow
#

Not sure what that is.

#

Lets assume they have nothing related to stripe.

#

What is the easiest way for me to implement into my website so I can get theit stripe account id

#

their*

#

Do I put a text box somewhere saying "Go to stripe.com and register and then send me your stripe account ID"

#

Or is there a better way to do that?

modest mountain
#

Once you've weighed the pros and cons of account type and you've chosen, you can click the account type you selected in that left hand navigation menu in the docs and read about how to onboard customers to that account type

gleaming minnow
#

Is it a pain to implement into my site?

#

Or is it simple?

#

It seems like express is what I would want to be using.

modest mountain
#

Stripe-hosted onboarding makes the onboarding and verification process relatively simple

#

When you deal with creating Stripe accounts for your customers and having to verify their identity, it can get complex, but Stripe-hosted onboarding (that you can use with Express accounts) makes things simple

gleaming minnow
#

Yeah I am going to use destination charges

#

Just trying to figure out how the express accounts work.

gleaming minnow
#

IS there any examples of this already implemented so I can see the code behind it and how it works?

#

For .NET

modest mountain
#

Which piece do you need to see an example for? Our docs should have code snippets for the relevant pieces

#

You can select .NET in each snippet

gleaming minnow
#

When I am looking at the express demo, I am seeing that their is a frontend to it collecting all the information and the backend handling it.

#

But on the document you sent me I am only seeing the backend code for it.

#

Im still a bit confused on how the express accounts work. Does it redirect them to a stripe page to create the account? Or do they actually put in all their business information and account information on my website?

modest mountain
#

You would create the account with an api call on your server and redirect the customer to a stripe-hosted account link to collect their info. That's all covered in the first link above

#

I really recommend reading through it first and then following up if you have any questions

gleaming minnow
#

Hey so I just read through it all and am starting to understand it.

#

The only question I have is on this page:

#

What is the difference between step 2 and step 3?

#

It seems like I only need step 3 to grab the link that I am going to redirect the client to right?

modest mountain
#

Step 2 is to create the actual account object. Step 3 is to generate a link that you can redirect the customer to. Then, Step 4 is to actually just redirect them

gleaming minnow
#

In step 3 where is it getting this from: Account = "acct_1032D82eZvKYlo2C"

modest mountain
gleaming minnow
#

So let me get this straight, I do step 2 and it will create a temporary stripe account id. Then instantly after that I do step 3 and input the Account = variable to be what was generated in step 2 (as well as set the refresh and return urls)

modest mountain
#

It's not temporary. It will create a Stripe Account object that will persist. It just won't be in a verified status. In order to verify and make the account active, the customer will have to complete their information at the account link. But yeah, you need to pass the account id of the object created in step 2 to the account link creation request in step 3

gleaming minnow
#

Ahhh!! Okay I understand.

#

So tell me if this sounds right to you:

  1. Create a button on my website saying "Create Stripe Express Account"
  2. Once that button is clicked I create an express account and store their account ID on my database and I also create an account link and instantly redirect them to the account link created by step 3.
  3. Check to see if their account was successfully verified by stripe after the redirect?
  4. If it was verified set a flag on their account that it was verified and their account is ready to accept payments, if they didn't complete the process keep that flag as unverified.
tired mesa
#

Hi there, sorry for the delay! Just catching up

gleaming minnow
#

No worries

#

@tired mesa You still there?

tired mesa
#

Yep, still here! Just taking me a bit longer to catch up

#

For step 4, yes, you can track this on your end. Then, instead of regularly retrieving the account details to confirm whether charges have been enabled, you can use webhooks to listen for account.updated events: https://stripe.com/docs/connect/webhooks

gleaming minnow
#

Yes I have a webhook already setup.

#

Also in step 2, how do I get the account ID from the code after the account was created?

tired mesa
#

Your server side code should create the Stripe account. Stripe will respond with the full account object, from which you can grab the account ID.

gleaming minnow
#

What object do I grab that from?

#

Is it like service.accountID?

tired mesa
gleaming minnow
#

So I am doing this

#

When debugging it the service element has no ID on it

somber venture
#

Hi there, stepping in as roadrunner is away. Please give me some time to catch up here.

gleaming minnow
#

I am trying to get the account id from step 2 so I can use it in step 3

somber venture
#

Your code should look something like this:

// ...
Account account = service.Create(options);
// ...
var options = new AccountLinkCreateOptions
{
Account = account.Id,

gleaming minnow
#

Awesome thank you.

#

Can you explain to me the point of the account creation to get the account ID?

#

Why would I even bother storing that account id until I know they have verified it? As in, dont store the account ID if they create a account and dont verify it. This way if they come back again and do verify it, itll be a whole new account id?

somber venture
#

Can you clarify this a bit? What do you mean by 'don't verify' it?

gleaming minnow
#

For example: I have a button that says "Create Stripe Express Account"

#

They click it, on the backend it generates them an account ID and redirects them to the express creation page. They decide they dont want to create the stripe express account right now and want to do it later. I NEVER store that account ID and they navigate off of the page. A few days later they come back and decide to create the express account. Instead of storing that account ID they attempted to do it with a few days ago, cant I just create them a whole new account ID and not store their account ID in my database until they have completed the verification to accept payments?

somber venture
#

That is not advisable as you'd have so many abandoned account ids. Instead, you'd use the account id that you have already created.

gleaming minnow
#

Gotcha, understood.

#

Also I was able to create the account link and redirect the user to the accountlink page

#

But

#

Its not triggering my webhook

#

How would you suggest verifying to see if that account ID is ready for payments?

#

I have a webhook that I use for my paymentintents which works fine, but I saw no activity on it when doing the account onboarding

somber venture
gleaming minnow
#

Yeah but I would need to wait for it to hit my webhook before I check to see if it was validated or is there a better way?

somber venture
#

You could run a crob job on your to check the account requirements.

gleaming minnow
#

Hmm okay ill figure something out.

#

So how exactly do I use the account object to check if they are ready to accept payments?

#

accounts.past_due needs to contain nothing?

#

or is it account.charges_enabled = true?

somber venture
#

Exactly that!

gleaming minnow
#

And the way they enable charges is by basically linking their bank account up right?

#

And that flag would then be true?

somber venture
gleaming minnow
#

So lets say the charges are not enabled and a payment intent tries to go to their account, will it fail?

somber venture
gleaming minnow
#

Along with that lets say their charges are not enabled and I want them to enable it, do I just re-link them to the accountlinkcreateoptions onboarding link?

#

Then they can finish up their verification there?

somber venture
#

With Express Connect, they will be able to login to their account to resolve this.