Code Monkey home page Code Monkey logo

android-sdk's Introduction

Datatrans Android SDK

Version License Platform

Accept payments on your Android apps: Our mobile SDKs support your entire payment and registration process and simplify the integration of any payment method in your mobile apps. Completely outsource your payment processes to us from inside your native apps. We also take care of redirecting your users to 3D Secure processes and enable smooth app-switches to other payment applications including Twint and PostFinance.

Features

Easy Integration: Integrate many of our payment methods easily to your iOS projects. Smart, modern and secure UI components to master online payments in your apps.

Card Scanner: Let your customers scan their card information easily with our prebuilt card scanner. No time wasted with entering card information.

3DS 2.0 / SCA Ready: The Android SDK takes over the complexity of the 3DS process. We remain in charge of redirecting users whenever a 3D authorization is required to the 3DS process of their bank and back to the SDK.

Smooth App-Switch: Do you offer payment methods like Twint or PayPal that require the user to confirm the payment in a separate mobile app? The library switches smoothly to external apps and back to the SDK.

Tokens and Fast Checkouts: Save your customers' payment information for later use and offer fast checkouts in your app. Delegate the token selection to the library.

Theme Support: Style various items according to your corporate identity if needed. We also support the iOS dark theme.

Integration

Get started with our integration guide.

Requirements

The Datatrans Android SDK is compatible with apps targeting Android API 21 or above.

android-sdk's People

Contributors

luiscosta avatar paschmid avatar sc4rlite avatar vscherer-ieffects avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sdk's Issues

Visa/Mastercard payment crash on Android 5.0

Hi, we got a crash on Android 5.0 with credit card payment.

Top of stacktrace:

    java.lang.NoSuchMethodError: No virtual method getTextSizeUnit()I in class Landroid/widget/TextView; or its super classes (declaration of 'android.widget.TextView' appears in /system/framework/framework.jar:classes2.dex)
        at ch.datatrans.payment.creditcard.PlaceholderTextField.a(SourceFile:13)
        at ch.datatrans.payment.creditcard.PlaceholderTextField$$ExternalSyntheticLambda2.onGlobalLayout(D8$$SyntheticClass)

getTextSizeUnit was added in Android 30

image

SDK Improvements

Hi,

I was wondering if you are planning to improve the error handling of a given transaction, by maybe showing in the UI a more detailed error than just "Your payment could not be authorised".

We want to show to the users a detailed message explaining why a payment failed, but from the SDK we are only getting an exception with a message with some numeric error.
e.g:

declined (Declined, error code: 1403)
card blocked (Declined - card blocked, error code: 1404)

Note: These messages are not localised, they are always in English.

And about localisation, would it be possible to allow us to set the language that should be used by the SDK? Now it is taking the language from the device, but for those app (as ours) where you can customise the language within the app, then the language can be different.

Thanks!
Germán

FragmentStrictMode enabled for WrongFragmentContainerViolation reveals some violations

Enable FragmentStrictMode with at least detectWrongFragmentContainer, it will result with following issues:

FATAL EXCEPTION: main
Process: x.y.z.debug, PID: 4765
androidx.fragment.app.strictmode.WrongFragmentContainerViolation: Attempting to add fragment b0{3181ad7} (360e18a9-c1ee-4da1-8931-3bc4e4c518a6 id=0x7f0a0204 tag=PAYMENT_METHOD_ALIAS_SELECTION) to container android.widget.FrameLayout{4f09110 V.E...... ......ID 0,154-1080,154 #7f0a0204 app:id/container} which is not a FragmentContainerView
    at androidx.fragment.app.strictmode.FragmentStrictMode.onWrongFragmentContainer(FragmentStrictMode.kt:204)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:519)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
FATAL EXCEPTION: main
Process: x.y.z.debug, PID: 18467
androidx.fragment.app.strictmode.WrongFragmentContainerViolation: Attempting to add fragment d{d640e8e} (7d1fbf52-c97c-460f-a7bb-7bb186d164dd id=0x7f0a0205 tag=CREDIT_CARD) to container android.widget.FrameLayout{216ab7a V.E...... ......ID 0,147-1080,147 #7f0a0205 app:id/container} which is not a FragmentContainerView
    at androidx.fragment.app.strictmode.FragmentStrictMode.onWrongFragmentContainer(FragmentStrictMode.kt:204)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:519)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:230)
    at android.os.Looper.loop(Looper.java:319)
    at android.app.ActivityThread.main(ActivityThread.java:8893)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
 ``

