tolu360 / react-native-paystack

React Native Wrapper for the Paystack Native Mobile SDKs
162 stars 46 forks source link

Can't charge card on iOS #18

Closed lordkiz closed 6 years ago

lordkiz commented 6 years ago

Hello @tolu360 , @steveamaza . I need help please. So this package works flawlessly on android, however on iOS I cannot charge a test nor real cards. I have followed your instructions on how to set this up properly, but when I run it I get this:

[tid:com.facebook.react.JavaScript] 'error', { [Error: Error charging card]
  framesToPop: 1,
  code: 'E_CHARGE_ERROR',
  nativeStackIOS: 
   [ '0   My_App                            0x0000000108fdbab6 RCTJSErrorFromCodeMessageAndNSError + 134',
     '1   My_App                            0x0000000108f6a4b3 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.218 + 179',
     '2   My_App                            0x00000001091f0d18 __43-[RNPaystack chargeCard:resolver:rejecter:]_block_invoke_2 + 168',
     '3   Paystack                            0x00000001099d737e __56-[PSTCKAPIClient(CreditCards) didEndWithProcessingError]_block_invoke + 222',
     '4   Foundation                          0x0000000109aff363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7',
     '5   Foundation                          0x0000000109aff1ca -[NSBlockOperation main] + 68',
     '6   Foundation                          0x0000000109afd6b2 -[__NSOperationInternal _start:] + 766',
     '7   libdispatch.dylib                   0x0000000110bab7ec _dispatch_client_callout + 8',
     '8   libdispatch.dylib                   0x0000000110bb0db8 _dispatch_block_invoke_direct + 592',
     '9   libdispatch.dylib                   0x0000000110bab7ec _dispatch_client_callout + 8',
     '10  libdispatch.dylib                   0x0000000110bb0db8 _dispatch_block_invoke_direct + 592',
     '11  libdispatch.dylib                   0x0000000110bb0b48 dispatch_block_perform + 109',
     '12  Foundation                          0x0000000109af975b __NSOQSchedule_f + 337',
     '13  libdispatch.dylib                   0x0000000110bab7ec _dispatch_client_callout + 8',
     '14  libdispatch.dylib                   0x0000000110bb68cf _dispatch_main_queue_callback_4CF + 628',
     '15  CoreFoundation                      0x000000010bc36c99 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9',
     '16  CoreFoundation                      0x000000010bbfaea6 __CFRunLoopRun + 2342',
     '17  CoreFoundation                      0x000000010bbfa30b CFRunLoopRunSpecific + 635',
     '18  GraphicsServices                    0x0000000112e66a73 GSEventRunModal + 62',
     '19  UIKit                               0x000000010e8f1057 UIApplicationMain + 159',
     '20  My_App                            0x0000000108ec3d1f main + 111',
     '21  libdyld.dylib                       0x0000000110c28955 start + 1',
     '22  ???                                 0x0000000000000001 0x0 + 1' ],
  userInfo: 
   { 'com.paystack.lib:ErrorMessageKey': 'Please wait',
     NSLocalizedDescription: 'Please wait' },
  domain: 'com.paystack.lib',
  line: 2268,
  column: 26,
  sourceURL: 'http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false' }

I have keychain sharing enabled. I have used live and test public and secret keys. Everything appears properly linked. I am using RNPaystack.chargeCard method. Any help will be greatly appreciated

steveamaza commented 6 years ago

@lordkiz not too familiar with the iOS side of things. I will let @tolu360 get back to you on this

lordkiz commented 6 years ago

I have checked every nook and cranny of this library, I cant seem to figure out what could be wrong.

lordkiz commented 6 years ago

@ibrahimlawal any help will be greatly appreciated.

tolu360 commented 6 years ago

Hi Kizito, give me some time to look at the issues. Been super busy lately. Cheers

Sent from my iPhone

On 15 Aug 2018, at 4:08 PM, Kizito Egeonu notifications@github.com wrote:

@ibrahimlawal any help will be greatly appreciated.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lordkiz commented 6 years ago

Thanks @tolu360 , @steveamaza . For anyone experiencing similar issue, The error was occurring because I had rendered the checkout form in a Modal. This prevented the Paystack dialog for pin and otp input from rendering. Closing the modal and attempting to repeat the process will throw the error above. This part:

....
userInfo: 
   { 'com.paystack.lib:ErrorMessageKey': 'Please wait',
     NSLocalizedDescription: 'Please wait' },
  domain: 'com.paystack.lib',
....

i guess simply means a transaction is in process so please wait. Unlike android this issue is a long standing problem with ios. Closing this now.

sokoya commented 4 years ago

@lordkiz , I understand this issue has been close, however, I am encountering similar issue. using the chargeCardWithAccessCode keeps throwing the E_CHARGE_ERROR even with test and real code.

please anyone encountering same issue and any solution.??

Thanks in advance.

surafelbm commented 4 years ago

@schoolvillephilip Hey were you able to fix this issue you mentioned above? Having a similar issue.

sokoyaphilip commented 4 years ago

Yea, ensure that the cardNumber value is in the right format. e.g 5300 99.. .... ....

Not 530099......

Cheers.

@schoolvillephilip Hey were you able to fix this issue you mentioned above? Having a similar issue.

surafelbm commented 4 years ago

But says this "the card number as a String without any seperator e.g 5555555555554444" on the doc, and i am using chargeCardWithAccessCode