Taking fee and payment reservation Stripe - stripe-payments

Pretty new to Stripe, we're building an online marketplace. Each user can buy assets from any other user. We also take fees for each payment.
We go with connected accounts. Seller goes through the onboarding flow (create connected account, create account link etc), while buyer is registered as a customer of our platform on Stripe.
Now, whenever buyer makes a payment we create a payment intent to pay to us (amount + 20% fee via):
stripe.paymentIntents.create(params)
Then we create new payout to seller (amount) using source transaction from payment intent above:
await stripe.transfers.create({
amount: payment.amount * 100,
currency: payment.currency,
destination: seller.stripeAccountId,
source_transaction: sourceTransaction,
});
Is this the preferred and best way of handling this? In terms of time, we need first to wait for payment to settle to our bank account to be able to payout seller?
Is there any better way of doing this instead of manual payouts?
Is there a way to make direct transfer to connected account when user does payment?
I tried with payment intent, specifying connected account id in request, but API is complaining that customer id is on our platform but account id is specified, so it's not possible obviously.
Also, manual payouts would come handy to simulate payment escrow/deposit. When user create a request for some asset, we would immediately transfer certain amount to our account, like reserving that amount. And if the seller accepts the offer, we would do a payout. If seller rejects the offer, we would do payout to the buyer, giving him back his money.
Does this make sense?
Thanks in advance

You don't need Payout (yet) in your use case. You are doing Separate Charges and Transfers, and fund simply moves from your Account's balance to Connected Account's balance. It hasn't been out of your Connected Account's balance to your Connected Account's bank account yet, which is called "Payout".
In another word, Payout is separated process than Charges and Transfers. Charges and Transfers can happen immediately, and Payouts normally happen later on a daily basis or manually.
Find more explanation on Connect Balance.
There is also Destination Charge which is simpler than Separate Charges and Transfers. I recommend Destination Charge unless you have specific reason to use Separate Charges and Transfers, ie. you need to transfer to multiple Connected Accounts on one payment.

Related

How to make custom payment to a customer

I am looking for a way to make payment to a customer like a business do.
for eg. a business will ask you to fill the form with bank name, acoount number IFSC code etc.
so customer can receive a payment.
I have user who is having a digital wallet with some amount.
I want to transfer the amount to user's provided bank account on the request.
I saw stripe documentation but I am not sure if stripe support custom payment.
Stripe provides refund as per below method where I have to provide charge id string
and because of charge id stripe will refund only the amount which was charged earlier and this is linked to particular charge only.
const stripe = require('stripe')('your_stripe_key');
const refund = await stripe.refunds.create({
charge: 'charge_id_string',
amount: 100,
});
I want to make custom payment/refund so I can transfer users wallet available balance to bank account.
Any suggestion will be appreciated.
I don't think you should use Refund because you can only create a refund based on an existing charge.
You should probably look at Transfer, which allows you to send funds from your Stripe account to a connected account. In your use case, you should create a connected account for your customer so that you can transfer refunds to your customer and eventually payout to their bank account.
Visit here to learn more about Stripe Connect.

Stripe connect. Transferring payment to a connected account charges fees on the main account

