Nets-mobile-acceptance / Netaxept-Android-SDK

PiA Netaxept Android SDK is a library that provides the native In-App interaction to perform Netaxept payments directly from an app on Android devices while minimizing PCI DSS requirements for you.
31 stars 15 forks source link

Trouble with PayPal in mobile terminal #72

Closed kalina559 closed 1 year ago

kalina559 commented 1 year ago

Hi,

I have some problems implementing the PayPal flow in an Android app, namely Pia-SDK keeps crashing when I try to use PayPal in app. I managed to make it work in our webshop (the money was successfully captured on PayPal merchant account), so I don't think it's a problem with setting up the PayPal account or making the Register call.

This is the call I'm making to register the app payment: https://test.epayment.nets.eu/Netaxept/Register.aspx?token=REDACTED&serviceType=B&customerCountry=DK&redirectUrl=http%3A%2F%2Flocalhost%2Fdummy.htm&paymentMethodActionList=%5B{"PaymentMethod" %3A "PayPal"%2C "Fee" %3A 0}%5D&customerNumber=77359&transactionReconRef=1704699&orderNumber=1704699&currencyCode=DKK&amount=1300&merchantId=REDACTED

Then in my app I'm running PiaSDK.getInstance().startPayPalProcess(this, bundle, createHandler()) (createHandler() is our custom method) To compare, the currently working solution looks almost exactly the same, but with this line instead: PiaSDK.getInstance().start(this, bundle, createHandler()) After running startPayPalProcess() I'm redirected to the terminal and I see this for a couple of seconds: image

Then the app crashes completely with this error in the logs:

java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter terminalRequestError
        at eu.nets.pia.PayPalError$TerminalRequest.<init>(Unknown Source:3)
        at eu.nets.pia.ui.webview.PayPalActivity$a.run(:2)
        at android.app.Activity.runOnUiThread(Activity.java:7489)
        at eu.nets.pia.ui.webview.PayPalActivity.a(Unknown Source:5)
        at a.a.a.d.h.b$a.run(Unknown Source:53)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:226)
        at android.os.Looper.loop(Looper.java:313)
        at android.app.ActivityThread.main(ActivityThread.java:8741)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

The SDK code is obfuscated so I'm not sure what's happening there, but I tried debugging it and it seems like the error is coming from PayPalActivity.class, specifically the line with a breakpoint: image

Instead of Status.SUCCESS I get this.a.getStatus() == Status.THREEDSECURE.

Could you help me find what I'm doing wrong?

Miss-PiA commented 1 year ago

Hi @kalina559 , We are regret about this inconvenience. We are working on this issue and update you soon.

Thanks,

kalina559 commented 1 year ago

Hi,

Has there been any progress on this issue?

Miss-PiA commented 1 year ago

Hi @kalina559

The issue has been fixed and we will make a new hotfix release as soon as possible

kalina559 commented 1 year ago

Hi,

When can the hotfix release be expected?

Miss-PiA commented 1 year ago

Hi @kalina559 Can you please check if your issue has been resolved in v2.7.1 release of the SDK?

kalina559 commented 1 year ago

Hi, unfortunately it didn't help, I'm still getting the same error when I'm using the the deprecated PiaSDK.getInstance().startPayPalProcess(this, bundle, createHandler())

I tried using the approach from your docs with ActivityResultLauncher, but I'm getting the same error.

Miss-PiA commented 1 year ago

Hi @kalina559

You are facing this issue only on test environment? And it's working fine on production environment, right?

kalina559 commented 1 year ago

I'm currently investigating how to implement PayPal into our app so I haven't even tried using it in production environment.

Miss-PiA commented 1 year ago

Hi @kalina559

We are currently discussing this issue with our backend team. We will update you once there's any progress on this problem.

kalina559 commented 1 year ago

Great, thanks for the update :)

Miss-PiA commented 1 year ago

Hi @kalina559 can you please check now, if it is working for you or not? Backend team has fixed the issue

kalina559 commented 1 year ago

Hi,

Now it's working! Thank you very much for the help :)

Miss-PiA commented 1 year ago

Great to hear that