GithubHelp home page GithubHelp logo

processout-android's Introduction

ProcessOut Go

GoDoc

Installation

go get gopkg.in/processout.v4

Versioning

Versioning is done using gopkg.in, available at gopkg.in/processout.v4.

processout-android's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

processout-android's Issues

Crash while trying to parse an unexpected server response

On March 18th 2022, ProcessOut's backend had some downtime and the SDK was receiving an unexpected response.
This caused a spike of crashes in Glovo's customer app due to the SDK not being able to properly handle an empty/unexpected response.
This exception should be catched and call the error callback to avoid crashing client applications.

The stacktrace from those crashes is the following:

Fatal Exception: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
       at com.google.gson.Gson.fromJson(Gson.java:963)
       at com.google.gson.Gson.fromJson(Gson.java:928)
       at com.google.gson.Gson.fromJson(Gson.java:877)
       at com.google.gson.Gson.fromJson(Gson.java:848)
       at com.processout.processout_sdk.Network$2.onErrorResponse(Network.java:80)
       at com.android.volley.Request.deliverError(Request.java:617)
       at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:104)
       at android.os.Handler.handleCallback(Handler.java:900)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loop(Looper.java:219)
       at android.app.ActivityThread.main(ActivityThread.java:8393)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
Caused by java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
       at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:384)
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
       at com.google.gson.Gson.fromJson(Gson.java:963)
       at com.google.gson.Gson.fromJson(Gson.java:928)
       at com.google.gson.Gson.fromJson(Gson.java:877)
       at com.google.gson.Gson.fromJson(Gson.java:848)
       at com.processout.processout_sdk.Network$2.onErrorResponse(Network.java:80)
       at com.android.volley.Request.deliverError(Request.java:617)
       at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:104)
       at android.os.Handler.handleCallback(Handler.java:900)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loop(Looper.java:219)
       at android.app.ActivityThread.main(ActivityThread.java:8393)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

Initialization crash

Hi mates! we are experiences a HUGE amount of crashes within our latest release, using your 3DS sdk. Let me paste the trace:

Caused by java.lang.ClassNotFoundException: Didn't find class "com.checkout.threeds.sec.PackageUpdateBroadcastReceiver" on path: DexPathList[[zip file "/data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/base.apk", zip file "/data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.arm64_v8a.apk", zip file "/data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.en.apk", zip file "/data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/lib/arm64, /data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/base.apk!/lib/arm64-v8a, /data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.en.apk!/lib/arm64-v8a, /data/app/~~Z2_Rcn-n6_ygT4MpjMUr8g==/com.feverup.fever-OP_kL6N4LYa0pY36sgULGw==/split_config.xxhdpi.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
       at android.app.AppComponentFactory.instantiateReceiver(AppComponentFactory.java:110)
       at androidx.core.app.CoreComponentFactory.instantiateReceiver(CoreComponentFactory.java:60)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:4282)
       at android.app.ActivityThread.-$$Nest$mhandleReceiver()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2149)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7884)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Versions:
'com.processout:processout-android:4.2.0'
'com.processout:processout-android-checkout-3ds:4.2.0'
Transitive dep:
image

This happens the first time the app is opened after the update, after that the crash does not appear.
Seems that this class doesn't exist, but is referenced in the manifest :S

POCustomTabAuthorizationActivity is stuck in redirect loop if the activity is being destroyed.

Hello team!

This issue happens in the latest SDK 4.7.0 with CustomTabs enabled.
I'm testing web payments with POAlternativePaymentMethodCustomTabLauncher and the Don't Keep Activities debug option enabled. Once payment is authorized and POCustomTabAuthorizationActivity is opened back by a redirect link, it launches the payment web page again.

It happens because CustomTabAuthorizationViewModel is recreated, doesn't restore its state (Launched), and uses "CustomTabAuthorizationUiState.Initial" instead. Which launches the URI again:

if (uiState == Initial) {
            _uiState.value = Launching(configuration.uri)
            return
        }

PO3DSRedirectCustomTabLauncher and POAlternativePaymentMethodCustomTabLauncher are not process death resilient

