[Google Pay] createPaymentRequest results in PaymentError
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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);
}
},
- Vorherrschende Sprache
- TypeScript
- Sterne
- 35
- Forks
- 13
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NativeScript/payments
-
com.android.billingclient:billing@@8.0.0 - com.google.android.gms.internal.play_billing.zzbg.zzeOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 28/100
NativeScript/payments#45 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
NativeScript/payments#43 · 2 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
NativeScript/payments#39 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
NativeScript/payments#36 · 2 Kommentare ·
-
[Restore Orders] MistakeOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
NativeScript/payments#35 ·
Alle Issues in NativeScript/payments
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Open-Earth-Foundation/CityCatalyst#3399 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
userReport
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
nkprasad12/morcus-net#631 ·
Maintainer antworten meist innerhalb von 1 Tag
-
fix(app): fail closed if GetGeneralSetting fails during initializationEvtl. vergeben @kalavt hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
nekko-labs/nekko-agent#1756 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-area-label
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 2 Tagen