不使用 Payment Request API 更改 Apple Pay 中的货币

问题描述

我在网站上将 Apple Pay 与 Payment Request API 集成时遇到问题。在用户选择另一种货币的地址后,Apple Pay 表不会更新货币,它只会更新数字。我正在像本示例中那样进行更新。

session.onshippingaddresschange = event => {
    update(newAddress).then(data => {
        const updatedData = {
            shippingOptions: data.shippingOptions.map(
                (shippingOption,index) => ({
                    id: shippingOption.id,label: shippingOption.name,amount: {
                        value: shippingOption.price,currency: data.currency
                    },selected: index === 0
                })
            ),total: {
                label: 'Total',amount: {
                    value: data.grandTotal,currency: data.currency
                }
            },displayItems: [
                {
                    label: 'Subtotal',amount: {
                        value: data.subTotalAmountExclTaxes,currency: data.currency
                    }
                },{
                    label: 'Sales Tax',amount: {
                        value: data.totalTaxes,{
                    label: 'Shipping',amount: {
                        value: data.totalShippingFee,currency: data.currency
                    }
                }
            ]
        };

        event.updateWith(updatedData);
    });
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)