Skip to content

Instantly share code, notes, and snippets.

@rafaelpadovani
Last active October 10, 2019 07:56
Show Gist options
  • Save rafaelpadovani/a409d7d7405d7abe3a049a93a811deda to your computer and use it in GitHub Desktop.
Save rafaelpadovani/a409d7d7405d7abe3a049a93a811deda to your computer and use it in GitHub Desktop.
Confirming Stripe Payment Intent
export const confirmPaymentIntent = (payment_method) => {
fetch('https://api.stripe.com/v1/payment_intents/' + payment_method, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + secret_key
},
})
.then((response) => {
if (response.status == 200) {
return response.json();
}
})
.then((responseJson) => {
return responseJson;
})
.catch((error) => {
return error;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment