stripe-ios icon indicating copy to clipboard operation
stripe-ios copied to clipboard

[BUG] stripeError not handled. SDK getting crash while making the payment using ApplePay

Open Rthangavel opened this issue 2 years ago • 3 comments

Summary

App getting crash while trying to make the Apple Pay. Screenshot [attached](url) Screenshot 2022-06-14 at 12 32 55 PM

Code to reproduce

iOS version

15.0.1

Installation method

Pod and swift package dependence

SDK version

Other information

Rthangavel avatar Jun 15 '22 10:06 Rthangavel

Hello @Rthangavel, could you answer a few things for me to help debug?

  • Can you print out the stripeError here (you can run the command po stripeError in the debugger)?
  • What Xcode version are you using?
  • Do you have exception breakpoints enabled?

yuki-stripe avatar Jun 17 '22 17:06 yuki-stripe

Hi Yuvi,

  1. strripeError -> nil
  2. Xcode version -> 13.3.1 (13E500a)
  3. Exception breakpoint not enabled.

On Fri, Jun 17, 2022 at 10:54 PM Yuki @.***> wrote:

Hello @Rthangavel https://github.com/Rthangavel, could you answer a few things for me to help debug?

  • Can you print out the stripeError here (you can run the command po stripeError in the debugger)?
  • What Xcode version are you using?
  • Do you have exception breakpoints enabled?

— Reply to this email directly, view it on GitHub https://github.com/stripe/stripe-ios/issues/1979#issuecomment-1159091197, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBO7IUKOUST7YRJNKEYALVPSYE3ANCNFSM5Y2YQU2A . You are receiving this because you were mentioned.Message ID: @.***>

Rthangavel avatar Jun 22 '22 07:06 Rthangavel

Hi @Rthangavel:

It looks like you might be passing an NSError() to Stripe's ApplePayContext completion handler. As pointed out in the console message, this isn't recommended, as it results in an invalid NSError object. (I realize we do this in some of our example apps — we should probably clean this up on our end as well!)

In your ApplePayDelegate, can you try replacing any usage of NSError() with NSError(domain: "YourErrorDomain", code: 0, userInfo: nil)? That should avoid this crash.

Thanks!

davidme-stripe avatar Jul 06 '22 20:07 davidme-stripe