datatrans / android-sdk

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.
Other
6 stars 0 forks source link

NumberFormatException on PlaceholderTextField #16

Closed andreaMOnline closed 11 months ago

andreaMOnline commented 1 year ago

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)

luiscosta commented 1 year ago

Hello @andreaMOnline,

We will look into it.

Thank you for reporting it!

luiscosta commented 11 months ago

Hello @andreaMOnline,

This should no longer occur on the new SDK version 3.3.0.

I'm closing the issue.