Created
June 17, 2022 12:03
-
-
Save callstack-bot/a2a09cab4ca5d1b5d4717e8a509de0d5 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
const fetchPaymentIntentClientSecret = async () => { | |
const response = await fetch(`${API_URL}/create-payment-intent`, { | |
method: 'POST', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ | |
currency: 'usd', | |
items: [{ id: 'id' }], | |
}), | |
}); | |
const { clientSecret } = await response.json(); | |
return clientSecret; | |
}; | |
const handlePayPress = async () => { | |
const clientSecret = await fetchPaymentIntentClientSecret(); | |
// step 2 | |
// step 3 | |
// step 4 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment