React native 在带有tipsi条带的React本机应用程序上实现ApplePay和GPay时出错
我需要在带有tipsi条带的react本机应用程序上实现ApplePay和GPay 我正在用paymentRequestWithNativePay做这件事 在iPhone上,我得到了一个丢失商家标识符的错误,尽管我在Xcode上添加了它React native 在带有tipsi条带的React本机应用程序上实现ApplePay和GPay时出错,react-native,applepay,google-pay,React Native,Applepay,Google Pay,我需要在带有tipsi条带的react本机应用程序上实现ApplePay和GPay 我正在用paymentRequestWithNativePay做这件事 在iPhone上,我得到了一个丢失商家标识符的错误,尽管我在Xcode上添加了它 在Android上,我收到了一个请求失败的错误,我也不能添加一个测试卡,在输入商户ID后进行测试。现在,它在iPhone上得到了修复 componentDidMount() { stripe.setOptions({ publishabl
在Android上,我收到了一个请求失败的错误,我也不能添加一个测试卡,在输入商户ID后进行测试。现在,它在iPhone上得到了修复
componentDidMount() {
stripe.setOptions({
publishableKey: 'pk_test_MEn0wwd8i5t2949HQfjqfNsn00D8dN0Tjp', // Qirat's account
androidPayMode: 'test',
merchantId: 'merchant.com.showassist',
});
}
在iOS上,我们需要对其进行编码
const options = {
requiredBillingAddressFields: ['all'],
requiredShippingAddressFields: ['phone', 'postal_address'],
shippingMethods,
};
const items = [
{
label: 'Whisky',
amount: '50.00',
},
{
label: 'Tipsi, Inc',
amount: '50.00',
},
];
_onPressAdd = async () => {
const token = await stripe.paymentRequestWithNativePay(options, items);
};
const options = {
total_price: '0.00',
currency_code: 'EUR',
line_items: [
{
currency_code: 'EUR',
description: 'Testitem',
total_price: '1.00',
unit_price: '1.00',
quantity: '1',
},
{
currency_code: 'EUR',
description: 'Discount',
total_price: '-1.00',
unit_price: '-1.00',
quantity: '1',
},
],
};
_onPressAdd = () => {
stripe
.paymentRequestWithNativePay({
currency_code: 'USD',
total_price: '0.00',
line_items: [
{
currency_code: 'USD',
description: 'Payment',
amount: '1.00',
total_price: '0.00',
unit_price: '10',
quantity: '1',
},
],
})
.then(response => {
console.log('response payment', response);
console.log('response.tokenId', response.tokenId);
})
.catch(error => console.log(error));
};
在Android上,我们需要对其进行编码
const options = {
requiredBillingAddressFields: ['all'],
requiredShippingAddressFields: ['phone', 'postal_address'],
shippingMethods,
};
const items = [
{
label: 'Whisky',
amount: '50.00',
},
{
label: 'Tipsi, Inc',
amount: '50.00',
},
];
_onPressAdd = async () => {
const token = await stripe.paymentRequestWithNativePay(options, items);
};
const options = {
total_price: '0.00',
currency_code: 'EUR',
line_items: [
{
currency_code: 'EUR',
description: 'Testitem',
total_price: '1.00',
unit_price: '1.00',
quantity: '1',
},
{
currency_code: 'EUR',
description: 'Discount',
total_price: '-1.00',
unit_price: '-1.00',
quantity: '1',
},
],
};
_onPressAdd = () => {
stripe
.paymentRequestWithNativePay({
currency_code: 'USD',
total_price: '0.00',
line_items: [
{
currency_code: 'USD',
description: 'Payment',
amount: '1.00',
total_price: '0.00',
unit_price: '10',
quantity: '1',
},
],
})
.then(response => {
console.log('response payment', response);
console.log('response.tokenId', response.tokenId);
})
.catch(error => console.log(error));
};
在输入商户ID后,它现在被固定在iPhone上
componentDidMount() {
stripe.setOptions({
publishableKey: 'pk_test_MEn0wwd8i5t2949HQfjqfNsn00D8dN0Tjp', // Qirat's account
androidPayMode: 'test',
merchantId: 'merchant.com.showassist',
});
}
在iOS上,我们需要对其进行编码
const options = {
requiredBillingAddressFields: ['all'],
requiredShippingAddressFields: ['phone', 'postal_address'],
shippingMethods,
};
const items = [
{
label: 'Whisky',
amount: '50.00',
},
{
label: 'Tipsi, Inc',
amount: '50.00',
},
];
_onPressAdd = async () => {
const token = await stripe.paymentRequestWithNativePay(options, items);
};
const options = {
total_price: '0.00',
currency_code: 'EUR',
line_items: [
{
currency_code: 'EUR',
description: 'Testitem',
total_price: '1.00',
unit_price: '1.00',
quantity: '1',
},
{
currency_code: 'EUR',
description: 'Discount',
total_price: '-1.00',
unit_price: '-1.00',
quantity: '1',
},
],
};
_onPressAdd = () => {
stripe
.paymentRequestWithNativePay({
currency_code: 'USD',
total_price: '0.00',
line_items: [
{
currency_code: 'USD',
description: 'Payment',
amount: '1.00',
total_price: '0.00',
unit_price: '10',
quantity: '1',
},
],
})
.then(response => {
console.log('response payment', response);
console.log('response.tokenId', response.tokenId);
})
.catch(error => console.log(error));
};
在Android上,我们需要对其进行编码
const options = {
requiredBillingAddressFields: ['all'],
requiredShippingAddressFields: ['phone', 'postal_address'],
shippingMethods,
};
const items = [
{
label: 'Whisky',
amount: '50.00',
},
{
label: 'Tipsi, Inc',
amount: '50.00',
},
];
_onPressAdd = async () => {
const token = await stripe.paymentRequestWithNativePay(options, items);
};
const options = {
total_price: '0.00',
currency_code: 'EUR',
line_items: [
{
currency_code: 'EUR',
description: 'Testitem',
total_price: '1.00',
unit_price: '1.00',
quantity: '1',
},
{
currency_code: 'EUR',
description: 'Discount',
total_price: '-1.00',
unit_price: '-1.00',
quantity: '1',
},
],
};
_onPressAdd = () => {
stripe
.paymentRequestWithNativePay({
currency_code: 'USD',
total_price: '0.00',
line_items: [
{
currency_code: 'USD',
description: 'Payment',
amount: '1.00',
total_price: '0.00',
unit_price: '10',
quantity: '1',
},
],
})
.then(response => {
console.log('response payment', response);
console.log('response.tokenId', response.tokenId);
})
.catch(error => console.log(error));
};
这可能与您(用户)在谷歌支付模式中的国家有关。你是从哪个国家来的?我建议更新您的国家/地区或为其他国家/地区添加新的付款模式。访问并导航到“设置”以访问支付配置文件信息。@Soc看起来你是对的,我正在使用谷歌巴基斯坦,我的国家/地区没有Gpay,我想这可能与谷歌支付配置文件中你(用户)的国家/地区有关。你是从哪个国家来的?我建议更新您的国家/地区或为其他国家/地区添加新的付款模式。访问并导航到“设置”以访问支付配置文件信息。@Soc看起来你是对的,我正在使用谷歌巴基斯坦,我想我的国家不提供Gpay