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 115 forks source link

Paypal Data Collector com.paypal.android.sdk:data-collector: Consider upgrading to version com.braintreepayments.api:data-collector:3.21.0 of the SDK. #150

Closed BunnyBuddy closed 4 months ago

BunnyBuddy commented 4 months ago

Hi, we've been using the package for a long time and a few days ago we got the warning from PlayStore,

Screenshot 2024-02-19 at 1 08 03 PM

Screenshot 2024-02-19 at 1 08 37 PM

Can someone tell me how to resolve this?

claudius-kienle commented 4 months ago

The reason for this warning is that this package uses an old version of com.braintreepayments.api:drop-in.

For me, it was enough to just update the version of com.braintreepayments.api:drop-in to '6.13.0'.

This package with an updated version of com.braintreepayments.api:drop-in can be found at https://github.com/claudius-kienle/flutter-braintree. To automatically use that package, one can add following entry to dependency_overrides:

...
dependency_overrides:
  flutter_braintree:
    git: 
      url: https://github.com/claudius-kienle/flutter-braintree.git
      ref: 053a19e
BunnyBuddy commented 4 months ago

So if I just update the dependency it should work? Or do I need to handle any code changes?

claudius-kienle commented 4 months ago

It seems to work without any additional code changes. But I am only using the DropIn UI.

Always-Bijoy commented 4 months ago

@claudius-kienle thanks for sharing, I'm using it but one problem I face after update that, vault is not working, like in the payment request option if the amout = null, then it won't work but before update it's working like that, so did you check that. thank you

BunnyBuddy commented 4 months ago

I updated the drop in version but it broke the code I guess for me, it needs some changes in the code as well :(

pikaju commented 4 months ago

I believe this is closed by #145

BunnyBuddy commented 4 months ago

I believe this is closed by #145

Woahhh the legendery dev is back ??? :O

Always-Bijoy commented 4 months ago

@BunnyBuddy can you help me to solve the BraintreePayPalRequest

final dropInRequest = BraintreeDropInRequest(
      tokenizationKey: paymentBloc.clientToken,
      collectDeviceData: true,
      vaultManagerEnabled: true,
      requestThreeDSecureVerification: true,
      email: "test@email.com",
      billingAddress: BraintreeBillingAddress(
        givenName: "Jill",
        surname: "Doe",
        phoneNumber: "5551234567",
        streetAddress: "555 Smith St",
        extendedAddress: "#2",
        locality: "Chicago",
        region: "IL",
        postalCode: "12345",
        countryCodeAlpha2: "US",
      ),
      googlePaymentRequest: BraintreeGooglePaymentRequest(
        totalPrice: '4.20',
        currencyCode: 'USD',
        billingAddressRequired: false,
      ),
      applePayRequest: BraintreeApplePayRequest(
          currencyCode: 'USD',
          supportedNetworks: [
            ApplePaySupportedNetworks.visa,
            ApplePaySupportedNetworks.masterCard,
            // ApplePaySupportedNetworks.amex,
            // ApplePaySupportedNetworks.discover,
          ],
          countryCode: 'US',
          merchantIdentifier: '**********',
          displayName: '',
          paymentSummaryItems: []),
      paypalRequest: BraintreePayPalRequest(
          amount: 'null',
          billingAgreementDescription: "HandyX",
          displayName: 'HandyX'),
      cardEnabled: true,
    );

    BraintreeDropInResult? result = await BraintreeDropIn.start(dropInRequest);

this is the error StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7) E/flutter ( 5666): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18) E/flutter ( 5666): E/flutter ( 5666): #2 BraintreeDropIn.start (package:flutter_braintree/src/drop_in.dart:22:18) E/flutter ( 5666): E/flutter ( 5666): #3 _SourceListScreenState.addPaypal (package:handyx/views/settings/payment/payment_source_list_screen.dart:488:37) E/flutter ( 5666):

BunnyBuddy commented 4 months ago

Here's the deal, if updating com.braintreepayments.api:drop-in to '6.13.0'

breaks your code then try and update it to '5.4.2'

This issue of PlayStore not allowing apps is popping up everywhere on braintree_android_sdk and drop_in. https://github.com/braintree/braintree-android-drop-in/issues/460

I just read the discussion on their Github (you can too btw) and they recommend updating the code involving drop-in as well as the drop-in library to the latest versions.

Another thing is, remove all the app bundles (active or inactive whether it's in production or testing track) which have been flagged by PlayStore as non compliant with the PlayStore's privacy policy. Update the version of your app bundle and publish it.

If you still face the issue, then you can go for the appeal option provided by PlayStore.

I'll try and come back (hopefully with some good news).

BunnyBuddy commented 3 months ago

Okay we finally got through.

Change the library versions (and our code had to be updated as well because it was only fine upto 5.4.2) as follows in the build.gradle file.

implementation 'com.braintreepayments.api:drop-in:6.13.0'
implementation 'com.braintreepayments.api:data-collector:4.38.2'

Secondly, added this line our app's policy page "We only collect device data for Braintree (for the sole purpose of fraud detection)"

And also provided links to PayPal and Braintree's policy pages there.