实现 google pay 时,您是否需要手动计算销售税并将其提供给 api,还是 google pay api 会为您处理这个问题?
最佳答案
您需要自己计算并将其提供给API。
以下是如何构建请求的示例:https://jsfiddle.net/mqbhfrk9/1/
function getGoogleTransactionInfo() {
return {
displayItems: [
{
label: "Subtotal",
type: "SUBTOTAL",
price: "11.00",
},
{
label: "Tax",
type: "TAX",
price: "1.00",
}
],
countryCode: 'US',
currencyCode: "USD",
totalPriceStatus: "FINAL",
totalPrice: "12.00",
totalPriceLabel: "Total"
};
}
关于javascript - Google Pay 是否计算销售税?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58840304/