capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

apple pay fails with unexpected error #63

Closed moblizeit closed 2 years ago

moblizeit commented 3 years ago

i am trying to use apple pay with my ionic project and the code on pay button looks like below

const Stripe = Plugins.Stripe as StripePlugin; Stripe.setPublishableKey({ key: 'pk_test_XXXXX' }); //test key const clientSecret: string = 'sk_test_XXXXX'; //test secret

async pay(){ await Stripe.confirmPaymentIntent({ clientSecret, applePayOptions: { // options here merchantId: 'merchant.ixxxxx', country: 'US', currency: 'USD', items: [ { label: 'Product desc', amount: 0.5, // amount in dollars } ] }, }).then(res => { // dismiss the apple pay modal in the UI // check with your server that everything is fine, depending on your PaymentIntent implementation Stripe.finalizeApplePayTransaction({ success: true }) }) .catch(err => { console.error("apple pay fail error is", err) Stripe.finalizeApplePayTransaction({ success: false }) }); }

at runtime i see the error in the code as below

ERROR MESSAGE: {"message":"payment failed: There was an unexpected error -- try again in a few seconds","errorMessage":"There was an unexpected error -- try again in a few seconds"}

i have tried my stripe test as well as live keys but no luck.

akkivinaya commented 3 years ago

Hey. were you able to solve the issue?

rdlabo commented 2 years ago

Thanks for issue! Today this plugin of v3 is released. This not compatible with v1. All APIs have been revamped. So I will close this issue. If you still have the same problem, please create a new Issue. Thank you.