这个错误是由于商家ID(merchantId)没有正确注册到指定的域名(domain)上引起的。为了解决这个问题,我们需要验证该商家ID是否正确注册到指定的域名上。
例如,在iOS中使用以下代码可以验证商家ID是否正确绑定到指定的域名上:
PKPaymentAuthorizationController *controller = [[PKPaymentAuthorizationController alloc] initWithPaymentRequest:req];
controller.delegate = self;
[controller presentWithCompletion:^(BOOL success, NSError * _Nullable error) {
if (!success) {
if (error.code == PKPaymentErrorShippingContactInvalidError || error.code == PKPaymentErrorBillingContactInvalidError) {
// handle validation errors
} else if (error.code == PKPaymentErrorPaymentInvalidError) {
// handle payment errors
} else if (error.code == PKPaymentErrorMerchantSessionInvalidError) {
// handle merchant session errors
} else if (error.code == PKPaymentErrorShippingAddressUnserviceableError) {
// handle unserviceable shipping address errors
} else if (error.code == PKPaymentErrorShippingAddressInvalidError) {
// handle invalid shipping address errors
} else if (error.code == PKPaymentErrorPaymentNotAuthorizedError) {
// handle payment not authorized errors
} else if (error.code == PKPaymentErrorPaymentCancelledError) {
// handle cancelled payment errors
} else {
// handle other errors
}
}
}];
如果商家ID未正确注册到指定的域名上,则需要与Apple Pay支持团队联系,以便将商家ID正确注册到指定的域名上。