DeligenceTechnologies / Braintree-Payment-Gateway-for-Flutter

Braintree Payment plugin for Flutter apps from Deligence Technologies. This plugin lets you integrate Braintree Drop In payment UI in just 4 easy steps.
BSD 3-Clause "New" or "Revised" License
34 stars 27 forks source link

iOS Response From BrainTree Changed #18

Closed Goodest-Y closed 4 years ago

Goodest-Y commented 4 years ago

Hi , I was working on our projects with your braintree plugin which works nice. But today I found that the response from iOS side is different from android. Also , with an error (like setting error or others) crashes caused as below : 2019-11-06 18:00:50.358284+0800 Runner[2125:878857] [BraintreeSDK] ERROR Invalid client token. Please ensure your server is generating a valid Braintree ClientToken. 2019-11-06 18:00:50.358462+0800 Runner[2125:878857] [BraintreeSDK] ERROR BTClient could not initialize because the provided clientToken was invalid 2019-11-06 18:00:50.362603+0800 Runner[2125:878857] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <FlutterViewController: 0x10580e400>.' First throw call stack: (0x1b22dd80c 0x1b2005fa4 0x1b5d3dee8 0x1b5d40150 0x1b5d4064c 0x1b5d400a0 0x1b5d40308 0x100ed1c30 0x100ed1a80 0x10259842c 0x102533dbc 0x10258a654 0x1025419e8 0x10254609c 0x1b225be00 0x1b225bb3c 0x1b225b20c 0x1b2256348 0x1b22558a0 0x1bc1ad328 0x1b6346768 0x100a6ec44 0x1b20e0360) libc++abi.dylib: terminating with uncaught exception of type NSException

Would you mind taking a look on it , or would you mind advising us on this debug ?

deligence commented 4 years ago

Looks like you're not generating a valid clientToken. Please follow the Braintree docs to know more about generating client token at the server-side. https://developers.braintreepayments.com/reference/request/client-token/generate/node