首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >支付宝网关自动化

支付宝网关自动化
EN

Stack Overflow用户
提问于 2021-03-14 02:35:40
回答 1查看 37关注 0票数 0

所以我最近尝试使用PHP的Stripe支付网关

我可以让它和它的工作非常好,只是它滞后了一些事情,如果我进入index.php页面--这显示了一个带卡按钮的支付,--我希望它启动付款,而不必一到index.php页面就单击该按钮。

我试过了,但没有成功。我目前的代码如下:

代码语言:javascript
复制
<?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>

如果有人能指导我如何修改代码并使我的目的得到满足,那将是非常令人惊奇的。

非常感谢你抽出时间

亲切的问候

EN

回答 1

Stack Overflow用户

发布于 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

如果您能够更多地分享您的业务流程和您正在努力实现的目标,这将有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66620569

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档