Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

<GooglePayButton> is always rendered as 'plain' type

Aperta
#103 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
kotlin, react-native
Ambito
mobile, payments

Direzione di ricerca

Inizia riproducendo il problema in un nuovo progetto React Native con l'esempio GooglePayButton fornito, quindi traccia il punto di ingresso del rendering di GooglePayButton e la sua implementazione Android. La correzione è completata quando il testo visualizzato del pulsante cambia in base al tipo specificato, incluso Subscribe, sia nel simulatore sia su un dispositivo Android reale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Kotlin
Stelle
63
Fork
24
Merge medio
3g 1h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-pay/react-native-make-payment

Tutte le issue di google-pay/react-native-make-payment

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.