所以我最近尝试使用PHP的Stripe支付网关
我可以让它和它的工作非常好,只是它滞后了一些事情,如果我进入index.php页面--这显示了一个带卡按钮的支付,--我希望它启动付款,而不必一到index.php页面就单击该按钮。
我试过了,但没有成功。我目前的代码如下:
<?php
require('config.php');
$amount= $_GET['amount'];
$total = $amount * 100;
?>
<html>
<head>
<title>Stripe Checkout </title>
</head>
<body>
<body onload= "submitter()">
<form action="submit.php" method="post" id="stripeForm">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<?php echo $publishableKey?>"
data-amount="<?php echo"$total";?>"
data-name="XyberNeo Digital Solutions"
data-description="Classic Starter Plan"
data-image="https://www.xyberneo.com/cloudsheets/v3/assets/img/favicon.png"
data-currency="inr"
data-email="aditya@xyberneo.com"
>
</script>
</form>
<script>
function submitter(){
document.getElementById("stripe-button").submit()
}
</script >
<body>
<html>如果有人能指导我如何修改代码并使我的目的得到满足,那将是非常令人惊奇的。
非常感谢你抽出时间
亲切的问候
发布于 2021-03-14 06:55:34
如果没有一些事件,比如按一下按钮,启动负载付款可能是行不通的。假设您的代码有效,它仍然缺乏支付方法信息。如果您正在进行纯客户端的集成,请参阅https://stripe.com/docs/js/payment_intents/confirm_card_payment关于如何确认卡支付的内容。
如果您同时进行服务器和客户端集成,则可以在创建时立即尝试confirm PaymentIntent,请参阅https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm。
如果您能够更多地分享您的业务流程和您正在努力实现的目标,这将有所帮助。
https://stackoverflow.com/questions/66620569
复制相似问题