[英]Failed to load resource: braintree js php integration aws ec2 lamp stack
I am in need of some help with my JS PHP Braintree integration, using AWS EC2. 我需要使用AWS EC2对我的JS PHP Braintree集成提供一些帮助。
I have included the braintree PHP lib using require in my composer.json { "require" : { "braintree/braintree_php" : "3.5.0" } }
我在composer.json中使用了require braintree PHP lib
{ "require" : { "braintree/braintree_php" : "3.5.0" } }
and I have installed it using run php composer.phar install
我使用
run php composer.phar install
安装它
These are some sample files I was provided with from Braintree, I can use the script in my local computer on Dreamweaver. 这些是我从Braintree提供的一些示例文件,我可以在Dreamweaver上使用本地计算机中的脚本。 But when I upload the file to my instance, nothing shows.
但是当我将文件上传到我的实例时,没有任何显示。
When I check my google chrome log I get the error message: "Failed to load resource: the server responded with a status of 500 (Internal Server Error)" 当我检查我的谷歌浏览器日志时,我收到错误消息:“无法加载资源:服务器响应状态为500(内部服务器错误)”
Any help would be greatly appreciated. 任何帮助将不胜感激。
<?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语句,网关正在完美处理付款!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.