【问题标题】:Braintree Pay Button for Credit Card not dislapaying信用卡的 Braintree 支付按钮未显示
【发布时间】:2016-02-22 21:54:39
【问题描述】:

以下代码嵌入在 PHP 中。目前正在显示 dropin UI 容器,但我们无法看到“支付”按钮。我们尝试创建一个自定义按钮并尝试了交易,但它登陆到结帐页面,因为我认为一切都需要由 dropin UI Container 处理,所以没有找到。

代码:

<html>
           <head>
               <title>Payment</title>
               <script src="https://js.braintreegateway.com/v2/braintree.js"></script>
               <script>
                   braintree.setup("<?php echo $clientToken; ?>", "dropin", {
                       container: "dropin-container",
                        paypal: {
                          singleUse: true,
                           amount: <?php echo $array["amount"]; ?>,
                           currency: 'USD'
                       }
                   });
               </script>
           </head>
           <body>
               <form id="checkout" method="post" action="/checkout">
                   <div id="dropin-container"></div>
                   <input type="submit" value="Pay <?php echo $array["amount"]; ?>">
               </form>
           </body>
       </html>

【问题讨论】:

    标签: javascript php paypal credit-card braintree


    【解决方案1】:

    免责声明:我是 Braintree 的开发人员。

    在实现 Drop-in 时,您仍然需要确保包含一个按钮(就像您在上面的代码示例中所做的那样)。此外,您需要将表单 action 设置为您网站上的有效目的地。 Drop-in 最终会触发实际表单的提交,因此需要正确定义表单的action。如果您还没有构建服务器端组件来处理来自 Drop-in 的响应,请查看我们的 Hello Server 指南,其中介绍了如何处理从 Drop-in 返回的付款方式随机数。

    如果您有任何其他与此相关的问题,我强烈建议您与出色的 Braintree support 团队联系以获得更多帮助。

    【讨论】:

      猜你喜欢
      • 2015-06-06
      • 2019-11-16
      • 2017-12-10
      • 2015-02-08
      • 2019-06-07
      • 2019-06-24
      • 2020-09-18
      • 2015-01-16
      • 2021-11-18
      相关资源
      最近更新 更多