#Nasir

1 messages · Page 1 of 1 (latest)

hexed cloakBOT
remote kettle
#

hello! what's your question?

slate salmon
#

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 ?

remote kettle
#

yes, i'm here, so what have you tried and what isn't working?

slate salmon
#

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 )

remote kettle
#

where's your code for transferring the amount?

slate salmon
#

$transfer = \Stripe\Transfer::create([
"amount" => (0.50*100),
"currency" => $seller_bank_account->currency,
"destination" => $seller_account,
]);

#

Here I am transfering the amount to seller

remote kettle
#

can you share the relevant request id for that Transfer?

slate salmon
#

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

remote kettle
#

i'm looking for the Transfer id, that will start with tr_

slate salmon
#

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

remote kettle
#

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?

slate salmon
#

Yes I am multiplying with 100

remote kettle
#

the destination account also got CAD 5

slate salmon
#

You mean this
pi_3NIFqNCTsPbs06Wf0PRTfU7r

remote kettle
#

after deducting the Stripe fee

slate salmon
#

But I am not seeing transfer amount after the deduction

remote kettle
#

you're making an entirely separate Transfer API request here : tr_1MXRRfCTsPbs06WfvaWAZpnS

#

where are you expecting to see the transfer amount after the deduction?

slate salmon
#

On the Dashboard Pyaments -> All Transaction

#

As in the Testing I did this
pi_3NIDqzCTsPbs06Wf1bcJHg7Y

remote kettle
slate salmon
#

and transfer hardcoded amount to seller tr_1NIAG0CTsPbs06Wf2QKRTyTS

#

Can I add you to the project repository to have a look at the code

remote kettle
#

you mentioned that you expect to see the Transfer on the Dashboard - which is there if you open the link which i shared

slate salmon
#

Yes but the amount is not correct

#

the deduction was not made

remote kettle
#

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

slate salmon
#

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

remote kettle
#

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

slate salmon
#

@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

hexed cloakBOT
slate salmon
#

Hi @tough belfry

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.

slate salmon
#

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

tough belfry
#

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 ,

slate salmon
#

If you can guide me that will be great

slate salmon
tough belfry
#

what do you see happen instead?

slate salmon
#

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

tough belfry
slate salmon
#

Yes On the Test keys it's working

tough belfry
#

then did you check that in live mode,

#

your code is calculating and sending the correct amount parameter that you want?

slate salmon
#

Yes

#

pm_1NFiaBCTsPbs06WfwfDn7Eb2

tough belfry
#

that ID doesn't seem relevant or useful

slate salmon
#

For testing

#

test keys

tough belfry
#

have you looked at error logs at all?

slate salmon
#

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

tough belfry
#

it's against our terms to test in live mode

slate salmon
#

What Can I do , The test is working as expected

#

The issue is in the live mode

tough belfry
slate salmon
#

🥹

#

'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

tough belfry
slate salmon
#

$stripe->transfers->create([
'amount' => 1000,
'currency' => 'usd',
'source_transaction' =>$intent->latest_charge,
'destination' =>$seller_account,
]);
Like this

tough belfry
#

sure, you can try it out in test mode

slate salmon
#

👍

#

Awsome I can try it

#

Can i disturb you again if there is any issue , I really like your support and help

hexed cloakBOT
slate salmon
#

Thanks @last tendon I am testing the provided code

#

I will let you knwo