Last active
October 10, 2019 07:56
-
-
Save rafaelpadovani/a409d7d7405d7abe3a049a93a811deda to your computer and use it in GitHub Desktop.
Confirming Stripe Payment Intent
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
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