capacitor-community / stripe

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

The customer has not entered their payment method. #94

Closed dheerajkhokhar closed 2 years ago

dheerajkhokhar commented 2 years ago

Hi, I try to implement both the method PaymentSheet and PaymentFlow in ionic react project but every time payment failed, this error message ("The customer has not entered their payment method.") is shown in stripe dashboard. Can you please tell me how to solve this issue.

Thanks:-

Code:-

const { paymentIntent, ephemeralKey, customer } = //HTTP SERVER REQUEST RESPONSE;
Stripe.createPaymentFlow({
  paymentIntentClientSecret: paymentIntent,
  customerEphemeralKeySecret: ephemeralKey,
  customerId: customer,
  merchantDisplayName: 'App Name',
  style: 'alwaysDark',
}).then((createPaymentSheetResponse)=>{
  console.log("createPaymentSheetResponse - ", createPaymentSheetResponse);
  Stripe.presentPaymentFlow().then(finalResponse =>{
    console.log("finalResponse - ", finalResponse);
  }).catch((error)=>{
  })
}).catch((error)=>{
})
rdlabo commented 2 years ago

createPaymentFlow require confirmPaymentFlow. Please check demo: https://github.com/capacitor-community/stripe/blob/master/demo/angular/src/app/tab3/tab3.page.ts#L120-L131

Thanks.

rdlabo commented 2 years ago

@dheerajkhokhar Did you adapt this plugin for production? If yes, please tell us what app. Please help us to develop this plugin in 2022. https://github.com/capacitor-community/stripe/issues/145 Thanks.