Credit Card Number entry field too small using OnePlus Font

On OnePlus Nord Device the credit card number entry field is too small when using the default OnePlus font. The last 2 digits of credit card number (16 digits) is not visible.

Expected Behaviour: Using the OnePlus font or any other the entry field should show all 16 digits of a credit card

Device Information:
OnePlus Nord AC2003
Android-Version: 12 (same issue on 11)
One Plus Font: Default
Datatrans SDK Version: 2.0.
Datatrans
Schriftart

The SDK cannot be downloaded from JFrog

Hi,

We are getting the following error when building the project in our pipeline:

> Could not resolve ch.datatrans:android-sdk:3.1.1.
> Could not get resource 'https://datatrans.jfrog.io/artifactory/mobile-sdk/ch/datatrans/android-sdk/3.1.1/android-sdk-3.1.1.pom'.
> Could not GET 'https://landing.jfrog.com/reactivate-server/datatrans'. Received status code 409 from server: Conflict

The page https://datatrans.jfrog.io/artifactory/mobile-sdk is redirecting to https://landing.jfrog.com/reactivate-server/datatrans and is showing the following message: "Enter the email used to register for the free JFrog subscription to reactivate the account".

Everything was working fine until today.
Is this something that needs to be fixed on your side?

Thanks!

NullpointerException in TwintFlowFragment (Test)

A crash happens with:
Datatrans Mobile SDK 3.1.0 (Android 12/target=33)
Datatrans Mobile SDK 3.1.1 (Android 12/target=33)
Datatrans Mobile SDK 3.1.0 (Android 13/target=33)
Datatrans Mobile SDK 3.1.1 (Android 13/target=33)

During viewModel creation of TwintFlowFragment in
ch.datatrans.payment.bottomsheet.TransactionSheetActivity

Twint Configurable 36.1.0.1/37.0.018 is installed on PAT environment

Crash Details:
java.lang.NullPointerException at a.a.a.p.h.b.<init>(SourceFile:18) at a.a.a.p.h.f.create(SourceFile:2) at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.kt:83) at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187) at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153) at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:53) at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35) at a.a.a.p.h.a.c(SourceFile:1) at a.a.a.p.h.a.d(SourceFile:1) at a.a.a.p.h.a.onActivityCreated(SourceFile:3) at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:3156) at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:619) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:275) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1839) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782) at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565) at android.os.Handler.handleCallback(Handler.java:938) 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:8751) 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:1135)

Recording:
pixel_6_API33_recording.webm

Crash after launching data trans transaction

Hello, we have recently deployed DataTrans SDK into production and we can see two crashes in our crashlytics (but both are very rare)

First: Samsung Galaxy M34 (Android 12)
Fatal Exception: java.lang.IllegalStateException: Fragment m{16f7760} (95f184f7-9430-4af6-a2f8-5fc62ab76bbe) not attached to an activity. at androidx.fragment.app.Fragment.requireActivity(Fragment.java:995) at a.a.a.j.n.a.b(SourceFile:3) at android.os.Handler.handleCallback(Handler.java:938) 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:8751) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Second: Redmi Note 10 Pro (Android 13)
Fatal Exception: java.lang.NullPointerException: at a.a.a.j.d.e(SourceFile:34) at a.a.a.j.d.onViewCreated(SourceFile:2) at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3128) at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:552) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261) at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1424) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2968) at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2886) at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:351) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1564) at android.app.Activity.performStart(Activity.java:8555) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3859) 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:2394) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8296) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)

Both crashes were encountered on version 3.2.0
Since the code is obfuscated we have no clue what's wrong so I'm sending it to you for further investigation (if you are interested).

NumberFormatException on PlaceholderTextField

Hi there
We encountered this error on our Crashlytics related to datatrans library v 3.2.0. Could happen maybe on user input from copy paste feature:

