react-native-stripe-payments icon indicating copy to clipboard operation
react-native-stripe-payments copied to clipboard

App crashes without giving any error on confirmPayment

Open Ahmad5448 opened this issue 4 years ago • 8 comments

stripe.confirmPayment('key', cardDetails) .then(result => { console.log('strip payment responce ', result) }) .catch(err =>{ console.log('strip error', err) } )

Ahmad5448 avatar Jan 04 '21 22:01 Ahmad5448

Hey! What does the cash log say? I believe you should see stack of native crash log (either on iOS or Android)

viktorasl avatar Jan 05 '21 10:01 viktorasl

2021-01-05 22:54:36.399 24195-24323/com.desider.hayatiffy E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.desider.hayatiffy, PID: 24195 java.lang.IllegalArgumentException: Invalid client secret: sk_test_51HiwWFF6nhJo************************* at com.stripe.android.model.PaymentIntent$ClientSecret.(PaymentIntent.kt:266) at com.stripe.android.StripeApiRepository.confirmPaymentIntent(StripeApiRepository.kt:111) at com.stripe.android.StripePaymentController$ConfirmStripeIntentTask.getResult$stripe_release(StripePaymentController.kt:529) at com.stripe.android.ApiOperation$execute$1.invokeSuspend(ApiOperation.kt:23) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Ahmad5448 avatar Jan 05 '21 18:01 Ahmad5448

but I am using valid key

Ahmad5448 avatar Jan 05 '21 18:01 Ahmad5448

can I use my client secret from my strip account in app directly ? or backend developer will give me through API ?

Ahmad5448 avatar Jan 05 '21 18:01 Ahmad5448

Please use publishable key (https://stripe.com/docs/keys). You should not use secret key on app. It's fair though that library should not cause an app to crash but return error instead.

viktorasl avatar Jan 06 '21 07:01 viktorasl

ok ill try in coming hours will let you know shortly thanks for your response

Ahmad5448 avatar Jan 08 '21 15:01 Ahmad5448

I can confirm that this still happens. I have used both publishable and secret keys and this crash/error still happens

Billmike avatar Jan 24 '21 18:01 Billmike

Can you provide crash log?

viktorasl avatar Jan 25 '21 07:01 viktorasl