javascript - 无法加载资源 : braintree js php integration aws ec2 lamp stack

标签 javascript php amazon-ec2 payment braintree

我在使用 AWS EC2 的 JS PHP Braintree 集成方面需要一些帮助。

我在我的 composer.json 中包含了使用 require 的 braintree PHP 库 { “要求” : { “braintree/braintree_php”:“3.5.0” } }

我已经使用 运行 php composer.phar install

这些是我从 Braintree 获得的一些示例文件,我可以在我的本地计算机上的 Dreamweaver 上使用该脚本。但是当我将文件上传到我的实例时,没有任何显示。

当我检查我的 google chrome 日志时,我收到错误消息:“无法加载资源:服务器响应状态为 500(内部服务器错误)”

如有任何帮助,我们将不胜感激。

 <?php
require_once '/home/ec2-user/vendor/braintree/braintree_php/lib/Braintree.php';
require_once '/home/ec2-user/vendor/autoload.php';

Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('test_marchant_id');
Braintree_Configuration::publicKey('test_public_key');
Braintree_Configuration::privateKey('test_private_key');

$clientToken = Braintree_ClientToken::generate();
?>

<head>
<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
</head>
<html>
<body>

<form id="checkout" method="post" action="server.php">
 <div id="dropin"></div>
  Amount:<input type="text" name="amount"><br>
  First Name:<input type="text" name="firstname"><br>
  Last Name:<input type="text" name="lastname"><br>
  Email:<input type="text" name="email"><br>
  <input type="submit" value="Submit Payment">
    </form>

<script language='javascript'>
braintree.setup("<?php echo $clientToken; ?>", 'dropin', {
 container: 'dropin'
 });
</script>

</body>

</html>

最佳答案

我只是删除了 require autoload.php 语句,网关正在完美地处理付款!

关于javascript - 无法加载资源 : braintree js php integration aws ec2 lamp stack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32945778/

相关文章:

javascript - Canvas map 坐标

javascript - QWebElement评估JavaScript this.click()方法不起作用

javascript - Html5 Canvas 文本交叉点

php - Prestashop 1.6。按类别 ID 获取所有制造商

php - 我可以使用私有(private)实例方法作为回调吗?

javascript - 单击图像时 Div 不执行 slideToggle()

php - 这是 json 以及如何用 php 变量替换值?

amazon-web-services - 托管在 aws s3 存储桶上的静态网站的自定义 url

PHPExcel 未在服务器中导入 Excel 工作表

java/jetty 重载一段时间后不响应连接