Skip to content

Prop type on GooglePayButton not working #77

@benjaminalley

Description

@benjaminalley

Describe the bug
Changing the value of the property type on the component GooglePayButton does not result in a change in the rendered Google Pay button.

For example, if I have that value set to GooglePayButtonConstants.Types.Pay, it will still show as "Buy with {google pay logo}" rather then "Pay with {google pay logo}".

I have seen the closed issue that appears to be this, so apologies if preference is to reopen that one instead. I don't have good reason as to why it works in the video reply to that issue and does not work here but will try to give as much helpful info as I can for recreating.

Debugging I've done
What leads me to believe this is actually a bug is that the theme prop works just fine when passing in constants from GooglePayButtonConstants.Themes. As a result of this, I dug into the node module to figure out what specifically about type was different.

As a result of digging in, I found that if I changed this line of code in the GooglePayButtonComponentManager from buttonType to type, that prop worked as expected in my implementation.

To Reproduce
Steps to reproduce the behavior:

  1. Implement GooglePayButton in component with type set to GooglePayButtonConstants.Types.Pay
  2. Run and open app
  3. Navigate to page with Google Pay button
  4. See error (Google Pay button with "Buy with {google pay logo}")

Expected behavior
Button shows "Pay with {google pay logo}"

Screenshots
(importing GooglePayButton as NativeGooglePayButton)
Image

Image

Desktop (please complete the following information):

  • OS: macos
  • Browser: chrome
  • Version: 144.0.7559.133

Smartphone (please complete the following information):

  • Device: Pixel 6a (physical device)
  • OS: Android 16
  • Browser: n/a
  • Version: n/a

Additional context
No debugging outside aforementioned manipulation of node module file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions