#Linq2
1 messages · Page 1 of 1 (latest)
Hey there. What are you trying to achieve here? Why are you creating both a Charge and a Payment Intent?
I have onboarding Express connect accounts
Using Laravel, what I want to do, without adding any Items, Products to Stripe, is use my own products in our database, pass payment fees to our Main account and Pass the Remainder to the connect account..
Example on our site, an Item costs £10
the buyer pays £10 + 2% = £10.20
the Connect account pays 2% + 0.25% + 10p out of the £10.00
so £9.68 goes the the connect account and the remaining 0.52p goes to the Main Stripe account to cover payout fees ect..
at the moment, it is paying all into the main account, but then trowing the following error:
You cannot confirm this PaymentIntent because it's missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method.
Well, yep. You need to pass a payment method to facilitate the payment
I can see you're passing a token when creating the Charge, but that's completely redundant code (you shouldn't use Charges)
Have you looked at destination charges? https://stripe.com/docs/connect/destination-charges
You should be able to get the flow of funds you want:
right I have implemented the following:
$payment_intent = \Stripe\PaymentIntent::create([
'amount' => 1020,
'currency' => 'gbp',
'application_fee_amount' => 0052,
'transfer_data' => [
'destination' => 'connect_account_details',
],
]);
has gone through without errors, but has put the full amount in the main account and marked it as incomplete
{
"id": "pi_3Ksld.........",
"object": "payment_intent",
"last_payment_error": null,
"livemode": false,
"next_action": null,
"status": "requires_payment_method",
"amount": 1020,
"amount_capturable": 0,
"amount_details": {
"tip": {
"amount": null
}
},
"amount_received": 0,
"application": null,
"application_fee_amount": 42,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_3KsldI....."
},
"client_secret": "pi_3Ks......",
"confirmation_method": "automatic",
"created": 1650968916,
"currency": "gbp",
"customer": null,
"description": null,
"invoice": null,
"metadata": {
},
"on_behalf_of": null,
"payment_method": null,
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"transfer_data": {
"destination": "connected_account_id"
},
"transfer_group": null
}
what do I need to add & where
You need to collect payment data from the customer, and confirm the payment intent with Stripe.js: https://stripe.com/docs/connect/creating-a-payments-page?platform=web&ui=elements#collect-card-details
right so i pay the correct information back to the developer, they don't need the following:
$transfer = \Stripe\Transfer::create([
for the money to go in tobothaccounts.
Looks like you've set it up for destination charges, with the transfer_data[destination] and application_fee_amount parameters
So generally a separate transfer wouldn't be needed, no!
ok I currently have the following:
$customer = \Stripe\Customer::create([
'name' => Auth::user()->name . ' '. Auth::user()->surname,
'email' => Auth::user()->email,
'description' => Auth::user()->name .' '. Auth::user()->surname,
]);
to create the customer, I will work through that to display everything, just wanted to make sure i was passing a customer object.
$payment_intent = \Stripe\PaymentIntent::create([
'amount' => 1020,
'currency' => 'gbp',
'on_behalf_of' => 'acct_.......', // Not sure if this required???
'transfer_data' => [
'amount' => 968,
'destination' => 'acct_.....',
],
'payment_method_data' =>[
'type' => 'card',
'card'=> [
'instalments' => null,
'mandate_options' => null,
'network' => null
'token' => $request->stripeToken,
]
],
'customer' => $customer->id,
// Adds customer details to Payment
]);
does that look right or am I still missing anything?
transferdate is actually transfer_data
Important to understand the differences between application_fee_amount and transfer_data[amount]: https://stripe.com/docs/connect/destination-charges#application-fee
Equally, on_behalf_of will change the MOR to the connected account: https://stripe.com/docs/payments/connected-accounts
yes ours should follow the second flow, as we take the fees, to cover payout ect...
that is correct, transfer_data[amount] so what is left in the connect account they can draw that down without in-curing further fees?
Yes, there's no fess imposed on payouts (to external accounts)
What our end goal is, the fees go in to the main account, to cover ALL stripe fees, then what is left in the Connected account is what that user can drawdown to their bank without incurring further fees, as I understand it, I need to use transfer_data[amount] method and remove from payment_intent 'on_behalf_of' => '',
thank way we get the fees, the connect account gets the remainder without further fees
Yep, that's how it works! This is easy enough for you to test, too
That way you can try out scenarios and see how the funds flow between accounts
right, do you have access to my test account.
Yep, I can
could you look and explain why the payments are marking as incomplete, even though I'm using the test card
Can you share a Payment Intent ID pi_xxx
pi_3KsmRiBSmYxaSWkP0eri6ltP
you have to confirm the PaymentIntent, just creating it doesn't complete or attempt the payment. You can see in the API the status is requires_confirmation and the state machine is documented at https://stripe.com/docs/payments/intents
so one option is to pass confirm=>true on creation (https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm) . But usually you do this all client side using stripe.js