简体   繁体   English

信用卡的Braintree支付按钮无法支付

[英]Braintree Pay Button for Credit Card not dislapaying

The below code is embedded in PHP. 下面的代码嵌入在PHP中。 Currently the dropin UI container is getting displayed however we not able to see the Pay button. 目前,dropin UI容器正在显示,但是我们看不到“付款”按钮。 We tried creating a custom button and tried the transaction but it lands to the checkout page, which is not found as i think everything needs to be handled by dropin UI Container. 我们尝试创建一个自定义按钮并尝试了交易,但是它登陆到了结帐页面,因为我认为所有事情都需要由Dropin UI Container处理,所以找不到该页面。

Code: 码:

<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>

Disclaimer: I'm a developer at Braintree. 免责声明:我是Braintree的开发人员。

When implementing Drop-in, you still need to make sure to include a button (like you did in the code example above). 在实现Drop-in时,您仍然需要确保包括一个按钮(就像在上面的代码示例中所做的那样)。 Additionally, you'll need to set the form action to a valid destination on your site. 此外,您需要将表单action设置为网站上的有效目的地。 The Drop-in eventually triggers a submit on the actual form, so the form's action needs to be defined properly. Drop-in最终会触发实际表单的提交,因此需要正确定义表单的action If you haven't yet built the server side component to handle the response from the Drop-in, check out our Hello Server guide, which covers how to handle the payment method nonce returned from the Drop-in. 如果您尚未构建服务器端组件来处理Drop-in的响应,请查看我们的Hello Server指南,该指南涵盖了如何处理Drop-in返回的付款方式随机数。

If you have any other questions related to this, I highly recommend reaching out to the awesome Braintree support team for additional help. 如果您还有其他与此相关的问题,我强烈建议您与敬畏的Braintree支持团队联系以寻求更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM