pikaju / flutter-braintree

Flutter plugin that wraps the native Braintree SDKs. Enables payments with credit cards, PayPal, Google Pay and more.
https://pub.dev/packages/flutter_braintree
MIT License
64 stars 126 forks source link

Edit package to follow guidelines for transition to 3ds 2.0 #126

Closed nicolobozzato closed 1 year ago

nicolobozzato commented 2 years ago

In mid-October 2022, 3DS 1.0 will be officially deprecated by all major card providers, making EMV 3DS (commonly called 3DS 2.0) the new standard in 3D Secure authentication protocol. https://www.paypal.com/uk/smarthelp/article/faq4728

This PR edit the package to follow the guide to ensure best chances of success with 3DS 2.0 as stated here https://developer.paypal.com/braintree/docs/guides/3d-secure/migration

It adds the model BraintreeBillingAddress and the parameter email and billingAddressto the BraintreeDropInRequest

Related to issue https://github.com/pikaju/flutter-braintree/issues/125

nicolobozzato commented 1 year ago

Still crashing on Android when page requiring code appear

E/AndroidRuntime(29896): FATAL EXCEPTION: main E/AndroidRuntime(29896): Process: com.**************.dev, PID: 29896 E/AndroidRuntime(29896): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.**************.dev/com.braintreepayments.api.ThreeDSecureActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. E/AndroidRuntime(29896): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2804) E/AndroidRuntime(29896): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2875) E/AndroidRuntime(29896): at android.app.ActivityThread.-wrap12(ActivityThread.java) E/AndroidRuntime(29896): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578) E/AndroidRuntime(29896): at android.os.Handler.dispatchMessage(Handler.java:105) E/AndroidRuntime(29896): at android.os.Looper.loop(Looper.java:156) E/AndroidRuntime(29896): at android.app.ActivityThread.main(ActivityThread.java:6617) E/AndroidRuntime(29896): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(29896): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) E/AndroidRuntime(29896): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) E/AndroidRuntime(29896): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. E/AndroidRuntime(29896): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:843) E/AndroidRuntime(29896): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:806) E/AndroidRuntime(29896): at androidx.appcompat.app.AppCompatDelegateImpl.onPostCreate(AppCompatDelegateImpl.java:527) E/AndroidRuntime(29896): at androidx.appcompat.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:127) E/AndroidRuntime(29896): at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1204) E/AndroidRuntime(29896): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2786) E/AndroidRuntime(29896): ... 9 more

UPDATE Fixed by adding this activity in the manifest <activity android:name="com.braintreepayments.api.ThreeDSecureActivity" android:theme="@style/Theme.AppCompat.Light"> </activity>

Edited readme and example accordingly