The current implementation of the PO3DSRedirectCustomTabLauncher and POAlternativePaymentMethodCustomTabLauncher doesn't allow resubscribing without calling the launch() method again.
If the process is recreated, then it's possible to resubscribe to the activity result by calling PO3DSRedirectCustomTabLauncher.create(), but in that case, the delegate field will not be initialized, which causes the crash.

FATAL EXCEPTION: main
    Process: com.processout.example.staging.debug, PID: 8366
    java.lang.RuntimeException: Unable to create application com.processout.example.ProcessOutExampleApplication: java.lang.ClassCastException
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    Caused by: java.lang.ClassCastException
        at androidx.appcompat.app.ToolbarActionBar$$ExternalSyntheticThrowCCEIfNotNull0.m(R8$$SyntheticClass:0)
        at com.processout.sdk.di.NetworkGraphImpl.<init>(NetworkGraph.kt:58)
        at com.processout.sdk.api.ProcessOut$Companion.configure(ProcessOut.kt:72)
        at com.processout.example.ProcessOutExampleApplication.onCreate(ProcessOutExampleApplication.kt:11)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858

Is it possible to move callback: (ProcessOutResult<String>) -> Unit from the launch() method to the create()? To follow the same approach as in the PONativeAlternativePaymentMethodLauncher.

JCenter support

At the moment the library requires volley that is available only in jCenter which will be closed 1 of May

React native deep link handler

Hi, Im integrating this sdk into a react native project.
Need help with deep link handler.
Processout and Processout3DS is configured, app successfully runs card tokenization and does 3DS verification, but when browser is closed I do not receive any results.
I have a feeling that react native deep link handler captures event before Processout
Is there any way to manually trigger handler like it is possible in ios sdk?
On IOS side I was able to capture deep link in react js and then call handler through a bridge on a native side

  @ReactMethod
  fun assignCustomerToken(customerId: String, token: String, source: String, returnUrl: String, successCallback: Callback, errorCallback: Callback) {
    val request = POAssignCustomerTokenRequest(customerId, tokenId = token, source, verify = true)
    val threeDSService = create3DSService(returnUrl)

    scope.launch {
      ProcessOut.instance.customerTokens.assignCustomerTokenResult.collect { result ->
        when (result) {
          is ProcessOutResult.Success -> {
            successCallback.invoke(result.value.id)
            cancel()
          }

          is ProcessOutResult.Failure -> {
            errorCallback.invoke(result.message)
            cancel()
          }
        }
      }
    }
    ProcessOut.instance.customerTokens.assignCustomerToken(
      request,
      threeDSService,
    )
  }

ClassCastException when enabling R8 fullMode

Hey!

We are trying to enable R8 fullMode in our app and we're getting a weird ClassCastException (see stacktrace below) when initializing the ProcessOut SDK via the ProcessOut.configure(...) method.

I was able to reproduce this issue in ProcessOut's test app (see this branch with the details)

The steps to reproduce are the following:

  1. Enable minifying and shrinkResources
minifyEnabled true
shrinkResources true
  1. Add the following line to gradle.properties:
android.enableR8.fullMode=true
  1. Run the app, it will crash while starting.

Stacktrace

FATAL EXCEPTION: main
    Process: com.processout.example.staging.debug, PID: 8366
    java.lang.RuntimeException: Unable to create application com.processout.example.ProcessOutExampleApplication: java.lang.ClassCastException
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    Caused by: java.lang.ClassCastException
        at androidx.appcompat.app.ToolbarActionBar$$ExternalSyntheticThrowCCEIfNotNull0.m(R8$$SyntheticClass:0)
        at com.processout.sdk.di.NetworkGraphImpl.<init>(NetworkGraph.kt:58)
        at com.processout.sdk.api.ProcessOut$Companion.configure(ProcessOut.kt:72)
        at com.processout.example.ProcessOutExampleApplication.onCreate(ProcessOutExampleApplication.kt:11)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
        at android.app.ActivityThread.access$1100(ActivityThread.java:199) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858

Jitpack instability

Hello team!

Last year we have some lack of stability downloading dependencies from jitpack. There Is any plan to start working with Maven Central instead Jitpack?

Looking at uptime status from both repositories, we can clearly see that jitpack is around 96%/97% uptime and even 84%.

image
image

Is we check the uptime status from Maven Central, on the same month intervals, we can see there is almost no downtime at all.

image
image

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.