google-pay / google-pay/react-native-make-payment

<GooglePayButton> is always rendered as 'plain' type

Open
#103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
63
Forks
23
Avg merge
2d 8h
Merged PRs (30d)
5

Description

Describe the bug

The component always displayed as 'plain' type.

`
const googlePayRequest = {
apiVersion: 2,
apiVersionMinor: 0,
allowedPaymentMethods: [
{
type: 'CARD',
parameters: {
allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
allowedCardNetworks: [
'AMEX',
'DISCOVER',
'INTERAC',
'JCB',
'MASTERCARD',
'VISA',
],
},
tokenizationSpecification: {
type: 'PAYMENT_GATEWAY',
parameters: {
gateway: 'adyen',
gatewayMerchantId: '',
},
},
},
],
merchantInfo: {
merchantName: 'Example Merchant',
},
};

return (
<GooglePayButton
style={{
width: 180,
height: 100,
}}
onPress={() => {}}
allowedPaymentMethods={googlePayRequest.allowedPaymentMethods}
theme={GooglePayButtonConstants.Themes.Dark}
type={GooglePayButtonConstants.Types.Subscribe}
radius={4}
/>
);
`

To Reproduce
Steps to reproduce the behavior:
It should be really easy to reproduce.

  1. Create a new react-native project.
  2. Render the <GooglePayButton
    style={{
    width: 180,
    height: 100,
    }}
    onPress={() => {}}
    allowedPaymentMethods={googlePayRequest.allowedPaymentMethods}
    theme={GooglePayButtonConstants.Themes.Dark}
    type={GooglePayButtonConstants.Types.Subscribe}
    radius={4}
    />
  3. Observe rendered button text

Expected behavior
Different button text rendered based on type is expected.

Screenshots

Image

Desktop (please complete the following information):
none

Smartphone (please complete the following information):
Tested on Simulator and real android device (SAMSUNG S24)

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in a new React Native project with the provided GooglePayButton example, then trace the GooglePayButton rendering entry point and its Android implementation. The fix is done when the displayed button text changes according to the supplied type, including Subscribe, on both the simulator and a real Android device.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, react-native
Domain
mobile, payments
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.