Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

connect - Stripe is charging only 1% of the amount - test mode

I am implementing Stripe connect to charge a customer and then transfer commission to another associated account but I am stuck at the first step.

I have successfully taken card details of the customer and using stripe.js, I have tokenized it and then exchanged that token for a customer id which I saved in my DB.

Now for charging I am using:

$charge = StripeCharge::create([
                "amount" => 774,
                "currency" => "usd",
                "customer" => $customerId,
                "transfer_group" => $uniqueTransferString
            ]);

Now that actually makes payment of $7.74 instead of $774.00 and I have no idea why. Of course I am using everything in test mode.

The card I used to create the customer at the first place was: 4242 4242 4242 4242

I have tried to give charge amount as: 1000, 774.00 etc but every time it only charges 1% of the given amount.

I have searched but couldn't find help anywhere as if why is this happening.

Please help. Any push in the right direction is appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Stripe always work in a currencys lowest amount. So in dollars that would be cents.

That mean to charge f.ex 1$ you need to multiply it by 100. This gives you 100 which is the amount you pass to stripe.

In your case to charge 774$ you would need to pass 77400 in stripes amount field


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...