Closed AbdrahumanFikry closed 2 years ago
Without additional information and a minimum reproducible code I cannot guess where's your problem. Here're some steps to do before filing an issue:
If you followed the above steps and the example app is crashing, let me know.
I followed the above steps and the example app is crashing. End points are working fine
the problem with the native code specially the function I have attached to the pervious comment .
The When Card is validated the app should open a web activity But this line :
CustomTabsClient.bindCustomTabsService(mActivity!!, CUSTOM_TAB_PACKAGE_NAME, mConnection);
is Always false and no web vies or callBack
@pr-Mais
It's crashing in the example app?
The code snippet you attached is not from this plugin.
line 172 HyperPayPlugin.kt
CustomTabsClient.bindCustomTabsService(mActivity!!, CUSTOM_TAB_PACKAGE_NAME, cctConnection);
@pr-Mais
I pushed a small fix in the example app, could you please pull and try again. Additionally, the crash I got was caused by an error with the example app package name, couldn't reproduce the case you're facing.
Didn't fix my problem I debugged the problem many Times and the problem with the function I sent you earlier it always return false so the callBack isn't working and I don't Know if the payment succussed or not
@pr-Mais
Could you please answer this question: the issue happens in the example app?
Pull and try from the original repository. You seem to have pushed many changes on your fork.
Could you please answer this question: the issue happens in the example app?
Pull and try from the original repository. You seem to have pushed many changes on your fork.
Get back to the steps I mentioned in my first comment, try running a test transaction with your configurations on the example app in this repository, not your fork, purely without changing anything else.
Once you do that, write the exact steps you followed that caused the crash.
Also, what's the version of the HyperPay Android SDK you have?
I have the same issue after calling
hyperpay.pay(card);
the plugin throws this exception
W/System.err(13521): java.lang.NullPointerException W/System.err(13521): at com.nyartech.hyperpay.HyperpayPlugin.transactionCompleted(HyperpayPlugin.kt:291) W/System.err(13521): at com.oppwa.mobile.connect.service.ConnectService.transactionCompleted(ConnectService.java:2) W/System.err(13521): at com.oppwa.mobile.connect.provider.OppPaymentProvider.a(OppPaymentProvider.java:64) W/System.err(13521): at com.oppwa.mobile.connect.provider.OppPaymentProvider.lambda$Z7rpKa2phFQX0DRjHjS8RQqzthY(Unknown Source:0) W/System.err(13521): at com.oppwa.mobile.connect.provider.-$$Lambda$OppPaymentProvider$Z7rpKa2phFQX0DRjHjS8RQqzthY.run(Unknown Source:8) W/System.err(13521): at java.lang.Thread.run(Thread.java:1012) E/AndroidRuntime(13521): FATAL EXCEPTION: Thread-4 E/AndroidRuntime(13521): Process: sa.example.fixit.staging, PID: 13521 E/AndroidRuntime(13521): java.lang.IllegalStateException: null️ E/AndroidRuntime(13521): at com.nyartech.hyperpay.HyperpayPlugin.transactionCompleted(HyperpayPlugin.kt:320) E/AndroidRuntime(13521): at com.oppwa.mobile.connect.service.ConnectService.transactionCompleted(ConnectService.java:2) E/AndroidRuntime(13521): at com.oppwa.mobile.connect.provider.OppPaymentProvider.a(OppPaymentProvider.java:64) E/AndroidRuntime(13521): at com.oppwa.mobile.connect.provider.OppPaymentProvider.lambda$Z7rpKa2phFQX0DRjHjS8RQqzthY(Unknown Source:0) E/AndroidRuntime(13521): at com.oppwa.mobile.connect.provider.-$$Lambda$OppPaymentProvider$Z7rpKa2phFQX0DRjHjS8RQqzthY.run(Unknown Source:8) E/AndroidRuntime(13521): at java.lang.Thread.run(Thread.java:1012) I/Process (13521): Sending signal. PID: 13521 SIG: 9 Lost connection to device. Failed to send request: {"jsonrpc":"2.0","id":"58","method":"getMemoryUsage","params":{"isolateId":"isolates/791169051683579"}}
@salahamassi I solved this Issue at https://github.com/AbdrahumanFikry/hyperpayPlugin
Unless you provide the exact steps you followed and a minimal reproducible code, we're unable to help you. I tried running a transaction in the example app on both platforms and it was successful.
I'll close the issue, feel free to comment if you have any helpful details.
@pr-Mais Please use the package in a new flutter app and not the example and you well get it
I'm using the package in an app that is running in production for a year now and I had no issues on both Android and iOS.
I cannot help you unless you tell me what exactly you did that led to this exception.
@pr-Mais I did exactly what I found in the package documentation and led to this exception!!
Create a repo with a minimal code that produces this exception for you and share it here please
@pr-Mais Please create a new flutter app and use the package and follow the package documentation and
What's the version of the Android HyperPay SDK you are using?
@pr-Mais 3.10.0
Just tried a new Flutter project and it's working as expected.
Worth noting that the plugin is tested against version 3.6.0 of the SDK (check here). I had to make some changes in the Android files to compile with v3.10.0, will update the docs shortly.
Here're the changes I did:
settings.gradle
:
configurations.maybeCreate("default")
artifacts.add("default", file('oppwa.mobile-3.10.0-release.aar'))
app/build.gradle
: set the compileSdkVersion
to 31Looking closely at the exception you're getting, I can see java.lang.NullPointerException
, which indicates a required value by the pay
method is being passed as null
.
Have you tried printing the checkoutID
and made sure it's not null
?
Dear Mais ,
Please talk to the Android Developer Who coded this file and let him fix this issue java.lang.NullPointerException
I already solved here [https://github.com/AbdrahumanFikry/hyperpayPlugin/blob/main/android/src/main/kotlin/com/nyartech/hyperpay/HyperpayPlugin.kt](https://github.com/nyartech/hyperpay/issues/url)
and here too https://github.com/AbdrahumanFikry/hyperpayPlugin/blob/main/android/src/main/AndroidManifest.xml
The issue is caused by Browser 1.3.0 on Android API 30 and above. A fix will be published soon.
@AbdrahumanFikry thanks for reporting, such detail about the environment that produced the issue could have helped much earlier.
` private fun bindCustomTabsService() { if (mClient != null) return try { val mConnection = object : CustomTabsServiceConnection() { override fun onCustomTabsServiceConnected(name: ComponentName, client: CustomTabsClient) { Log.d(TAG, "onCustomTabsServiceConnected CustomTabsClient = $mClient"); mClient = client mClient!!.warmup(0L); }
bindCustomTabsServiceis always False !!
@pr-Mais