-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Here is the function I've set up, almost identical to the example...
`getNonce: function(){
return(
fetch('http://fryegg.com:3000/get_token')
.then((response) => response.json())
.then((responseData) => {
var clientToken = responseData.clientToken;
BTClient.setup(clientToken);
BTClient.showPaymentViewController(function(err, nonce) {
//callback after the user completes (or cancels) the flow.
//with the nonce, you can now pass it to your server to create a charge against the user's payment method
fetch('http://fryegg.com:3000/pay', {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({payment_method_nonce: 'fake-valid-nonce'})
}).done();
});
}).done()
);
}`
The nonce is created on the server and sent back, but the POST method is never called from the phone.