如何计算条形支付api中的gbp费用

时间:2016-12-29 07:59:37

标签: php stripe-payments

请告诉我如何在stripe付款API中计算gbp费用。

当我支付77 Gbp时,它转换如下:

  

金额:£0.77英镑

     

费用:£0.22

你能帮我理解这个计算吗?

$payment = \Stripe\Charge::create(array(
           'amount' => 77,
           'currency' => 'gbp',
           'customer' => 'cus_9pI6dChsVygOLm',
           'capture' => true,
           'description' => 'Testing response',
    ));

1 个答案:

答案 0 :(得分:2)

当您将金额作为费用传递给Stripe时,它以美分为单位。因此,要实际充电77GBP,您需要将该数量乘以100。 请参阅Stripe文档以及它如何提及它的分数: https://stripe.com/docs/quickstart#charging-your-customer-immediately

然后费用就是Stripe根据金额向您收取的交易费用。