I have account B connected to account A (both are standard accounts).
What I'm trying to do: accept a payment through A and send the full amount to B, which then gets charged the corresponding Stripe fees.
What I did: Created a webhook that fires on charge.succeeded and does a transfer to the connected account (B), using the charge id in source_transaction (As per https://stripe.com/docs/connect/charges-transfers)
What happens: The connected account (B) seems to get the full payment, without fees, the fees seem to be charged to account A
Could it be that it's because in test mode? The idea is to use account A to send/split a payment between other accounts (1 or more), as in a marketplace.
You'd usually simply use a Direct Charge — https://stripe.com/docs/connect/direct-charges. That's exactly how you platform A makes an API call on connected account B to facilitate a payment, and the fees are paid by B.
The link you posted is for a more advanced integration where the platform processes the payment(and therefore pays the Stripe processing fees) and then transfers money to a connected account(like a company like Lyft charging a rider, then transferring some of the money to the driver).
The idea is to use account A to send/split a payment between other accounts (1 or more), as in a marketplace
You can't use Direct Charges to split a single payment between multiple connected accounts such that they all pay the fees separately. The most you could do is make multiple separate charges — like take the card from the customer, clone it to each individual account involved, and do N separate charges (https://stripe.com/docs/connect/cloning-customers-across-accounts) on each of them. I wouldn't really recommend that since it likely leads to more declines and disputes(it's weird to have a shopping cart with 5 items from 5 sellers and get charged by the actual 5 sellers, I would expect to be charged once by the company that runs the marketplace).
If you really need to do this type of business model where you take a single payment and then split between multiple sellers then you do need to take the approach you linked to, and have the platform pay the fees, that's the only way, it's specifically discussed at https://stripe.com/docs/connect/charges#types in detail.

Stripe payment and bank account

Is it possible with Stripe to perform a test transaction to ensure that an account is funded?
I would like to :
take the Credit Card ID at the moment of the booking (but no payment at that moment)
make the customer pay AFTER the service has been done
What you likely want is to place a hold on the card for the given amount, and then capture the funds later after the service has completed. When placing a hold the given amount is authorized and guaranteed by the cardholder's bank. You'll often see these types of transactions show up on your online bank statement when renting a car or when checking-in to a hotel room. When processing your payment with Stripe you would set the capture_method on the PaymentIntent to manual which tells Stripe to only authorize the given amount. Then, once the service is rendered you would capture the funds. The following guide covers the approach in detail:
https://stripe.com/docs/payments/capture-later

Stripe: Accessing a payout from a charge

I am trying to access a payout object (https://stripe.com/docs/api#payouts) from a charge object (https://stripe.com/docs/api#charges). The problem is that I do not know what ID to use for the payout. I tried using the transfer ID from payouts but I get the error:
No such payout: tr_1Bxxxxxxxxxx
I also know that the ID of the payout is in the format po_xxxxxxxxxxxxxxx but I can't find any from the charge, the transfer and the balanced_transaction. How is the payout related to the charge?
There's not a direct way to get the Payout from a Charge object ch_xxxyyyzzz, but if your account is setup to make automatic payouts, you can get a list of charges and any other balance transactions (refunds, adjustments, etc) that make up a specific payout object.
https://stripe.com/docs/api#balance_history-payout
stripe.balance.listTransactions({payout:"po_xxxyyyyyyzzz",limit: 100 },
function(err, transactions) {
// asynchronously called
});
Payouts and Transfers are two separate types of Objects. A Payout always refers to when moving funds from your balance to your bank account. A Transfer refers to funds moving between Stripe accounts, typically in the context of Stripe's Connect.
https://stripe.com/docs/transfer-payout-split

How to charge fee on stripe api using c#

I am using Stripe Api to create a customer and then charge it.
What i wanted is to charge my customer whenever it create a sell or charge.
I want 7% of total amount to be credited in my stripe account.
I have tried the Application fee when creating charge with customer Id , but it requires destination to be passed, which requires merchant ID, which always throws error that "No Merchant Found with provided ID".
How the documentation say, there are two way to create a charge: Charging directly and Charging through the platform.
Which of these are you using? (Can I suppose the second since you were talking about the "destination"? ).
They both require connected accounts to do charge, ect.
In the case of Charging through the platform, you need that the account is connected to the platform to be visible from the "destination" (Connecting_Account_Documentation).
If it is not so, explains better the situation in which you find.
application_fee:
A fee in cents that will be applied to the charge and transferred to the application owner's Stripe account. To use an application fee, the request must be made on behalf of another account, using the Stripe-Account header, an OAuth key, or the destination parameter. For more information, see the application fees documentation.
destination:
An account to make the charge on behalf of. If specified, the charge will be attributed to the destination account for tax reporting, and the funds from the charge will be transferred to the destination account. The ID of the resulting transfer will be returned in the transfer field of the response. See the documentation for details.

Resources