나는 braintree paypal checkout 함수로 작업하고 있습니다. jquery code를 찾았습니다. jquery 변수에 Braintree Sandbox Auth Key를 두어야합니다. braintree에서 계정을 만들었습니다. ,하지만 jquery 콘솔 로그 authrization 실패했다, 아무도 그 코드를 찾을 수 있습니다 도와주세요 수 있습니까? 여기 var BRAINTREE_SANDBOX_AUTH = '38mqtdwp4nth5tbk';
누구도 날이 문제를 해결하는 데 도움이 될 수 있습니다어떻게 내가 Braintree Sandbox Auth Key를 찾을 수 있습니까
<!DOCTYPE html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script src="https://js.braintreegateway.com/web/3.11.0/js/client.min.js"></script>
<script src="https://js.braintreegateway.com/web/3.11.0/js/paypal-checkout.min.js"></script>
</head>
<body>
<div id="paypal-button-container"></div>
<script>
var BRAINTREE_SANDBOX_AUTH = '38mqtdwp4nth5tbk';
// Render the PayPal button
paypal.Button.render({
// Pass in the Braintree SDK
braintree: braintree,
// Pass in your Braintree authorization key
client: {
sandbox: BRAINTREE_SANDBOX_AUTH,
production: '<insert production auth key>'
},
// Set your environment
env: 'sandbox', // sandbox | production
// Wait for the PayPal button to be clicked
payment: function(data, actions) {
// Make a call to create the payment
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '1', currency: 'USD' }
}
]
}
});
},
// Wait for the payment to be authorized by the customer
onAuthorize: function(data, actions) {
// Call your server with data.nonce to finalize the payment
console.log('Braintree nonce:', data.nonce);
// Get the payment and buyer details
return actions.payment.get().then(function(payment) {
console.log('Payment details:', payment);
});
}
}, '#paypal-button-container');
</script>
</body>
내가이 변수에 코드를 삽입 할 필요가 내 sameple 코드?
감사합니다. –