#Nasir
1 messages · Page 1 of 1 (latest)
hello! what's your question?
HI Alex
Thanks for the message
What i am trying to achieve is that when the buyer place and order during the checkout I want to create a charge (total order amount plus porcessing fee plus 5% commission )
And when the order is Delivered by the buyer I want to transfer funds to the Seller Connect account but deduct 5% amount from the total order amount
That's all
@remote kettle you there ?
yes, i'm here, so what have you tried and what isn't working?
I have tried the transfer method but it transfer the whole amount to the seller account (ignore the 5% deductions)
I will share the code
$key = \Stripe\Customer::create([
'description' => $description,'email'=>$email, 'name'=>$fullName
]);
$intent = \Stripe\PaymentIntent::create([
'amount' => ($finalAmount *100),
'currency' => $currency,
'customer' => $customerId,
'description' => $description
]);
currency cad
During the checkout i am calling this function (Laravel )
where's your code for transferring the amount?
$transfer = \Stripe\Transfer::create([
"amount" => (0.50*100),
"currency" => $seller_bank_account->currency,
"destination" => $seller_account,
]);
Here I am transfering the amount to seller
can you share the relevant request id for that Transfer?
I have hardcoded it but still the amount is different
On the Test Keys Everything Working as expected But when tried on Live Keys (nothing working as expected )
Sure let me
From the Buyer deducted $1.36
pm_1NIG8xCTsPbs06WfArWpMjDr
i'm looking for the Transfer id, that will start with tr_
The seller Got CA$1.02 but it should be $0.95
tr_1MXRRfCTsPbs06WfvaWAZpnS
Let's say this
this is an old entry
May be i am doing something worng i am not sure
you passed in amount=500 in your request : https://dashboard.stripe.com/logs/req_O1Py3xzn2Meo41. All API requests expect amounts to be provided in a currency’s smallest unit. For example, to charge 10 USD, provide an amount value of 1000 (that is, 1000 cents).
so that looks fine
what's the PaymentIntent id?
Yes I am multiplying with 100
the destination account also got CAD 5
You mean this
pi_3NIFqNCTsPbs06Wf0PRTfU7r
the Net $1.02 on this page : https://dashboard.stripe.com/payments/pi_3NIFqNCTsPbs06Wf0PRTfU7r which you see, is what you received
after deducting the Stripe fee
But I am not seeing transfer amount after the deduction
you're making an entirely separate Transfer API request here : tr_1MXRRfCTsPbs06WfvaWAZpnS
where are you expecting to see the transfer amount after the deduction?
On the Dashboard Pyaments -> All Transaction
As in the Testing I did this
pi_3NIDqzCTsPbs06Wf1bcJHg7Y
i can see them there : https://dashboard.stripe.com/balance?type=transfer
and transfer hardcoded amount to seller tr_1NIAG0CTsPbs06Wf2QKRTyTS
Can I add you to the project repository to have a look at the code
you mentioned that you expect to see the Transfer on the Dashboard - which is there if you open the link which i shared
where are you expecting the deduction to be shown?
it would help if you specify where you expect to see it, what you expect to see, and what you're seeing instead
No I mean if the transfer is done let say the total order amount $1 and after deduction of 5% i want to transfer 0.95 to the seller , And 0.95 should be shown on the dashboard as well right
so where on the Dashboard are you expecting to see 0.95?
there are many Dashboard pages, if you don't specify where exactly you're expecting to see 0.95, it's very difficult for us to help
please provide a screenshot and indicate where you're expecting to see 0.95
@remote kettle showing on the dashboard is not an issue my issue is when i send a transfer request it did'nt deduct the commission from the amount
Hi @tough belfry
if you do a separate transfer to just "transfer less than the original charge", that is not shown in the "collected fee" part of the Dashboard , if that's what you're asking. Only using application_fee_amount directly on a PaymentIntent/Charge will show up that way.
I am not concerned about to show on the dashboard , I am concerned about How Can i deduct amount from the seller before transferring the amount to his account
$transfer = \Stripe\Transfer::create([
"amount" => (0.50*100) - 5% commission ,
"currency" => $seller_bank_account->currency,
"destination" => $seller_account,
]);
What I am doing is Seller post the product on my platform , the buyer will buy the product ( I am charging the buyer 5% commission ) And when the order is delivered to the buyer bu the seller i want to send order amount - 5% commission to the seller account. That's All
How Can i deduct amount from the seller before transferring the amount to his account
sounds like you are already doing that , correct? Isn't that what this is?
(0.50*100) - 5% commission ,
If you can guide me that will be great
Yes But it's working on the test keys , But on the Live keys it's not deducting the amount
what do you see happen instead?
It send the whole amount to the seller and ignore the deduction ( Only processing fee is not included in the transfer)
Can you guide me to the process or the steps that i can follow to fulfill my requirments from the scratch
did you check that your code is calculating and sending the correct amount parameter that you want?
Yes On the Test keys it's working
then did you check that in live mode,
your code is calculating and sending the correct amount parameter that you want?
that ID doesn't seem relevant or useful
have you looked at error logs at all?
for example, have you seen this error? https://dashboard.stripe.com/logs/req_NFeJsrkBfo26ib is that what you're talking about? does your code try/catch and log exceptions from calling the API?
Yes I was testing last night , And insufficent funds SO i topup with $30 , but still waiting for the amount to be available so that I can Start Test again
On live keys
it's against our terms to test in live mode
in any case, make sure you read these two links
https://stripe.com/docs/connect/charges-transfers#transfer-availability
https://stackoverflow.com/questions/55686949/why-i-am-getting-insufficient-funds-when-trying-stripe-transfers-even-though-i/55687932#55687932
and think about using source_transaction so that you don't get this error about insuffecient balance so much. Ask if you have questions about that parameter.
🥹
'source_transaction' => '{{CHARGE_ID}}',
'destination' => '{{CONNECTED_ACCOUNT_ID}}',
$intent = \Stripe\PaymentIntent::create([
'amount' => ($finalAmount *100),
'currency' => $currency,
'customer' => $customerId,
'description' => $description
]);
The method I have implemented there is no charge_id
HOw can i get the charge id from the intent
@tough belfry are you there please
you use $intent->latest_charge once the PaymentIntent is complete, that's the Charge ID to use. https://stripe.com/docs/api/payment_intents/object?lang=node#payment_intent_object-latest_charge
$stripe->transfers->create([
'amount' => 1000,
'currency' => 'usd',
'source_transaction' =>$intent->latest_charge,
'destination' =>$seller_account,
]);
Like this
sure, you can try it out in test mode
👍
Awsome I can try it
Can i disturb you again if there is any issue , I really like your support and help