3
我需要一些幫助,我的JS PHP Braintree集成,使用AWS EC2。無法加載資源:braintree js php集成aws ec2燈棧
我已經包含用我的composer.json { "require" : { "braintree/braintree_php" : "3.5.0" } }
要求布倫特裏PHP lib和我一直在使用 run php composer.phar install
這些都是我從布倫特裏提供了一些示例文件安裝了它,我可以在Dreamweaver的本地計算機上使用該腳本。但是當我將文件上傳到我的實例時,什麼也沒有顯示。
當我檢查我的谷歌瀏覽器的日誌我得到錯誤信息:「無法加載資源:服務器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>
檢查錯誤日誌/打開錯誤報告並找出錯誤發生的原因, – Epodax
您已發佈沙箱API密鑰。您應該編輯帖子以將其刪除,然後轉到Braintree控制面板並從右上角選擇帳戶>我的用戶,以重新生成密鑰。在授權下的我的用戶頁面上,單擊查看API密鑰。最後,在API密鑰頁面上點擊生成新。 –
哎呦,謝謝! @Jessicad – amyloula