[Google Pay] createPaymentRequest results in PaymentError
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 30/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- typescript
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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);
}
},
- 主要語言
- TypeScript
- 星號
- 35
- 分支
- 13
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NativeScript/payments 的其他 Issue
-
com.android.billingclient:billing@@8.0.0 - com.google.android.gms.internal.play_billing.zzbg.zze未關閉
難度 4/5 3-5 天 新手友好度 28/100
NativeScript/payments#45 ·
-
難度 4/5 3-5 天 新手友好度 35/100
NativeScript/payments#43 · 2 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 35/100
NativeScript/payments#39 ·
-
難度 5/5 一週以上 新手友好度 25/100
NativeScript/payments#36 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 35/100
NativeScript/payments#35 ·
查看 NativeScript/payments 的全部 Issue
相似的 Issue
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive value未關閉
難度 2/5 1-3 小時 新手友好度 74/100
NEARBuilders/everything-dev#798 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
vercel-labs/durable-harness#53 ·
維護者通常 1 天內回覆
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regions可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custa可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉area/docs area/ui enhancement
難度 1/5 1-3 小時 新手友好度 88/100
melgarafael/DeskcommCRM#4098 ·
維護者通常 1 天內回覆
-
dependencies platform: ios
難度 1/5 1-3 小時 新手友好度 78/100
software-mansion/react-native-executorch#1617 ·
維護者通常 1 天內回覆