google-pay / google-pay/react-native-make-payment
<GooglePayButton> is always rendered as 'plain' type
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.
- Create a new react-native project.
- Render the <GooglePayButton
style={{
width: 180,
height: 100,
}}
onPress={() => {}}
allowedPaymentMethods={googlePayRequest.allowedPaymentMethods}
theme={GooglePayButtonConstants.Themes.Dark}
type={GooglePayButtonConstants.Types.Subscribe}
radius={4}
/> - Observe rendered button text
Expected behavior
Different button text rendered based on type is expected.
Screenshots
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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