Fatal Exception: java.lang.NumberFormatException: For input string: "4435 9281"
at java.lang.Integer.parseInt(Integer.java:747)
at java.lang.Integer.parseInt(Integer.java:865)
at a.a.a.p.a.b.a(SourceFile:2)
at ch.datatrans.payment.paymentmethods.PaymentMethodType$Companion.getPaymentMethodTypesByPrefix$lib_release(SourceFile:199)
at a.a.a.j.n.a.a(SourceFile:586)
at a.a.a.j.n.b.invoke(SourceFile:245)
at ch.datatrans.payment.creditcard.PlaceholderTextField$b.afterTextChanged(SourceFile:9)
at android.widget.TextView.sendAfterTextChanged(TextView.java:11081)
at android.widget.TextView.setText(TextView.java:6648)
at android.widget.TextView.setText(TextView.java:6454)
at android.widget.EditText.setText(EditText.java:122)
at android.widget.TextView.setText(TextView.java:6406)
at android.widget.TextViewOnReceiveContentListener.onReceiveForAutofill(TextViewOnReceiveContentListener.java:139)
at android.widget.TextViewOnReceiveContentListener.onReceiveContent(TextViewOnReceiveContentListener.java:81)
at android.widget.TextView.onReceiveContent(TextView.java:14240)
at android.view.View.performReceiveContent(View.java:9245)
at android.widget.TextView.autofill(TextView.java:12269)
at ch.datatrans.payment.creditcard.DateAutofillEditText.autofill(SourceFile:5)
at android.view.autofill.AutofillManager.autofill(AutofillManager.java:2575)
at android.view.autofill.AutofillManager.-$$Nest$mautofill()
at android.view.autofill.AutofillManager$AutofillManagerClient.lambda$autofill$1(AutofillManager.java:3804)
at android.view.autofill.AutofillManager$AutofillManagerClient$$ExternalSyntheticLambda2.run(:10)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7918)
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:942)

Obfuscated package names should be repackaged in a default package name to avoid naming clashes

As seen in this image, the obfuscated package names inside the datatrans sdk ("a", "a0", "b", etc...) are at the root of the classes.jar. This means that classes like a.a have a high chance of having duplicate class names in other (obfuscated) dependencies. And if another dependency uses the same naming, we can get clashes in class names.

image

For example, the instabug library also had all their obfuscated class names existing on the root (by mistake) and that lead to release build errors as such (until they fixed it):
Duplicate class a.a found in modules android-sdk-3.3.0-runtime (ch.datatrans:android-sdk:3.3.0) and instabug-apm-okhttp-interceptor-12.3.1-runtime (com.instabug.library:instabug-apm-okhttp-interceptor:12.3.1)

I suggest that you repackage classes (the ones that you wish to obfuscate) into a unique package, for example ch.datatrans. Then instead of having classes like a.a, it will be ch.datatrans.a.a which should be unique in the project and should have a very low change of duplicate class names with other (thirdparty) dependencies.

Maybe you can look into something like this: https://www.guardsquare.com/manual/configuration/usage#repackageclasses

Gradle 4.2.0 build tool chain issue.

Hi,

We are trying to build the library with gradle 4.2.0, and getting some tool chain issues.
We have tried with gradle 3.5.4 and it's working smoothly.

Is the library depend on gradle 3.x.x?

[request for documentation] The integration of library version 3.5.0

Hello
We would like to upgrade to latest version 3.5.0 and implement the Transaction.subscribe request model. Unfortunately due to lack of documentation in the integration guide we could not complete it to 100%. Specifically it is not clear how to set the properties of the transaction in a static way.

Also there was a breaking change: the Exception TWINTNotInstalledException was removed (without deprecation notice?). Instead we use now ??AppNotInstalledException??.

Unable build with React Native.

I'm trying to use the Android sdk with a react native project, but during compilation, this gives the following error.

