braintree / braintree_android

Braintree SDK for Android
https://developer.paypal.com/braintree/docs/start/hello-client/android/v4
MIT License
403 stars 232 forks source link

Payment label and amount is visible somewhat randomly #998

Closed jupblb closed 3 months ago

jupblb commented 4 months ago

Braintree SDK Version

4.41.0

Environment

Sandbox

Android Version & Device

Google Pixel 7

Braintree dependencies

N/A: Using braintree_android only

Describe the bug

When running the Demo from this repository with Google Pay, the Google Pay flow doesn't always show payment label and amount (the horizontal part with "Braintree Demo Payment" string). It's not clear how to configure the GooglePayRequest to always show it.

To reproduce

  1. Open the Demo app
  2. Enter Google Pay
  3. Click the Google Pay button
  4. Cancel payment
  5. Change something in settings
  6. Click the Google Pay button

Expected behavior

The Google Pay flow always shows the "Braintree Demo Payment" label along with the amount and currency.

Screenshots

https://github.com/braintree/braintree_android/assets/3370617/18c1a7fb-0b8f-472a-b92b-ef414842d9cb

sarahkoop commented 3 months ago

Hey @jupblb - You can set the totalPriceLabel on your GooglePayRequest, but whether or not price and label are displayed is determined by the underlying Google Pay API. See their reference docs for totalPrice for more info on when this will be displayed.