我设法从 Apple Pay 服务器中检索了 MercerSession 对象,如下所示。我使用沙盒测试(在 itunesconnect 上设置并在 iphone 上登录沙盒帐户并添加测试签证卡)
{
"epochTimestamp":15065...20,
"expiresAt":1506527672620,
"merchantSessionIdentifier":"2EF498A9E...C24",
"nonce":"f32....9",
"merchantIdentifier":"7941CB932...DE2",
"domainName":"mywebsite.com",
"displayName":"My Test Shop",
"signature":"30800609....0000"
}
但是,在 Apple Pay 弹出表中,它仍然停留在“处理中”,我需要做什么才能处理下一个阶段以显示“Touch Id”?
另外,下面是我的 onvalidatemerchant 代码片段:
session.onvalidatemerchant = (event) => {
console.log("Validate merchant");
const validationURL = event.validationURL;
getApplePaySession(event.validationURL).then(function(response) {
console.log(response);
session.completeMerchantValidation(response);
});
};