[英]Receiving account and 417 errors when attempting to test Apple Pay via braintree-web-drop-in package
目前在我的 React 網絡應用程序中使用braintree-web-drop-in進行支付。 目前 Paypal 和信用卡支付都可以正常使用,但我無法使用 ApplePay。
我正在使用沙盒 Braintree 帳戶和沙盒 Apple Tester 帳戶進行測試。 我遵循了Braintree 指南來設置 Apple pay,並且我也遵循了Apple Pay Sandbox 指南。 這是我用於 Braintree Dropin 渲染的代碼:
getApplePayRequestObject() {
const total = this.total;
return {
total: {
label: 'Testing 123',
amount: total,
},
countryCode: 'US',
currencyCode: 'USD',
};
}
createPaymentForm() {
const paypalConfig = config.payPalEnabled && { paypal: { flow: 'vault' } };
const applePayConfig = config.applePayEnabled && {
applePay: {
displayName: 'My App',
paymentRequest: this.getApplePayRequestObject(),
},
};
dropin.create(
{
authorization: this.props.token,
selector: '#braintree-container',
paymentOptionPriority: ['card', 'paypal', 'applePay'],
...paypalConfig,
...applePayConfig,
card: {
overrides: {
styles: {
input: {
padding: '0 8px',
},
},
},
},
},
(err, instance) => {
if (instance) {
this.instance = instance;
this.setState({ formLoaded: true });
} else {
this.setState({ braintreeError: strings.paymentCantBeProcessed });
console.error(err || 'Payment form instance could not be initialized');
}
}
);
}
有了這個,我在 safari 中成功呈現了 Apple Pay 按鈕。 正如我所說,這個沙盒 Braintree 帳戶中的 Paypal 和信用卡支付都運行良好。
我目前在使用 Apple Pay 時遇到兩個問題。 當我第一次選擇 Apple Pay 時,出現以下錯誤:
Could not find an active card. This may be because you're using a production iCloud
account in a sandbox Apple Pay Session. Log in to a Sandbox iCloud account to test
this flow, and add a card to your wallet. For additional assistance, visit
https://help.braintreepayments.com
這沒有意義,因為我通過蘋果開發者控制台專門創建了一個 Sandbox Tester 帳戶,當我在我的 Mac 上登錄/添加卡片到該帳戶時,它甚至在對話框頂部顯示“Sandbox”。
其次,如果我嘗試繼續付款,我會收到417 Expectation Failed
錯誤:
{
"error": {
"message": "Payment Services Exception merchantId={id1 here} unauthorized to process transactions on behalf of merchantId={id2 here} reason={id2 here} is not a registered merchant in WWDR and isn't properly authorized via Mass Enablement, either"
},
"fieldErrors": []
}
谷歌搜索此錯誤並沒有讓我深入了解問題或可能的解決方案。
如何解決這些錯誤並使用braintree-web-drop-in
通過 Apple Pay 成功完成付款。
全面披露:我在 PayPal 工作。 如果您有任何其他問題,請聯系支持人員。
417 幾乎總是域名注冊問題。 雙重和三次檢查以下內容:
聽起來你已經涵蓋了這兩個,但我還是把它們放在一起只是為了更加確定。
將您的域添加到控制面板時,它必須是完全限定的域名。 需要仔細檢查托管在您提供的 URL 上的文件的事項:
如有疑問,您應該能夠在任何設備上公開訪問您提供的 URL,並看到與此非常相似的頁面。 如果您沒有看到您注冊的域存在問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.