-
-
Save kypflug/c7fdc8cea5de36c8a65fc713817c7fcb to your computer and use it in GitHub Desktop.
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