Je travaille avec la fonction checkout de braintree paypal, j'ai trouvé le code de jquery pour cela, je dois placer Braintree Sandbox Auth Key dans la variable de jquery, j'ai créé le compte dans braintree, j'ai essayé tout ce code , mais dans le journal de la console jquery il est dit que l'authentification a échoué, quelqu'un peut-il m'aider s'il vous plaît où puis-je trouver ce code? Voici mon code samepleComment puis-je trouver 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>
J'ai besoin de placer le code dans cette variable var BRAINTREE_SANDBOX_AUTH = '38mqtdwp4nth5tbk';
quelqu'un peut me aider à résoudre ce problème?
Merci de travailler maintenant pour moi –