> For the complete documentation index, see [llms.txt](https://docs.supefina.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.supefina.net/huan-ying-shi-yong-supefina-de-api-wen-dang/dai-shou/mo-xi-ge/card.md).

# Card

### 支付流程

<figure><img src="/files/Ul2opWUCAScQ8dWkzMVL" alt=""><figcaption></figcaption></figure>

1、用户在商户网站/应用下单，并选择Card支付；

2、商户向Supefina发起Card支付请求；

3、Supefina返回Card支付URL地址；

4、商户将该地址在用户侧打开；

5、用户按照页面提示进行验证和支付；

6、用户支付成功；

7、Supefina将支付成功信息通知商户。

### 请求地址

<table data-full-width="true"><thead><tr><th width="122">环境名称</th><th>URL</th></tr></thead><tbody><tr><td>SandBox</td><td><mark style="color:blue;"><code>POST</code></mark><br>https://api.supefina.tech/api/supefina/transactions/payin</td></tr><tr><td><mark style="color:red;">正式环境</mark></td><td><mark style="color:red;"><code>POST</code></mark><br><mark style="color:red;">https://api.supefina.net/api/supefina/transactions/payin</mark></td></tr></tbody></table>

### 请求参数

#### 请求头

<table data-full-width="true"><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td><code>application/json</code></td></tr></tbody></table>

#### 请求体

<table data-full-width="true"><thead><tr><th width="188">变量名</th><th width="138">类型</th><th width="83">必填</th><th width="504">描述</th></tr></thead><tbody><tr><td>countryId</td><td>String</td><td>是</td><td>国家编号<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#afwzp">字典表-国家编号</a><br>墨西哥：<code>MEX</code></td></tr><tr><td>currency</td><td>String</td><td>是</td><td>币种<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#huo-bi-currency">字典表-货币</a><br>墨西哥比索：<code>MXN</code></td></tr><tr><td>orderAmount</td><td>String</td><td>是</td><td>订单金额<br>单位比索，需要分可以传入小数，支持两位小数</td></tr><tr><td>merId</td><td>String</td><td>是</td><td>商户ID<br>商户ID获取路径：Supefina商户后台-商户管理-基本信息-商户ID</td></tr><tr><td>merOrderNo</td><td>String</td><td>是</td><td>商户订单号</td></tr><tr><td>nonceStr</td><td>String</td><td>是</td><td>随机字符串<br>长度不能超过32位</td></tr><tr><td>payProduct</td><td>String</td><td>是</td><td><a href="/pages/17IKBEvxR4cpZue8BRdD#mfocd">支付类型</a><br>Card：<code>18</code></td></tr><tr><td>checkOut</td><td>Boolean</td><td>是</td><td>收银台<br><code>true</code>：需要收银台<br><code>false</code>：不需要收银台<br>传<code>true</code></td></tr><tr><td>returnUrl</td><td>Boolean</td><td>否</td><td>支付完成返回地址</td></tr><tr><td>callbackUrl</td><td>String</td><td>是</td><td><p>回调地址</p><p>详见<a href="/pages/mfMq4AmXGJtMyIPchGsF">通知回调说明</a></p></td></tr><tr><td>productName</td><td>String</td><td>是</td><td>商品名称<br>最大50个字符</td></tr><tr><td>productQuantity</td><td>Integer</td><td>否</td><td>商品数量<br>范围[0,1000]</td></tr><tr><td>email</td><td>String</td><td>否</td><td>顾客邮箱<br>3-256个字符<br><strong>电商行业必传</strong></td></tr><tr><td>receiverAddressMain</td><td>String</td><td>否</td><td>收件地址，街道<br>0-50个字符<br><strong>电商行业必传</strong></td></tr><tr><td>receiverAddressExtra</td><td>String</td><td>否</td><td>收件地址，小区，门牌号<br>0-50个字符<br><strong>电商行业必传</strong></td></tr><tr><td>receiverCity</td><td>String</td><td>否</td><td>收件人城市<br>0-50个字符，可包括空格、连字符、撇号、逗号和点<br><strong>电商行业必传</strong></td></tr><tr><td>receiverProvince</td><td>String</td><td>否</td><td>收件人所在省<br>0-40个字符<br>参数：<a href="https://en.wikipedia.org/wiki/ISO_3166-2">https://en.wikipedia.org/wiki/ISO_3166-2</a>  例：NY<br><strong>电商行业必传</strong></td></tr><tr><td>receiverCountry</td><td>String</td><td>否</td><td>收件人国家<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#afwzp">字典表-国家编号</a>  例：BRA<br><strong>电商行业必传</strong></td></tr><tr><td>receiverZipCode</td><td>String</td><td>否</td><td>邮政编码<br>0-12个字母或数字<br><strong>电商行业必传</strong></td></tr><tr><td>receiverPhone</td><td>String</td><td>否</td><td>收件人电话<br>5-20个字符，区添加区号。如：+1 111111111<br><strong>电商行业必传</strong></td></tr><tr><td>alias</td><td>String</td><td>否</td><td>用户名<br>0-60个字符<br><strong>游戏行业必传</strong></td></tr><tr><td>newUser</td><td>Boolean</td><td>否</td><td>是否一个月内的用户<br>true：新用户<br>false：老用户<br><strong>游戏行业必传</strong></td></tr><tr><td>hasDispute</td><td>Boolean</td><td>否</td><td>是否有过历史争议，包含以下任一条：<br>1、利用作弊工具、游戏漏洞等进行不正当行为； <br>2、骚扰其他玩家、进行恶意行为或破坏游戏体验的行为； <br>3、玩家有不当言论、违反游戏规则、频繁被举报；<br>true：有过<br>false：没有<br><strong>游戏行业必传</strong></td></tr><tr><td>hasRefund</td><td>Boolean</td><td>否</td><td>是否有过退款<br>true：有过<br>false：没有<br><strong>游戏行业必传</strong></td></tr><tr><td>hasSingedLong</td><td>Boolean</td><td>否</td><td>注册时间是否超过三个月<br>true：超过<br>false：未超过<br><strong>游戏行业必传</strong></td></tr><tr><td>sign</td><td>String</td><td>是</td><td>签名<br><a href="/pages/DR0Ieg3d88mBdWrXD882">具体参照：签名算法</a></td></tr><tr><td>customerName</td><td>String</td><td>是</td><td>用户名字</td></tr><tr><td>description</td><td>String</td><td>是</td><td><p>描述</p><p>不能带特殊符号,长度不超过200字符</p></td></tr></tbody></table>

### 请求示例

{% code fullWidth="true" %}

```json
{
	"alias": "test alias",
	"callbackUrl": "https://test.com",
	"checkOut": true,
	"countryId": "MEX",
	"currency": "MXN",
	"customerName": "Aaliyah Rogers",
	"description": "Supefina",
	"email": "test@123.com",
	"hasDispute": true,
	"hasRefund": false,
	"hasSingedLong": true,
	"merId": "8102048462634665",
	"merOrderNo": "2025072919413465743446604",
	"newUser": false,
	"nonceStr": "b4cf1bb20d8c49cca4e5815d13e5a352",
	"orderAmount": "200",
	"payProduct": "18",
	"productName": "testName",
	"productQuantity": 10,
	"receiverAddressExtra": "Apt 2",
	"receiverAddressMain": "Sample street 357",
	"receiverCity": "Example city",
	"receiverCountry": "MXN",
	"receiverPhone": "1234567890",
	"receiverProvince": "Example state",
	"receiverZipCode": "01254",
	"returnUrl": "https://www.bing.com/",
	"sign": "91ABE1CB4C93ACC3FB3D4731207B91FB"
}
```

{% endcode %}

签名组装字符串

alias=test alias\&callbackUrl=<https://test.com\\&checkOut=true\\&countryId=MEX\\&currency=MXN\\&customerName=Aaliyah> Rogers\&description=Supefina\&email=<test@123.com>\&hasDispute=true\&hasRefund=false\&hasSingedLong=true\&merId=8102048462634665\&merOrderNo=2025072919413465743446604\&newUser=false\&nonceStr=b4cf1bb20d8c49cca4e5815d13e5a352\&orderAmount=200\&payProduct=18\&productName=testName\&productQuantity=10\&receiverAddressExtra=Apt 2\&receiverAddressMain=Sample street 357\&receiverCity=Example city\&receiverCountry=MXN\&receiverPhone=1234567890\&receiverProvince=Example state\&receiverZipCode=01254\&returnUrl=<https://www.bing.com/\\&key=10b8a891ff6a479e8135f3367c17e87d>

### 响应参数

<table data-full-width="true"><thead><tr><th width="238">变量名</th><th width="208">类型</th><th width="223">描述</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>响应编码<br>具体参照：<a href="/pages/j56ENY9y4TEhx8ssOv8a">响应状态码</a></td></tr><tr><td>data</td><td>Object</td><td>响应数据</td></tr><tr><td>amount</td><td>BigDecimal</td><td>订单金额</td></tr><tr><td>currency</td><td>String</td><td>币种<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#huo-bi-currency">字典表-货币</a><br>墨西哥比索：<code>MXN</code></td></tr><tr><td>merCode</td><td>String</td><td>商户ID</td></tr><tr><td>merOrderNo</td><td>String</td><td>商户订单号</td></tr><tr><td>url</td><td>String</td><td>交易链接</td></tr><tr><td>msg</td><td>String</td><td>响应信息</td></tr></tbody></table>

#### 响应示例

{% code fullWidth="true" %}

```json
{
	"code": "200",
	"msg": "success ",
	"data": {
		"merCode": "8102048462634665",
		"merOrderNo": "2025072919413465743446604",
		"supefinaOrderNo": "2025071950159781458792448",
		"amount": 200,
		"url": "http://h5.supefina.tech/combineCashier?token=22967f6fca9c4ba0a6e5d0f142f6c491",
		"currency": "MXN"
	}
}
```

{% endcode %}

### 回调通知

提交方式：`POST`

<table data-full-width="true"><thead><tr><th width="225">变量名</th><th width="175">类型</th><th width="300">描述</th></tr></thead><tbody><tr><td>amount</td><td>String</td><td>订单金额</td></tr><tr><td>countryId</td><td>String</td><td>国家编号<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#afwzp">字典表-国家编号</a><br>墨西哥：<code>MEX</code></td></tr><tr><td>fee</td><td>String</td><td>预收手续费</td></tr><tr><td>identifier</td><td>String</td><td>付款参考<br>Clabe</td></tr><tr><td>merId</td><td>String</td><td>商户ID</td></tr><tr><td>merOrderId</td><td>String</td><td>商户订单号</td></tr><tr><td>nonceStr</td><td>String</td><td>随机字符串<br>长度不能超过32位</td></tr><tr><td>realityAmount</td><td>String</td><td>实收金额</td></tr><tr><td>realityFee</td><td>String</td><td>实收手续费</td></tr><tr><td>reference</td><td>String</td><td>标识符</td></tr><tr><td>sign</td><td>String</td><td>签名</td></tr><tr><td>status</td><td>String</td><td><a href="/pages/17IKBEvxR4cpZue8BRdD#kxzkj">交易状态</a><br>具体参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#kxzkj">字典表——交易订单状态</a></td></tr><tr><td>supefinaOrderId</td><td>String</td><td>supefina订单号</td></tr><tr><td>transactionType</td><td>String</td><td>交易类型<br><code>01</code>：代收<br><code>02</code>：代付</td></tr></tbody></table>

#### 回调通知示例

```json
{
	"amount": "200.00",
	"countryId": "MEX",
	"customerName": "Aaliyah Rogers",
	"fee": "1.00",
	"merId": "8102048462634665",
	"merOrderId": "2025072919413465743446604",
	"nonceStr": "d8870116-0c31-4455-b745-d8576f",
	"realityAmount": "200",
	"realityFee": "1.00",
	"reference": "CRTD7QBOHTSDSFW0P065PG6F0I80C8L",
	"sign": "5CF88813736D50E062A4C88DD33DB4A6",
	"status": "01",
	"successTime": 1753789322996,
	"supefinaOrderId": "2025071950159781458792448",
	"transactionType": "01"
}
```

签名组装字符串

amount=200.00\&countryId=MEX\&customerName=Aaliyah Rogers\&fee=1.00\&merId=8102048462634665\&merOrderId=2025072919413465743446604\&nonceStr=d8870116-0c31-4455-b745-d8576f\&realityAmount=200\&realityFee=1.00\&reference=CRTD7QBOHTSDSFW0P065PG6F0I80C8L\&status=01\&successTime=1753789322996\&supefinaOrderId=2025071950159781458792448\&transactionType=01\&key=cf5fe06851e84cd7ab227dbbf16f4bf1

**回调通知响应**

商户成功收到回调后需同步返回指定字符串：SUCCESS 不返回或返回其他内容默认通知失败\
如：

```java
public String test(){
	return "SUCCESS";
}
```

### 测试数据

测试环境提供了完整的支付功能，但它只是模拟处理，没有实际的银行交易。

可以使用以下信用卡信息来测试付款。

#### Visa

| Card PAN         | 3-D Secure result                                         | Transaction result           |
| ---------------- | --------------------------------------------------------- | ---------------------------- |
| 4000000000000085 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 4580000000000059 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |
| 4000000000000093 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |

**Mastercard**

| Card PAN         | 3-D Secure result                                         | Transaction result           |
| ---------------- | --------------------------------------------------------- | ---------------------------- |
| 5100000000000065 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 2400000000000069 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |
| 5100000000000073 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |

**Maestro**

| Card PAN         | 3-D Secure result                                         | Transaction result           |
| ---------------- | --------------------------------------------------------- | ---------------------------- |
| 5000000000000025 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 5000000000000033 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |
| 5666666666666955 | 3-D secure version 2, challenge flow, full authentication | Payment has DECLINED status  |

**Discover**

| Card PAN         | 3-D Secure result                                         | Transaction result           |
| ---------------- | --------------------------------------------------------- | ---------------------------- |
| 6500000000000895 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 6500000000000069 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |
| 6011000000000053 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |

**JCB**

| Card PAN         | 3-D Secure result                                         | Transaction result           |
| ---------------- | --------------------------------------------------------- | ---------------------------- |
| 3528000000000015 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 3528000000000023 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |
| 3528000000000049 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |

**UnionPay**

| Card PAN            | 3-D Secure result                                         | Transaction result           |
| ------------------- | --------------------------------------------------------- | ---------------------------- |
| 6222020000000085    | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 8171000000000000079 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |
| 6200000000000053    | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |

**Amex**

| Card PAN        | 3-D Secure result                                         | Transaction result           |
| --------------- | --------------------------------------------------------- | ---------------------------- |
| 370000000000085 | 3-D secure version 2, challenge flow, full authentication | Payment has CONFIRMED status |
| 340000000000033 | 3-D secure version 2, frictionless flow, success          | Payment has CONFIRMED status |
| 340000000000009 | 3-D secure version 2, frictionless flow, attempt          | Payment has CONFIRMED status |

在测试过程中，商户使用任意持卡人姓名、有效期和安全码与这些卡信息进行支付。为了完成认证，3-DS安全认证也通过一个页面模拟，该页面只显示两个按钮，一个按钮用于成功认证，另一个按钮用于认证失败。请注意，当商户选择认证失败时，无论使用了哪个PAN，支付总是会被拒绝。

如果测试过程中，遇到了异常状态码，请直接联系Supefina运营人员处理。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.supefina.net/huan-ying-shi-yong-supefina-de-api-wen-dang/dai-shou/mo-xi-ge/card.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
