Skip to content

Instantly share code, notes, and snippets.

@kypflug
Last active February 14, 2017 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kypflug/c7fdc8cea5de36c8a65fc713817c7fcb to your computer and use it in GitHub Desktop.
Save kypflug/c7fdc8cea5de36c8a65fc713817c7fcb to your computer and use it in GitHub Desktop.
  //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