`> Task :app:processDebugResources FAILED
165 actionable tasks: 4 executed, 161 up-to-date

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_activity.xml:10: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka ch.mysponsor.android:layout_constraintBottom_toBottomOf) not found.

 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_activity.xml:10: AAPT: error: attribute layout_constraintEnd_toEndOf (aka ch.mysponsor.android:layout_constraintEnd_toEndOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_activity.xml:10: AAPT: error: attribute layout_constraintStart_toStartOf (aka ch.mysponsor.android:layout_constraintStart_toStartOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_activity.xml:10: AAPT: error: attribute layout_constraintWidth_max (aka ch.mysponsor.android:layout_constraintWidth_max) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:5: AAPT: error: attribute layout_constraintTop_toTopOf (aka ch.mysponsor.android:layout_constraintTop_toTopOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:12: AAPT: error: attribute layout_constrainedHeight (aka ch.mysponsor.android:layout_constrainedHeight) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:12: AAPT: error: attribute layout_constraintBottom_toTopOf (aka ch.mysponsor.android:layout_constraintBottom_toTopOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:12: AAPT: error: attribute layout_constraintTop_toBottomOf (aka ch.mysponsor.android:layout_constraintTop_toBottomOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:20: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka ch.mysponsor.android:layout_constraintBottom_toBottomOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:20: AAPT: error: attribute layout_constraintTop_toTopOf (aka ch.mysponsor.android:layout_constraintTop_toTopOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:28: AAPT: error: attribute layout_constraintBottom_toTopOf (aka ch.mysponsor.android:layout_constraintBottom_toTopOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_bottom_sheet_content.xml:35: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka ch.mysponsor.android:layout_constraintBottom_toBottomOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:10: AAPT: error: attribute layout_constraintEnd_toEndOf (aka ch.mysponsor.android:layout_constraintEnd_toEndOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:10: AAPT: error: attribute layout_constraintStart_toStartOf (aka ch.mysponsor.android:layout_constraintStart_toStartOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:10: AAPT: error: attribute layout_constraintTop_toTopOf (aka ch.mysponsor.android:layout_constraintTop_toTopOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:35: AAPT: error: attribute flow_horizontalAlign (aka ch.mysponsor.android:flow_horizontalAlign) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:80: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka ch.mysponsor.android:layout_constraintBottom_toBottomOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:80: AAPT: error: attribute layout_constraintEnd_toEndOf (aka ch.mysponsor.android:layout_constraintEnd_toEndOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:80: AAPT: error: attribute layout_constraintStart_toStartOf (aka ch.mysponsor.android:layout_constraintStart_toStartOf) not found.
     
 /home/azim/.gradle/caches/transforms-2/files-2.1/28dce21dcecee832fc7e0d142cd899ae/jetified-datatrans-android-1.0.0/res/layout/dtpl_credit_card_date_cvv_fragment.xml:80: AAPT: error: attribute layout_constraintTop_toBottomOf (aka ch.mysponsor.android:layout_constraintTop_toBottomOf) not found.`

SDK has conflicting networkSecurityConfig

Hi,

Today we tried to upgrade from SDK version 2.1.0 to 2.3.3 but the project cannot be compiled because from version 2.2.0 you added a custom networkSecurityConfig which is conflicting with another configuration.

You shouldn't do this in a library, at least not in "release". If you want to customise the network config you should do it only for debug.

Could not find com.klarna.mobile:sdk:2.1.8 (version 2.2.0 and 2.3.0)

With the version 2.3.0, Gradle can't find com.klarna.mobile:sdk:2.1.8.

implementation("ch.datatrans:android-sdk:2.3.0")

error:

9: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.klarna.mobile:sdk:2.1.8.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/klarna/mobile/sdk/2.1.8/sdk-2.1.8.pom
       - https://repo.maven.apache.org/maven2/com/klarna/mobile/sdk/2.1.8/sdk-2.1.8.pom
       - https://jitpack.io/com/klarna/mobile/sdk/2.1.8/sdk-2.1.8.pom
       - https://datatrans.jfrog.io/artifactory/mobile-sdk/com/klarna/mobile/sdk/2.1.8/sdk-2.1.8.pom
     Required by:
         project :app > ch.datatrans:android-sdk:2.3.0

Back on card payment make the SDK unusable

Hi,
We found a bug with the card payment process.

Steps to reproduce:

  • Start a payment with VISA, Mastercard or AMEX
  • The bottom sheet open, asking for card numbers
  • Close the keyboard and do a system back (with the button or with gesture)
  • 💥 The SDK is unusable. We don't receive any callback onTransactionError nor onTransactionCancel. startTransaction doesn't work anymore.

UPDATE / TL;DR: This is caused by predictive back gesture feature (enableOnBackInvokedCallback)

Swiss Francs wrong decimal separator

