更多功能
发起授权支付时,您可以根据自身业务需求选择是否使用更多功能。本文为您提供更多功能的详细说明及使用方式。
设置 3D 认证
通过设定 is3DSAuthentication 参数的值,指定某笔交易是否进行 3D 认证:
- is3DSAuthentication 不设置值:则等同于该参数值为
false
的情况,即该笔交易不触发 3D 验证。若 Alipay 判断该笔交易为高风险则直接拒绝本次交易。 - is3DSAuthentication 值为
false
,该笔交易不触发 3D 验证。若 Alipay 判断该笔交易为高风险则直接拒绝本次交易。 - is3DSAuthentication 值为
true
,该笔交易触发 3D 验证。若 Alipay 判断该笔交易为高风险则直接拒绝本次交易。
注意:
智能挽回交易
通过设定 enableAuthenticationUpgrade 参数的值为 true
,指定某笔交易进行自动挽回:对于您指定的非 3D 认证的交易,当卡组要求该笔交易进行 3D 认证时,Alipay 可自动路由至 3D 验证流程,让买家参与验证过程,从而挽回失败交易。
如果不使用自动挽回交易功能,对于您指定的非 3D 验证的交易,当卡组要求该笔交易进行 3D 认证时,即卡组认定该笔交易存在风险,如果不进行 3D 验证则支付失败。
注意:
设置 3D 认证及自动挽回交易这两个功能会共同决定交易的风控验证流程,下表为您展示两个功能的交叉使用情况及对应的风控结果:
设置3D认证: is3DSAuthentication | 自动挽回交易:enableAuthenticationUpgrade | 风控结果 |
false / 不传值 | true / 不传值 | 非 3D 验证的交易失败后,该笔交易自动升级至 3D 验证,Alipay为您返回 3D 验证页面的 URL 。 |
false / 不传值 | false | 如果非 3D 验证的交易支付失败,Alipay 为您返回交易失败的结果。 |
true | true / false / 不传值 | 交易需进行 3D 验证,Alipay 为您返回 3D 验证页面的 URL 。 |
表 1. 3D 认证及自动挽回交易设置影响的风控结果
SDK 集成方式下,SDK 将负责处理 3D 验证页面的跳转,对于 3D 页面的跳转您无需做额外处理。API 集成方式下,当 Alipay 为您返回 3D 验证页面的URL后,您需要为买家展示 3D 验证页面并推进用户完成 3D验证。以下示例展示了 支付 请求的响应中为您返回 3D 验证页面URL的场景:
{
"result": {
"resultStatus": "U",
"resultCode": "PAYMENT_IN_PROCESS",
"resultMessage": "payment in process"
},
"normalUrl": "https://centinelapi.cardinalcommerce.com/V1/Cruise/Collect/...",
"paymentId": "20221111194010890100111650285726898",
"paymentRequestId": "amsdmpay_cangxi_lj_20221111_104718_672",
"redirectActionForm": {
"redirectUrl": "https://centinelapi.cardinalcommerce.com/V1/Cruise/Collect/...",
"method": "GET"
},
"paymentAmount": {
"currency": "HKD",
"value": "100"
},
"paymentCreateTime": "2022-11-10T18:47:20-08:00"
}
增值风控服务
如果您需求交易维度的升级风控服务,可购买 Alipay 提供的增值风控服务。该服务可根据交易的风险等级,智能决策风控策略。
本功能与 设置3D认证 及 自动挽回交易 可结合使用,共同决定交易的风控验证流程,下表为您展示这三种功能的交叉使用情况及对应的风控结果:
增值风控 | 设置3D认证 (is3DSAuthentication) | 自动挽回交易(enableAuthenticationUpgrade) | 风控结果 |
开通 | false / 不传值 | false | 由风控服务决策是否进行 3D 验证。 |
开通 | false / 不传值 | true / 不传值 | 由风控服务决策是否进行 3D 验证。若决策结果为非 3D 验证且首次授权支付时卡组要求进行 3D 验证,Alipay 为您返回 3D 验证页面的 URL 。 |
开通 | true | false / true / 不传值 | 即使风控服务决策结果为非 3D 验证,交易仍进行 3D 验证,Alipay 为您返回 3D 验证页面的 URL 。 |
表 2. 增值风控开通下不同设置所影响的风控结果
注意:
- 若您购买了增值风控服务,建议无需设置 is3DSAuthentication 参数,有增值风控服务为您提供风控决策。
- 部分地区卡组发行的卡在该地区卡组交易网络下进行交易时不支持此功能,这些地区包括巴西和韩国。
AVS 验证
地址验证系统(AVS)用于验证账单地址是否与信用卡持卡人的地址匹配,可有效防止欺诈交易的发生。当您开通 AVS 校验服务后,当买家输入持卡人的账单地址和邮编后,AVS 系统会将该信息与发卡机构中存储的对应信息进行比对,如果该信息与发卡机构记录中的信息不匹配,则交易可能会被拒绝或需要进行额外的身份验证。支付 AVS 验证可帮助减少信用卡欺诈风险。
开通 AVS 校验服务后,在不同集成方式下,您需要采取不同的方式发起 AVS 校验:
- 在 API 集成方式下:
- 如果您使用服务器对服务器模式,则需在调用 支付 接口时传入 billingAddress 参数以发起 AVS 校验。
- 如果您使用托管表单模式,Alipay 为用户提供支付信息收集页,在该页面会要求买家填写账单地址等信息,您无需做额外处理。
- 在 SDK 集成方式下,SDK 为用户提供支付信息收集页,在该页面会要求买家填写账单地址等信息,您无需做额外处理。
注意:
存储卡信息
您可以为买家提供绑卡服务,即支持买家在首次支付时选择存储卡信息,以便下次支付时无需再次输入卡信息。下图展示了用户选择绑卡后,再次支付时的下单页面:
图 1. 用户绑卡后续支付页面
API 集成方式
在不同集成方式下,您需要采取不同的方式实现买家绑卡的功能。在 API 集成方式下,针对服务器对服务器模式和托管表单模式,您需要执行下述相应操作:
在服务器对服务器模式下,收集完买家卡信息后,您可以选择自己存储卡信息或者让 Alipay 来帮助您存储卡信息。
- Alipay 存储卡信息(推荐)
当买家在您的页面上选择存储卡片信息,您需要将收集好的卡信息通过 支付 接口传给 Alipay 并指定 tokenize 字段为 true
。Alipay 会将卡信息生成对应的卡令牌 (cardToken),授权支付成功后,您可以通过接收异步通知或通过 查询支付结果 接口主动查询的方式获取卡令牌 (cardToken) 及脱敏后的卡号 (cardNo)。您需将获取到的卡令牌与脱敏卡号等信息与买家信息进行关联并存储,以用于后续支付。
以下示例展示了 Alipay 存储卡信息模式下,您需要发送给 Alipay 的 支付 请求:
{
"settlementStrategy": {
"settlementCurrency": "EUR"
},
"productCode": "CASHIER_PAYMENT",
"paymentNotifyUrl": "http://gol.alipay.net:8080/amsdemo/record/notify?env=main_GROUP&paymentMethodType=CARD",
"paymentRequestId": "2****************2",
"paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=2023070458941025622196",
"paymentFactor": {
"isAuthorization": true
},
"paymentMethod": {
"paymentMethodMetaData": {
"recurringType": "",
"cvv": "123",
"is3DSAuthentication": false,
"isCardOnFile": false,
"expiryMonth": "05",
"tokenize": true,
"expiryYear": "26",
"billingAddress": {
"zipCode": "310000",
"address2": "gongzhuan Road",
"city": "hangzhou",
"state": "zhejiang",
"region": "CN"
},
"cardNo": "****1846"
},
"paymentMethodType": "CARD"
},
"paymentExpiryTime": "2025-11-27T12:00:01+08:30",
"paymentAmount": {
"currency": "EUR",
"value": "8204"
},
"merchantRegion": "",
"order": {
"orderAmount": {
"currency": "EUR",
"value": "8204"
},
"referenceOrderId": "2********************0",
"shipping": {
"shippingName": {
"firstName": "Li",
"lastName": "Kyle",
"fullName": "Kyle Li"
},
"shippingCarrier": "DHL",
"shippingPhoneNo": "**********19",
"shipToEmail": "exam***@163.com",
"shippingAddress": {
"zipCode": "310000",
"address2": "gongzhuan Road",
"city": "hangzhou",
"state": "zhejiang",
"region": "CN"
}
},
"goods": [
{
"referenceGoodsId": "2******************7",
"goodsUrl": "qinghailipipeng",
"goodsCategory": "chemical",
"goodsUnitAmount": {
"currency": "EUR",
"value": "8204"
},
"goodsQuantity": "1",
"goodsName": "boom",
"goodsSkuName": "boom boom room",
"goodsBrand": "antom boom"
}
],
"env": {
"clientIp": "1.1.1.1",
"osType": "IOS",
"terminalType": "WAP"
},
"orderDescription": "ANTOM_ZZ",
"buyer": {
"referenceBuyerId": "2******************7",
"buyerName": {
"firstName": "Li",
"lastName": "Kyle",
"fullName": "Kyle Li"
}
}
}
}
当绑卡买家再次进行支付时,您需要完成以下操作:
- 在收银台页面为买家展示脱敏后的卡信息。
- 调用 支付 接口,并传入以下参数:
- paymentMethodId: 值为 cardToken 的参数值(cardToken 可从原始绑卡交易对应的 支付异步通知 和 查询支付结果 接口返回的 paymentResultInfo 中获取)。
- 额外支付验证信息字段(例如巴西卡的 cpf 字段)。
- isCardOnFile: 值为
true
,用于标记该笔交易为绑卡买家的再次交易。
以下示例展示了绑卡用户再次支付时,使用 Alipay 返回的卡令牌调用 支付 接口的请求:
{
"settlementStrategy": {
"settlementCurrency": "EUR"
},
"productCode": "CASHIER_PAYMENT",
"paymentNotifyUrl": "http://gol.alipay.net:8080/amsdemo/record/notify?env=main_GROUP&paymentMethodType=CARD",
"paymentRequestId": "2****************2",
"paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=2023070471913565376977",
"paymentFactor": {
"isAuthorization": true
},
"paymentMethod": {
"paymentMethodId": "A********************************************************************************************=",
"paymentMethodMetaData": {
"recurringType": "SCHEDULED",
"is3DSAuthentication": false,
"isCardOnFile": true,
"networkTransactionId": "2*************5"
},
"paymentMethodType": "CARD"
},
"paymentExpiryTime": "2025-11-27T12:00:01+08:30",
"paymentAmount": {
"currency": "EUR",
"value": "3063"
},
"merchantRegion": "",
"order": {
"orderAmount": {
"currency": "EUR",
"value": "3063"
},
"referenceOrderId": "2****************1",
"shipping": {
"shippingName": {
"firstName": "Li",
"lastName": "Kyle",
"fullName": "Kyle Li"
},
"shippingCarrier": "DHL",
"shippingPhoneNo": "**********119",
"shipToEmail": "exam***@163.com",
"shippingAddress": {
"zipCode": "310000",
"address2": "gongzhuan Road",
"city": "hangzhou",
"state": "zhejiang",
"region": "CN"
}
},
"goods": [
{
"referenceGoodsId": "2********************9",
"goodsUrl": "qinghailipipeng",
"goodsCategory": "chemical",
"goodsUnitAmount": {
"currency": "EUR",
"value": "3063"
},
"goodsQuantity": "1",
"goodsName": "boom",
"goodsSkuName": "boom boom room",
"goodsBrand": "antom boom"
}
],
"env": {
"clientIp": "1.1.1.1",
"osType": "IOS",
"terminalType": "WAP"
},
"orderDescription": "ANTOM_ZZ",
"buyer": {
"referenceBuyerId": "K*****************3",
"buyerName": {
"firstName": "Li",
"lastName": "Kyle",
"fullName": "Kyle Li"
}
}
}
}
- 自行存储卡信息
当买家在商家页面上选择存储卡片信息后,您需在服务端将买家信息和对应的卡信息关联存储。当买家再次发起支付时,您需在调用 支付 接口时传入卡信息,并指定 isCardOnFile 参数的值为 true
。该字段用于标记此交易为绑卡用户的再次交易,有助于提升交易成功率。
以下示例展示了绑卡用户再次支付时,您的服务端调用 支付 接口的请求示例:
{
"env": {
"terminalType": "APP",
"clientIp": "112.80.248.78",
"deviceId": "eYOIkvFpZzztgO0Yu6USdprBQZCWxDhiUAHCiK8K/cH9mT6wMaMO****",
"osType": "IOS",
"deviceLanguage": "zh_CN",
"colorDepth": 48,
"screenHeight": 768,
"screenWidth": 1024,
"timeZoneOffset": 1
},
"order": {
"orderAmount": {
"currency": "EUR",
"value": "30000"
},
"orderDescription": "Cappuccino #grande (Mika's coffee shop)",
"referenceOrderId": "ORDER_2022111414171****",
"goods": [
{
"referenceGoodsId": "383382011_SGAMZ-90452****",
"goodsName": "[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto",
"goodsUrl": "https://www.lazada.sg/products/3-boxes-starbucks-cappuccino-milk-coffee-pods-coffee-capsules-by-nescafe-dolce-gusto-i383382011-s904520356.html?clickTrackInfo=undefined&search=1&source=search&spm=a2o42.searchlist.list.3",
"goodsCategory": "Digital Goods/Digital Vouchers/Food and Beverages",
"goodsUnitAmount": {
"currency": "EUR",
"value": "30000"
},
"goodsQuantity": "10"
}
],
"shipping": {
"shippingName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
},
"shippingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"shippingCarrier": "FedEx",
"shippingPhoneNo": "1234567****",
"shipToEmail": "test@gmail.com"
},
"buyer": {
"referenceBuyerId": "test12345678",
"buyerPhoneNo": "1234567****",
"buyerEmail": "alipay@alipay.com",
"buyerName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
}
}
},
"paymentAmount": {
"currency": "EUR",
"value": "30000"
},
"paymentMethod": {
"paymentMethodType": "CARD",
"paymentMethodMetaData": {
"isCardOnFile": true,
"enableAuthenticationUpgrade": false,
"is3DSAuthentication": false,
"cardholderName": {
"firstName": "Tom",
"lastName": "Jay"
},
"expiryMonth": "12",
"billingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"expiryYear": "29",
"cardNo": "411734780615****"
}
},
"settlementStrategy": {
"settlementCurrency": "EUR"
},
"paymentNotifyUrl": "https://www.alipay.com/notify",
"paymentRedirectUrl": "https://www.alipay.com",
"paymentRequestId": "PAY_2022111414171****",
"productCode": "CASHIER_PAYMENT",
"paymentFactor": {
"isAuthorization": true
}
}
SDK 集成方式
此方式下,SDK 为您的买家提供信息收集页面,在该页面上买家完成卡信息输入后,可选择保存卡信息,以便再次支付时无需重复输入卡信息。当买家选择保存卡信息后,Alipay 存储买家的卡信息并生成对应的卡令牌(cardToken) 。授权支付成功后,您可以通过接收异步通知或主动调用 查询支付结果 接口,获取买家的卡支付信息(cardInfo 字段),该信息包括卡令牌(cardToken) 及脱敏后的卡信息。
当绑卡用户再次进行支付时,您需要在调用 支付会话创建 请求时设置 paymentMethodId 参数值为 cardToken 的值。以下示例展示了绑卡用户再次支付时,您的服务端调用 支付会话创建 接口的请求示例:
{
"productCode": "CASHIER_PAYMENT",
"paymentRequestId": "55bf93a6-71a1-4ca9-b014-53273bd674eb",
"order": {
"referenceOrderId": "926e1c32-4a6c-442e-b5ce-8ec5b902e18c",
"orderDescription": "xxxxx",
"orderAmount": {
"currency": "BRL",
"value": "100"
},
"buyer": {
"referenceBuyerId": "yeiasdasda",
"buyerPhoneNo": "134******71"
}
},
"paymentAmount": {
"currency": "BRL",
"value": "100"
},
"paymentMethod": {
"paymentMethodType": "CARD",
"paymentMethodId": "alipayCardToken"
},
"paymentRedirectUrl": "https://www.yourMerchantWeb.com",
"paymentNotifyUrl": "https://www.yourNotifyUrl",
"paymentFactor": {
"isAuthorization": true
},
"settlementStrategy": {
"settlementCurrency": "EUR"
}
}
MIT 交易
卡授权支付场景下的自动扣款交易,也被称为Merchant-initiated Transactions (MIT) 交易,即在用户未参与的情况下发起定期或非定期的交易。
注意:
- 此场景下的交易均为非 3D 验证的交易。
- 发起并完成 MIT 交易的前提是您已经获取了买家的授权以完成后续的 MIT 交易,买家需在首次授权支付时完成 3D 验证。
- 部分地区卡组发行的卡在该地区卡组交易网络下进行交易时不支持此功能,这些地区包括:巴西、韩国、智利、墨西哥和秘鲁。
MIT 交易仅支持通过 支付 接口完成,请注意以下参数的设置:
- isCardOnFile: 值为
true
,用于标记该笔交易为绑卡买家的再次支付。 - recurringType:值为
SCHEDULED
或UNSCHEDULED
, 用于指定该笔交易为定期扣款或非定期扣款。 - networkTransactionId:系统需要确认您已经获取了买家的授权以完成后续的 MIT 交易,因此,您需要通过此字段传入买家进行初始授权支付时卡组分配的用于识别授权支付交易的唯一 ID。当买家首次授权支付成功后,您通过 支付结果通知 或 查询支付结果 请求的响应均可以获得该授权支付交易唯一 ID。
以下示例展示调用 支付 接口发起 MIT 交易的请求示例:
指定卡品牌
当买家选择双标卡进行授权支付时,您可以通过 paymentMethodRegion 或 selectedCardBrands 参数指定该笔交易使用的卡品牌或卡所属区域。下表展示了指定 paymentMethodRegion 或 selectedCardBrands 参数的值后,卡品牌的使用情况:
PaymentMethodRegion | selectCardBrands | 用于交易的卡品牌 |
GLOBAL | / | 国际卡品牌 |
FR、BR.. | / | 本地卡品牌 |
/ | VISA、CB | 指定的卡品牌 |
/ | / | 由 Alipay 根据费率、成功率等因素为您选取合适的卡品牌 |
表 3. 不同卡品牌及卡所在区域设置所影响的卡交易品牌
注意:
- 卡品牌及卡所属区域信息参见 支付方式。
- 巴西地区卡组发行的卡在巴西卡组交易网络下进行交易时不支持此功能。
MPI 功能
如果您在授权交易发起前优先让买家完成第三方 3D 核身校验,此时需要您在调用 支付 接口发起授权支付时,通过 mpiData 字段传入 3D 核身结果并指定指定交易为非 3D 认证:
字段 | 说明 |
mpiData.threeDSVersion | 传入第三方核身机构返回的 3D 协议版本号。 |
mpiData.caav | 传入第三方核身机构返回的 caav。 |
mpiData.dsTransactionId | 传入第三方核身机构返回的交易唯一标识符。 |
mpiData.eci | 传入第三方核身机构返回的 ECI。 |
is3DSAuthentication | 传入 |
enableAuthenticationUpgrade | 传入 |
表 4. MPI 信息
注意:韩国卡组发行的卡在韩国卡组交易网络下进行交易时,不支持此功能。
您调用 支付 接口传入 mpiData 等关键信息的请求样例如下:
{
"env": {
"browserInfo": {
"acceptHeader": "*/*",
"javaEnabled": true,
"javaScriptEnabled": true,
"language": "zh_CN",
"userAgent": "Chrome/100"
},
"terminalType": "APP",
"clientIp": "112.80.248.78",
"deviceId": "e******************************************1",
"osType": "IOS",
"deviceLanguage": "zh_CN",
"colorDepth": 48,
"screenHeight": 768,
"screenWidth": 1024,
"timeZoneOffset": 1
},
"order": {
"orderAmount": {
"currency": "EUR",
"value": "30000"
},
"orderDescription": "Cappuccino #grande (Mika's coffee shop)",
"referenceOrderId": "O*******************1",
"goods": [
{
"referenceGoodsId": "383382011_SGAMZ-90452****",
"goodsName": "[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto",
"goodsUrl": "https://www.lazada.sg/products/3-boxes-starbucks-cappuccino-milk-coffee-pods-coffee-capsules-by-nescafe-dolce-gusto-i383382011-s904520356.html?clickTrackInfo=undefined&search=1&source=search&spm=a2o42.searchlist.list.3",
"goodsCategory": "Digital Goods/Digital Vouchers/Food and Beverages",
"goodsUnitAmount": {
"currency": "EUR",
"value": "30000"
},
"goodsQuantity": "10"
}
],
"shipping": {
"shippingName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
},
"shippingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"shippingCarrier": "FedEx",
"shippingPhoneNo": "1234567****",
"shipToEmail": "test***@gmail.com"
},
"buyer": {
"referenceBuyerId": "t**********4",
"buyerPhoneNo": "********567",
"buyerEmail": "exam***@alipay.com",
"buyerName": {
"firstName": "D****",
"lastName": "L****",
"fullName": "Dehua Skr****",
"middleName": "S****"
}
}
},
"paymentAmount": {
"currency": "EUR",
"value": "30000"
},
"paymentMethod": {
"paymentMethodType": "CARD",
"paymentMethodMetaData": {
"isCardOnFile": false,
"enableAuthenticationUpgrade": false,
"is3DSAuthentication": false,
"mpiData": {
"eci": "02",
"threeDSVersion": "2.2.0",
"caav": "cavvSample",
"dsTransactionId": "sample_dsTranascti****"
},
"cvv": "850",
"cardholderName": {
"firstName": "Tom",
"lastName": "Jay"
},
"expiryMonth": "12",
"billingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"expiryYear": "29",
"cardNo": "****0615"
}
},
"settlementStrategy": {
"settlementCurrency": "EUR"
},
"paymentNotifyUrl": "https://www.alipay.com/notify",
"paymentRedirectUrl": "https://www.alipay.com",
"paymentRequestId": "P*******************1",
"productCode": "CASHIER_PAYMENT",
"paymentFactor": {
"isAuthorization": true
}
}
您调用 支付会话 接口传入 mpiData 等关键信息的请求样例如下:
{
"env": {
"clientIp": "112.80.248.78"
},
"order": {
"orderAmount": {
"currency": "EUR",
"value": "30000"
},
"orderDescription": "Cappuccino #grande (Mika's coffee shop)",
"referenceOrderId": "O********************1",
"goods": [
{
"referenceGoodsId": "3********************2",
"goodsName": "[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto",
"goodsUrl": "https://www.lazada.sg/products/3-boxes-starbucks-cappuccino-milk-coffee-pods-coffee-capsules-by-nescafe-dolce-gusto-i383382011-s904520356.html?clickTrackInfo=undefined&search=1&source=search&spm=a2o42.searchlist.list.3",
"goodsCategory": "Digital Goods/Digital Vouchers/Food and Beverages",
"goodsUnitAmount": {
"currency": "EUR",
"value": "30000"
},
"goodsQuantity": "10"
}
],
"shipping": {
"shippingName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
},
"shippingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"shippingCarrier": "FedEx",
"shippingPhoneNo": "1234567****",
"shipToEmail": "test@gmail.com"
},
"buyer": {
"referenceBuyerId": "test1234****",
"buyerPhoneNo": "1234567****",
"buyerEmail": "example@alipay.com",
"buyerName": {
"firstName": "D****",
"lastName": "L****",
"fullName": "Dehua Skr****",
"middleName": "S****"
}
}
},
"paymentAmount": {
"currency": "EUR",
"value": "30000"
},
"paymentMethod": {
"paymentMethodType": "CARD",
"paymentMethodMetaData": {
"isCardOnFile": false,
"enableAuthenticationUpgrade": false,
"is3DSAuthentication": false,
"mpiData": {
"eci": "02",
"threeDSVersion": "2.2.0",
"caav": "cavvSample",
"dsTransactionId": "sample_dsTranascti****"
},
"cvv": "850",
"cardholderName": {
"firstName": "Tom",
"lastName": "Jay"
},
"expiryMonth": "12",
"billingAddress": {
"zipCode": "310000",
"address2": "Xihu",
"city": "Hangzhou",
"address1": "Wuchang road",
"state": "Zhejiang",
"region": "CN"
},
"expiryYear": "29",
"cardNo": "****0615"
}
},
分期付款
您可以在买家支付时为买家提供分期付款能力,让买家可以选择分期的支付方式。下图展示了分期付款支付的页面:
图 2. 分期付款体验图
如上分期付款体验图中,买家选择完卡分期支付方式后,会在分期计划中展示分期期数和每期金额等相关信息,买家选择首期后去支付。
在买家完成首期支付后,Alipay 就会将该笔订单的全部金额按合同中约定的结算周期结算给您。
【注意】由于您无需为买家提供分期付款垫资,因此不建议您向买家收取分期手续费。
获取卡品牌分期能力
您可以通过调用 查询 接口获取支付方式支持的分期能力,包含支持的卡品牌、可分期数、及可分期的最大最小总金额等信息。
如下示例展示了 查询 接口返回的卡品牌的分期相关信息:
{
"result": {
"resultStatus": "S",
"resultCode": "SUCCESS",
"resultMessage": "success."
},
"paymentOptions": [
{
"paymentMethodRegion": [
"BR"
],
"paymentMethodCategory": "CARD",
"installment": {
"plans": [
{
"interestRate": "0.00",
"installmentNum": "2",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "3",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"installmentNum": "4",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"installmentNum": "5",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"installmentNum": "6",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "7",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "8",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "9",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "10",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "11",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "12",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "500"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "6000000"
}
},
{
"interestRate": "0.00",
"installmentNum": "2",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "3",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "4",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "5",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "6",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "7",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "8",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "9",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "10",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "11",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
},
{
"interestRate": "0.00",
"installmentNum": "12",
"interval": "MONTH",
"minInstallmentAmount": {
"currency": "BRL",
"value": "4000"
},
"enabled": true,
"maxInstallmentAmount": {
"currency": "BRL",
"value": "999999999900"
}
}
],
"supportCardBrands": [
{
"logo": {
"logoName": "AMEX",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/7a0284b0-7577-493b-bc96-6809ec2f7f79.svg"
},
"cardBrand": "AMEX"
},
{
"logo": {
"logoName": "HIPERCARD",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/42079be8-2bdd-48a5-9da9-eb7e0917f349.svg"
},
"cardBrand": "HIPERCARD"
},
{
"logo": {
"logoName": "MASTERCARD",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg"
},
"cardBrand": "MASTERCARD"
},
{
"logo": {
"logoName": "VISA",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg"
},
"cardBrand": "VISA"
},
{
"logo": {
"logoName": "ELO",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/b252dbb2-1da4-41a1-b796-21eea0d20d75.svg"
},
"cardBrand": "ELO"
}
]
},
"paymentOptionDetail": {
"funding": [
"CREDIT"
],
"supportCardBrands": [
{
"logo": {
"logoName": "AMEX",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/7a0284b0-7577-493b-bc96-6809ec2f7f79.svg"
},
"cardBrand": "AMEX"
},
{
"logo": {
"logoName": "HIPERCARD",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/42079be8-2bdd-48a5-9da9-eb7e0917f349.svg"
},
"cardBrand": "HIPERCARD"
},
{
"logo": {
"logoName": "MASTERCARD",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg"
},
"cardBrand": "MASTERCARD"
},
{
"logo": {
"logoName": "VISA",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg"
},
"cardBrand": "VISA"
},
{
"logo": {
"logoName": "ELO",
"logoUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/b252dbb2-1da4-41a1-b796-21eea0d20d75.svg"
},
"cardBrand": "ELO"
}
]
},
"logo": {
"logoName": "Credit and Debit Card",
"logoUrl": "https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg"
},
"paymentMethodType": "CARD",
"enabled": true
},
{
"paymentMethodRegion": [
"BR"
],
"paymentMethodCategory": "CHECKOUT",
"logo": {
"logoName": "mercado pago",
"logoUrl": "https://gw.alipay.com/antom/icon/medium/default/MercadoPagoCheckout.svg"
},
"paymentMethodType": "MERCADOPAGO_BR",
"enabled": true
},
{
"disableReason": "CURRENT_CHANNEL_NOT_EXIST",
"paymentMethodRegion": [
"CL"
],
"paymentMethodCategory": "CHECKOUT",
"logo": {
"logoName": "mercado pago",
"logoUrl": "https://gw.alipay.com/antom/icon/medium/default/MercadoPagoCheckout.svg"
},
"paymentMethodType": "MERCADOPAGO_CL",
"enabled": false
},
{
"disableReason": "CURRENT_CHANNEL_NOT_EXIST",
"paymentMethodRegion": [
"MX"
],
"paymentMethodCategory": "CHECKOUT",
"logo": {
"logoName": "mercado pago",
"logoUrl": "https://gw.alipay.com/antom/icon/medium/default/MercadoPagoCheckout.svg"
},
"paymentMethodType": "MERCADOPAGO_MX",
"enabled": false
},
{
"disableReason": "CURRENT_CHANNEL_NOT_EXIST",
"paymentMethodRegion": [
"PE"
],
"paymentMethodCategory": "CHECKOUT",
"logo": {
"logoName": "mercado pago",
"logoUrl": "https://gw.alipay.com/antom/icon/medium/default/MercadoPagoCheckout.svg"
},
"paymentMethodType": "MERCADOPAGO_PE",
"enabled": false
}
]
}
发起分期付款
通过 API 或 SDK 集成方式发起分期付款的关键操作如下。
API 集成方式
如果买家在支付时选择分期付款,您需要在发起支付前收集买家分期付款的相关信息,如分期期数,并在调用 支付 接口时通过 creditPayPlan 字段传入分期信息。发起支付请求时,表示分期信息的关键字段为 creditPayPlan.installmentNum,表示分期期数,取值范围为 2
到 12
。
更多字段详情说明,请参考 支付 接口。
您调用 支付 接口发起分期支付请求样例如下:
{
"settlementStrategy": {
"settlementCurrency": "USD"
},
"productCode": "CASHIER_PAYMENT",
"paymentNotifyUrl": "http://gol.alipay.net:8080/amsdemo/record/notify?env=main_online&paymentMethodType=CARD",
"paymentRequestId": "amsdmpay_zy236564_20231016_100559_577",
"paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_zy236564_20231016_100559_577",
"paymentFactor": {
"isAuthorization": true,
"asyncPay": false,
"captureMode": "MANUAL"
},
"paymentMethod": {
"paymentMethodMetaData": {
"cvv": "540",
"cardholderName": {
"firstName": "Tom",
"lastName": "Jerry"
},
"expiryMonth": "01",
"useStringType": false,
"billingAddress": {
"zipCode": "310000",
"address2": "Huanglong",
"city": "Hangzhou",
"address1": "Gongzhuan road",
"state": "Zhejiang",
"region": "CN"
},
"expiryYear": "28",
"cardNo": "4293380420642881"
},
"paymentMethodType": "CARD"
},
"creditPayPlan": {
"installmentNum": 2
},
"enableInstallmentCollection":true,
"paymentAmount": {
"currency": "BRL",
"value": "600"
},
"order": {
"orderAmount": {
"currency": "BRL",
"value": "600"
},
"referenceOrderId": "amsdmorder_zy236564_20231016_100559_577",
"goods": [
{
"referenceGoodsId": "amsdm_good_zy236564_20231016_100559_577",
"goodsUrl": "HangZhou LeiFenTa",
"goodsCategory": "card/ssr/adc",
"goodsUnitAmount": {
"currency": "USD",
"value": "10000"
},
"goodsQuantity": "1",
"goodsName": "Goods No.1",
"goodsSkuName": "SKU1",
"goodsBrand": "AMSDM"
}
],
"env": {
"clientIp": "1.1.1.1",
"osType": "IOS",
"terminalType": "WEB"
},
"extendInfo": "{}",
"orderDescription": "AMSDM_GIFT",
"buyer": {
"referenceBuyerId": "zy236564",
"buyerRegistrationTime": "2022-01-01T09:30:00+08:00",
"buyerName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
}
}
}
}
【注意】如果您未通过 creditPayPlan 传入分期信息,则该笔支付默认为非分期支付。
SDK 集成方式
如果买家在支付时选择分期付款,您可以选择自行收集分期信息,也可以选择指定由 SDK 采集分期信息。
如果您选择自行收集分期信息,需要在发起支付前收集好买家分期付款的相关信息,如分期期数等,并在调用 创建支付会话 接口时通过 creditPayPlan 字段传入分期信息。发起支付请求时,表示分期信息的关键字段为 creditPayPlan.installmentNum,表示分期期数,取值范围为 2
到 12
。
更多字段详情说明,请参考 创建支付会话 接口。
自行采集分期信息模式下,您调用 创建支付会话 接口发起分期支付请求样例如下:
{
"settlementStrategy": {
"settlementCurrency": "USD"
},
"productCode": "CASHIER_PAYMENT",
"paymentNotifyUrl": "http://gol.alipay.net:8080/amsdemo/record/notify?env=main_online&paymentMethodType=CARD",
"paymentRequestId": "amsdmpay20231016_100927_794",
"agreementInfo": {
"authState": "amsdemo_authState_zy236564_20231016_100927_794"
},
"paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_zy236564_20231016_100927_794",
"paymentFactor": {
"isAuthorization": true,
"asyncPay": false,
"captureMode": "MANUAL"
},
"paymentMethod": {
"paymentMethodType": "CARD"
},
"creditPayPlan": {
"installmentNum": 2
},
"enableInstallmentCollection":true,
"paymentAmount": {
"currency": "BRL",
"value": "6000"
},
"order": {
"orderAmount": {
"currency": "BRL",
"value": "6000"
},
"referenceOrderId": "amsdmorder_zy236564_20231016_100927_794",
"goods": [
{
"referenceGoodsId": "amsdm_good_zy236564_20231016_100927_794",
"goodsUrl": "HangZhou LeiFenTa",
"goodsCategory": "card/ssr/adc",
"goodsUnitAmount": {
"currency": "USD",
"value": "10000"
},
"goodsQuantity": "1",
"goodsName": "Goods No.1",
"goodsSkuName": "SKU1",
"goodsBrand": "AMSDM"
}
],
"env": {
"clientIp": "1.1.1.1",
"osType": "IOS",
"terminalType": "WEB"
},
"extendInfo": "{}",
"orderDescription": "AMSDM_GIFT",
"buyer": {
"referenceBuyerId": "zy236564",
"buyerRegistrationTime": "2022-01-01T09:30:00+08:00",
"buyerName": {
"firstName": "Dehua",
"lastName": "Liu",
"fullName": "Dehua Skr Liu",
"middleName": "Skr"
}
}
}
}