- 集成指南
- 支持的功能(付款方式)
- 设备付款
- Samsung Pay 付款
Samsung Pay
Samsung Pay 是 Samsung Electronics 提供的一项移动支付和数字钱包服务,允许付款人使用支持的 Samsung 设备进行付款。 Samsung Pay 是 Mastercard Gateway 支持的设备付款。
此页内容介绍特定于 Samsung Pay 的集成详细信息。 建议您在构建 Samsung Pay 集成前,先阅读设备付款集成指南。
先决条件
若要接受 Samsung Pay 付款:
- 您必须注册 Samsung。
- 您在网关上的商家配置文件必须由 your payment service provider 启用设备付款。
在您的集成中添加对 Samsung Pay 的支持
您可以使用 Direct Payment 将 Samsung Pay 集成到您的移动应用中。
- 付款确认后,将 Samsung Pay 返回的加密付款令牌提交到您的服务器。
- 使用您的私人密钥在服务器上对付款令牌解密。 相关解密步骤,请联系 Samsung。
- 在 Authorize/Pay 请求或 Update Session 请求中对应的交易字段内提供解密令牌的密钥。
Samsung Pay JSON 密钥对应的 API 请求字段说明tokenPAN sourceOfFunds.provided.card.number 设备特定主账号。 tokenPanExpiration sourceOfFunds.provided.card.expiry.month
sourceOfFunds.provided.card.expiry.yeartokenPAN 的过期日期。 method sourceOfFunds.provided.card.devicePayment.
cryptogramFormat密文格式。 将此项设置为 3DSECURE。 cryptogram sourceOfFunds.provided.card.devicePayment.
onlinePaymentCryptogram3DSecure 格式的密文。 eci_indicator sourceOfFunds.provided.card.devicePayment.
eciIndicator使用 3DSecure 规范的 ECI 指示器。 currency_code order.currency 交易的 ISO 4217 货币代码。 amount order.amount 订单金额。 - 除上述字段外,将这些字段包含在 Authorize/Pay 请求中,并提交到网关。
- transaction.source=INTERNET
- order.walletProvider=SAMSUNG_PAY
- device.mobilePhoneModel: (可选)用于发起付款的移动设备的识别码。
- posTerminal.location: 您可以指定
PAYER_TERMINAL_OFF_PREMISES
或PAYER_TERMINAL_ON_PREMISES
。 如果您未提供值,将使用PAYER_TERMINAL_OFF_PREMISES
。
请求示例
下面是付款令牌由网关解密的 REST 中的 Authorization 请求示例。
URL | 'https://evopaymentsmexico.gateway.mastercard.com/api/rest/version/71/merchant/MADA_DMS_AU/order/446974188/transaction/746444836' |
HTTP 方法 | PUT |
标头 | 'Authorization: bWVyY2hhbnQuTUFEQV9ETVNfQVU6M2RjYTQ2YTU1ODYwNDlmMjhhM2FmZGJmZDEwMGNmNWQ=' |
'{ "apiOperation": "AUTHORIZE", "order": { "amount": "1500", "currency": "JPY", "walletProvider": "SAMSUNG_PAY" }, "sourceOfFunds": { "provided": { "card": { "number": "5123450000000008", "expiry": { "month": "01", "year": "39" }, "devicePayment": { "cryptogramFormat": "3DSECURE", "onlinePaymentCryptogram": "AAAAAAAALJI6DbfqRzUcwAC6gAAGhgEDoLABAAhAgAABAAAAMlkUxA==", "eciIndicator": "20" } } }, "type": "CARD" }, "device": { "ani": "12341234" }, "transaction": { "source": "INTERNET" } }'
响应示例
{ "authorizationResponse": { "commercialCard": "123", "commercialCardIndicator": "1", "date": "0314", "financialNetworkCode": "MCC", "posData": "1025104006600", "posEntryMode": "812", "processingCode": "003000", "responseCode": "00", "stan": "47497", "time": "105733", "transactionIdentifier": "609405631", "transactionIntegrityClass": "A1" }, "device": { "ani": "12341234" }, "gatewayEntryPoint": "WEB_SERVICES_API", "merchant": "MADA_DMS_AU", "order": { "amount": 1500, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "certainty": "FINAL", "chargeback": { "amount": 0, "currency": "JPY" }, "creationTime": "2023-03-14T10:57:33.175Z", "currency": "JPY", "id": "446974188", "lastUpdatedTime": "2023-03-14T10:57:33.554Z", "merchantAmount": 1500, "merchantCategoryCode": "1234", "merchantCurrency": "JPY", "status": "AUTHORIZED", "totalAuthorizedAmount": 1500, "totalCapturedAmount": 0, "totalDisbursedAmount": 0, "totalRefundedAmount": 0, "walletProvider": "SAMSUNG_PAY" }, "response": { "acquirerCode": "00", "acquirerMessage": "Approved", "gatewayCode": "APPROVED", "gatewayRecommendation": "NO_ACTION" }, "result": "SUCCESS", "sourceOfFunds": { "provided": { "card": { "brand": "MASTERCARD", "devicePayment": { "cryptogramFormat": "3DSECURE" }, "deviceSpecificExpiry": { "month": "1", "year": "39" }, "deviceSpecificNumber": "512345xxxxxx0008", "fundingMethod": "UNKNOWN", "number": "xxxxxxxxxxxxxxxx", "scheme": "MASTERCARD", "storedOnFile": "NOT_STORED" } }, "type": "CARD" }, "timeOfLastUpdate": "2023-03-14T10:57:33.554Z", "timeOfRecord": "2023-03-14T10:57:33.263Z", "transaction": { "acquirer": { "batch": 20230314, "date": "0314", "id": "SYSTEST_ACQ_S2I", "merchantId": "12345678", "transactionId": "609405631" }, "amount": 1500, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "authorizationCode": "112233", "currency": "JPY", "id": "746444836", "receipt": "307310047497", "source": "INTERNET", "stan": "47497", "terminal": "1111", "type": "AUTHORIZATION" }, "version": "71" }
测试 Samsung Pay 集成
您可以使用测试商家配置文件和支持的 DPAN 或 FPAN 测试与网关的集成。
如果您在测试设备或卡支付,请使用下表中的支持的 DPAN 或 FPAN。
组织 |
DPAN 或 FPAN |
过期日期 |
---|---|---|
Mastercard | 5123456789012346 | 01/2039 |
American Express | 340353278080900 | 01/2039 |
Visa | 4440000009900010 | 01/2039 |