For Swiss currencies, we expect them to be formatted like this:
#'###.##
However, if I select a Swiss German locale for my app, the currency is formatted as this:
#.###,##
I will attach a screen shot where in the top it is shown how we format it and how data trans is formatting it.
Because of the thousand grouping, it looks to me like the Swiss country is not being taken into account in the formatting.
Screenshot_20230901_150646

SDK version: 3.2.0

Swissbilling terms link doesn't work

Hi,

The link to the terms of SWB doesn't work.
When we tap on it, we get an error.

This is reproductible at 100% on all devices that we tested.

image
image

SDK fails with domain-specific network_security_config

We intend to use public key pinning for connections to our backend. Consequently, our network_security_config.xml contains entries such as:

  <domain-config cleartextTrafficPermitted="false">
    <domain includeSubdomains="false">[domain]</domain>
    <pin-set>
      <pin digest="SHA-256">[hash1]</pin>
      <pin digest="SHA-256">[hash2]</pin>
    </pin-set>
  </domain-config>

However, as soon as we use such a domain-specific config, an SSLHandshakeException gets thrown in the SDK, stating: Domain specific configurations require that hostname aware checkServerTrusted(X509Certificate[], String, String) is used. In the frontend, an error message is displayed, stating that no secure connection could be established.

Note: I could explicity see the exception in the onTransactionError-Method when using SDK version 2.2.1, while in version 3.0.2, I can only ever end up in onTransationCancel(), where I can't see the exception information. However, I strongly suspect that the issue is the same.

Android: Camera permission issue

If a user declines camera permission twice while using the credit card form (indicated by a photo icon), subsequent attempts to request permission won't trigger a popup prompting for camera access. do we have any solution to navigate to the Settings app to enable camera permission manually by clicking the photo icon button?

Visa/Mastercard payment crash with 2.3.1

Hi,

We got a crash with the version 2.3.1 when we try to pay with Visa or Mastercard:

E  FATAL EXCEPTION: main
Process: ch.alpsoft.qoqa.ui.debug, PID: 14520
java.lang.NullPointerException: findViewById(R.id.list) must not be null
	at ch.datatrans.payment.bottomsheet.TransactionSheetActivity.a(SourceFile:425)
	at ch.datatrans.payment.bottomsheet.TransactionSheetActivity$$ExternalSyntheticLambda3.onChanged(Unknown Source:6)
	at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
	at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151)
	at androidx.lifecycle.LiveData.setValue(LiveData.java:309)
	at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
	at androidx.lifecycle.LiveData$1.run(LiveData.java:93)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7898)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

[3.0.2] Crash with GooglePayCustomerInfo & R8

We have a crash with the last version (3.0.2) when we pay with Google Pay with R8 enabled.

GSON can't find the no-arg constructor because it was shrinked by R8.
The workaround is to add this to our proguard configuration.

-keep class ch.datatrans.payment.paymentmethods.GooglePayCustomerInfo {
  public <init>(...);
}

Can you please add this rule to the SDK?

Stacktrace:

Fatal Exception: java.lang.RuntimeException: Unable to create instance of class ch.datatrans.payment.paymentmethods.GooglePayCustomerInfo. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem.
       at com.google.gson.internal.ConstructorConstructor$16.construct(ConstructorConstructor.java:275)
       at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:211)
       at com.google.gson.Gson.fromJson(Gson.java:991)
       at com.google.gson.Gson.fromJson(Gson.java:956)
       at com.google.gson.Gson.fromJson(Gson.java:905)
       at com.google.gson.Gson.fromJson(Gson.java:876)
       at a.a.a.p.b.e.a(SourceFile:490)
       at a.a.a.p.b.c$b.invokeSuspend(SourceFile:7)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith(DispatchedContinuation.java:254)
       at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:280)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
       at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
       at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
       at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
       at kotlinx.coroutines.BuildersKt.launch(Builders.kt:1)
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
       at kotlinx.coroutines.BuildersKt.launch$default(Builders.kt:1)
       at a.a.a.p.b.c.onActivityResult(SourceFile:1)
       at ch.datatrans.payment.bottomsheet.TransactionSheetActivity.onActivityResult(SourceFile:19)
       at android.app.Activity.dispatchActivityResult(Activity.java:8664)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:5328)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:5374)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)
       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)

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.