Everything works well until I call the pay funtion, then the whole application crashes. I have recorded the following errors from logcat:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.sumup.merchant.Models.UserDetails$Business com.sumup.merchant.Models.UserDetails.getBusiness()' on a null object reference at com.sumup.merchant.Models.UserModel.getBusiness(SourceFile:316) at com.sumup.merchant.Models.UserModel.getServerCurrencyCode(SourceFile:341) at com.sumup.merchant.Models.OrderModel.getCurrency(SourceFile:272) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.getErrorMessageForApiInformation(SourceFile:660) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.validateApiInformation(SourceFile:371) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.onStart(SourceFile:158) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435) at android.app.Activity.performStart(Activity.java:8239) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3866) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:247) at android.app.ActivityThread.main(ActivityThread.java:8656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
This is what I'm doing:
First I call isLoggedIn()
Then auth()
Then login()
Then prepare()
At last pay() - BOOM crash!
The crash happens at checkout().
SumUpAPI.checkout(cordova.getActivity(), payment, REQUEST_CODE_PAYMENT);
I have installed SumUp app and verified that my terminal unit (Air) is working perfectly with it. Any advice would be much appreciated.
Dear Sumup team, I'm are trying to integrate Sumup to our POS using this cordova plugin for ionic: https://github.com/mariusbackes/cordova-plugin-sumup
Everything works well until I call the pay funtion, then the whole application crashes. I have recorded the following errors from logcat:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.sumup.merchant.Models.UserDetails$Business com.sumup.merchant.Models.UserDetails.getBusiness()' on a null object reference at com.sumup.merchant.Models.UserModel.getBusiness(SourceFile:316) at com.sumup.merchant.Models.UserModel.getServerCurrencyCode(SourceFile:341) at com.sumup.merchant.Models.OrderModel.getCurrency(SourceFile:272) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.getErrorMessageForApiInformation(SourceFile:660) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.validateApiInformation(SourceFile:371) at com.sumup.merchant.api.LoadSumUpPaymentsActivity.onStart(SourceFile:158) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435) at android.app.Activity.performStart(Activity.java:8239) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3866) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2325) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:247) at android.app.ActivityThread.main(ActivityThread.java:8656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
This is what I'm doing:
The crash happens at checkout().
SumUpAPI.checkout(cordova.getActivity(), payment, REQUEST_CODE_PAYMENT);
I have installed SumUp app and verified that my terminal unit (Air) is working perfectly with it. Any advice would be much appreciated.
Happy Christmas & Holidays <3