2
votes

We developing app for food ordering. In this case we implemented Braintree payment. All is well. The next step is to implement Google Pay (I pay your attention, NOT Android Pay). I used this documentation: Braintree Docs: https://developers.braintreepayments.com/guides/pay-with-google/configuration/android/v2

Google PwG Docs: https://developers.google.com/payments/setup

This how do we implemented Google Pay:

private GooglePaymentRequest getGooglePaymentRequest(String total) {
    return new GooglePaymentRequest()
            .transactionInfo(TransactionInfo.newBuilder()
                    .setTotalPrice(total)
                    .setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
                    .setCurrencyCode("AUD")
                    .build())
            .emailRequired(false)
            .shippingAddressRequired(false)
            .phoneNumberRequired(false)
            .allowPrepaidCards(true)
            .billingAddressRequired(false);
}

And use:

String total = String.format(Locale.getDefault(), "%1$.2f", basket.total);

    DropInRequest dropInRequest = new DropInRequest()
            .clientToken(clientToken)
            .amount(total)
            .googlePaymentRequest(getGooglePaymentRequest(total))
            .collectDeviceData(true);

    getMvpView().showBraintreePaymentScreen(dropInRequest);

In this case we got two situations: On my colleague's device all is working well (video: https://drive.google.com/open?id=1wEXbv8qzGXzuXWDUy7-bhIdud_4H_s2V)

On my side I got crash (video: https://drive.google.com/open?id=15gvtkNGZ9w6v1ym7cDkwWCnqHh5JUvL7)

After this I started debug and observed next situation: enter image description here

As you see in Braintree's BaseActivity I got exception with statusCode=10 that means DEVELOPER_ERROR.

So is anyone have thoughs how it can be fixed?

1
Edited. Removed screenshots, added source parts. - lazexe
Just to confirm, are you running the same version of the code on each device? What are the differences between your device & location and your colleague's? - Shea
Yes, we are running the same code on each device. Devices: Nexus 5X (my) and Nexus 6p (his). Location: same country (300km distance between us) - lazexe

1 Answers

7
votes

I ran into the same error implementing Google Pay and I found the answer to my problem here: https://developers.google.com/pay/api/android/support/troubleshooting

Quote:

The most common error message is ERROR_CODE_DEVELOPER_ERROR. This error message also appears in the UI as a dialog with the following text:

Request Failed An unexpected error has occurred. Please try again later.

To learn more about this error, follow these steps:

  1. Make sure ADB is installed on your computer.
  2. Make sure USB debugging is enabled on your device.
  3. Connect your phone to the computer using a USB cable.
  4. Run the following command in a terminal or command prompt on your computer:

adb -d logcat -s WalletMerchantError

The response indicates the underlying reason for the error. For example, you may see:

02-26 17:41:28.133 14593 14593 W WalletMerchantError: Error in loadPaymentData: This merchant profile does not have access to this feature.

Note: The error only becomes visible in logcat after you've pressed OK to close the alert.

The action you need to take to resolve the issue depends on the error message.