Skip to content

Instantly share code, notes, and snippets.

View cesarbarone's full-sized avatar

César Barone cesarbarone

View GitHub Profile
function createOneTimePayment({ paymentMethodId, priceId, email, fullName, recaptchaToken }) {
fetch(`${GRAPHQL_HOST}/graphql`, { method: 'post', referrerPolicy: 'unsafe-url', headers: { 'Content-type': 'application/json', 'Client-Captcha-Token': recaptchaToken }, body: JSON.stringify({
query:
`mutation createStripeOneTimePayment {
createStripeOneTimePayment(paymentMethodId: "${paymentMethodId}", priceId: "${priceId}", email: "${email}", fullName: "${fullName}", phone: "${phone}")
{ status error }
}`,
})
})
.then(responseToJson)