[英]Variable amount with stripe elements
You could follow an example like this , but when creating the payment intent replace the calculation of amount
based on items to just be an amount sent from the client on the body
:您可以按照这样的示例进行操作,但是在创建付款意图时,将基于项目的
amount
计算替换为客户端在body
上发送的金额:
// Create a PaymentIntent with the order amount and currency
$payment_intent = \Stripe\PaymentIntent::create([
"amount" => $body->amount_entered,
"currency" => $body->currency
]);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.