ApplePay API接入流程
一、前置准备
1. Apple Pay 证书
https://网站域名/.well-known/apple-developer-merchantid-domain-association.txt
2. 前端
2.1 前端引入Apple Pay
2.1.1 在网站引入apple pay js
<script src="https://applepay.cdn-apple.com/jsapi/v1.1.0/apple-pay-sdk.js"></script>
2.1.2 渲染Apple Pay button
if (window.ApplePaySession) {
var merchantIdentifier = 'YOUR MERCHANT IDENTIFIER';
var promise = ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier);
promise.then(function (canMakePayments) {
if (canMakePayments)
// 在这步渲染button, Display Apple Pay button here.
});
}
环境 | 值 |
---|---|
sandbox | merchant.com.sandbox.useepay |
prod | merchant.com.gateway.useepay |
二、支付流程
1.
2.
2.1 merchantSession
如何调用UseePay merchantSession接口
如何调用ApplePay SDK处理merchantSession
1.
字段 | 备注 | 例子(请根据实际情况填写) |
---|---|---|
currencyCode | 是当前交易币种 | USD |
label | 交易主体 | www.useepay.com |
amount | 交易金额 | 2 |
2.
3.
ApplePaySesiion event
2.1 ApplePay支付
修改于 2024-05-14 10:02:33