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

感情迁移 提交于 2019-12-13 09:37:51

问题


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 = \Stripe\Charge::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.


回答1:


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



来源:https://stackoverflow.com/questions/54733556/stripe-is-charging-only-1-of-the-amount-test-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!