I’m attempting to use the stripe capacitor community plugin
This is my function:
‘’’
const createpaymentintent = async () => {
console.log('amount', amount, 'currency', currency, email)
try {
const response = await fetch(`https://fake.com/createpaymentintent`, {
method: "POST",
mode: "cors",
headers: requestHeaders,
body: JSON.stringify({ micnum, amount, currency, firstName, lastName, email })
})
const data = await response.json()
console.log('customer secret', data.cs, typeof(data.cs), 'customer id', data.customer_id,
typeof(data.customer_id), 'secret key', data.es, typeof(data.es))
try {
console.log('before create payment sheet');
await Stripe.createPaymentSheet({
paymentIntentClientSecret: data.cs,
customerId: data.customer_id,
customerEphemeralKeySecret: data.es,
merchantDisplayName: "test app",
});
console.log('after payment create')
} catch (error) {
console.log('error in create payment', error)
}
} catch (error) {
console.log('payment failure')
}
}
‘’’
When I call this function, the client secret, customer id, ephemeral key secret all log just fine. The last log I get is ‘before create payment sheet.’ Then it just hangs. What am I doing wrong?