[Google Pay] createPaymentRequest results in PaymentError
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript
Direção de pesquisa
Start at GooglePayButton.createPaymentRequest and compare the supplied options with the Google Pay example, focusing on the PaymentError statusCode 10. Reproduce the call with the listed NativeScript, Google Pay, Stripe, and Android settings, then verify that the payment sheet appears instead of immediately invoking PaymentError.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I'm basically following the Google Pay example in a Vue app. Calling createPaymentRequest on the GooglePayButton object immediately results in the PaymentError handler being called, with statusCode 10 and statusMessage "10: ". I don't see any other error information being returned. The Google Pay sheet does not appear.
Using "@nativescript/core": "^8.5.6", "@nativescript/google-pay": "^0.1.2"
async onGooglePayTap(args) {
try {
if (global.isAndroid) {
const googlePayBtn = args.object;
// setup the event listeners
googlePayBtn.once(GooglePayEvents.PaymentCancelled, (args) => {
console.log("payment cancelled, not much to do here");
});
googlePayBtn.once(GooglePayEvents.PaymentSuccess, async (args) => {
console.log("PaymentSuccess");
// this is where you handle the response with the token from google pay to send to payment provider
const payloadToBackend = {
amount: 25.2,
method: "3DS",
"3DS": {
signature:
args.data.paymentMethodData.tokenizationData.token.signature,
type: "G", // for Google
version:
args.data.paymentMethodData.tokenizationData.token
.protocolVersion,
data: args.data.paymentMethodData.tokenizationData.token
.signedMessage,
},
};
// send your payload to your payment provider here
// const result = await this.someHttpMethodToYourProviderBackend(payloadToBackend);
if (result) {
// now show the user the confirmation screen
} else {
// show the user that something went wrong here
}
});
googlePayBtn.once(GooglePayEvents.PaymentError, (args) => {
console.log("PaymentError");
console.dir(args, { depth: null });
// TODO: let user know some error happened
});
const options = {
environment: "development",
theme: "light",
merchantInfo: {
merchantName: "Test Merchant",
},
allowedPaymentMethods: {
type: AllowedPaymentMethodsType.CARD,
parameters: {
allowPrepaidCards: true,
allowCreditCards: true,
billingAddressRequired: true,
billingAddressParameters: {
format: BillingAddressParametersFormat.MIN,
phoneNumberRequired: true,
},
},
tokenizationSpecification: {
type: TokenizationSpecificationType.PAYMENT_GATEWAY,
parameters: {
gateway: "stripe",
"stripe:version": "2018-10-31",
"stripe:publishableKey":
"redacted",
},
},
},
transactionInfo: {
currencyCode: "USD",
countryCode: "US",
transactionId: "283999292929929", // A unique ID that identifies a transaction attempt. Merchants can use an existing ID or generate a specific one for Google Pay transaction attempts. This field is required when you send callbacks to the Google Transaction Events API.
totalPriceStatus: TotalPriceStatusValue.FINAL,
totalPrice: 25.2,
totalPriceLabel: "Total",
checkoutOption: CheckoutOptionValue.DEFAULT,
},
emailRequired: true,
shippingAddressRequired: true,
shippingAddressParameters: {
allowedCountryCodes: ["US"],
phoneNumberRequired: true,
},
};
// this creates the payment request to the Google Pay SDK and will present the user with the payment sheet to complete the transaction
googlePayBtn.createPaymentRequest(options).catch((err) => {
console.log("error with create payment request", err);
});
console.log("created payment request");
}
} catch (error) {
console.log("Error with google pay", error);
}
},
- Linguagem predominante
- TypeScript
- Estrelas
- 35
- Forks
- 13
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NativeScript/payments
-
com.android.billingclient:billing@@8.0.0 - com.google.android.gms.internal.play_billing.zzbg.zzeAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 28/100
NativeScript/payments#45 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
NativeScript/payments#43 · 2 reações ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
NativeScript/payments#39 ·
-
support Amazon Android appsAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
NativeScript/payments#36 · 2 comentários ·
-
[Restore Orders] MistakeAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
NativeScript/payments#35 ·
Todas as issues de NativeScript/payments
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Broken links in the docsAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
🔊 a11y
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
betagouv/mon-entreprise#4726 ·
Mantenedores costumam responder em até 9 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Deltares/fews-pi-requests#357 ·
Mantenedores costumam responder em até 1 dia
-
bug confirmed js v6
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia