/paymentRequestShow.js Secret
Last active
February 14, 2017 19:05
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Show the Native UI | |
payment.show() | |
//When the promise is fulfilled, pass the results to your server for processing | |
.then(result => { | |
return process(result).then(response => { | |
if (response.status === 200) { | |
//Show that the transaction was successful in the UI | |
return result.complete('success'); | |
} else { | |
//Show in the Native UI that the transaction failed | |
return result.complete('fail'); | |
} | |
}).catch((err) => { | |
console.error('User rejected request', err.message) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment