自助发卡接口
diff --git "a/source/_posts/\344\270\200\345\215\241\351\200\232v5\347\263\273\347\273\237\345\272\224\347\224\250\346\216\245\345\217\243\346\226\207\346\241\243.md" "b/source/_posts/\344\270\200\345\215\241\351\200\232v5\347\263\273\347\273\237\345\272\224\347\224\250\346\216\245\345\217\243\346\226\207\346\241\243.md"
index e6e236e..b6a1099 100644
--- "a/source/_posts/\344\270\200\345\215\241\351\200\232v5\347\263\273\347\273\237\345\272\224\347\224\250\346\216\245\345\217\243\346\226\207\346\241\243.md"
+++ "b/source/_posts/\344\270\200\345\215\241\351\200\232v5\347\263\273\347\273\237\345\272\224\347\224\250\346\216\245\345\217\243\346\226\207\346\241\243.md"
@@ -1679,7 +1679,236 @@
 
 ```
 
+# 7、自助发卡 #
+## 7.1 开卡计算费用 ##
 
+**请求URL:**
+
+- `https://ip:port/epayapi/services/front/card/publish/calculateopencardcost`
+
+**请求方式/格式:** 
+
+- POST
+- application/x-www-form-urlencoded
+
+**请求参数:**
+
+- 签名说明:除设备签到专用参数(app_id,term_id,timestamp,sign_method,sign)外,其他参数按参数名称的字典排序拼接非空参数值,然后加上timestamp,最后加上sessionkey构成加密字符串。
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| cardtype | Integer | 发卡类型 |
+| custid | Integer | 客户号 |
+| feetype | Integer | 收费类别 |
+| app_id | String | 应用ID |
+| term_id| String | 设备终端号或物理ID |
+| timestamp | String | 时间戳 ‘yyyyMMddHHmmss’ |
+| sign | String | 签名 |
+| sign_method | String | 签名方法 |
+
+
+**返回参数说明:**
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| status | String | 状态 success/fail |
+| error | String | 错误信息 |
+| amount | Double | 发卡费用 |
+| expiredate |String| 卡有效期 |
+| transinfo | String| 收费信息 |
+
+**返回示例:**
+
+- 成功
+
+```json
+{
+    "status": "success",
+    "amount": "0.00",
+    "expiredate": "2018-08-25",
+    "transinfo": ""
+}
+```
+
+- 失败
+
+```json
+{
+    "status": "fail",
+    "amount": "签名验证失败"
+}
+
+```
+
+## 7.1 获取写卡数据 ##
+
+**请求URL:**
+
+- `https://ip:port/epayapi/services/front/card/publish/opencardinit`
+
+**请求方式/格式:** 
+
+- POST
+- application/x-www-form-urlencoded
+
+**请求参数:**
+
+- 签名说明:除设备签到专用参数(app_id,term_id,timestamp,sign_method,sign)外,其他参数按参数名称的字典排序拼接非空参数值,然后加上timestamp,最后加上sessionkey构成加密字符串。
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| cardtype | Integer | 发卡类型 |
+| custid | Integer | 客户号 |
+| feetype | Integer | 收费类别 |
+| cardphyid | String | 新卡物理ID |
+| cardphytypecode | Integer | 新卡物理类型 |
+| showcardno | String | 新卡显示卡号 |
+| amount | Integer | 总金额(充值金额+费用),单位分。包含cost |
+| cost | Integer | 发卡费用,单位分 |
+| fundtype | Integer | 资金类型 1-现金 2-支票 3-经费本 |
+| voucherno | String | 票据号码,fundtype不为1时必填 |
+| expiredate | String | 卡有效期 |
+| samno | String | PSAM卡号 |
+| operid | Integer | 操作员ID |
+| termid | Integer | 设备ID |
+| app_id | String | 应用ID |
+| term_id| String | 设备终端号或物理ID |
+| timestamp | String | 时间戳 ‘yyyyMMddHHmmss’ |
+| sign | String | 签名 |
+| sign_method | String | 签名方法 |
+
+**返回参数说明:**
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| status | String | 状态 success/fail |
+| error | String | 错误信息 |
+| data | String | 写卡数据 |
+| cardmode |String| 卡模式 ‘A’或‘B’|
+| chargeid | Integer| 客户号 |
+| amount | Double | 总金额,元 |
+| cost | Double| 费用,元 |
+| cardno | Integer| 新卡卡号 |
+| refno |String| 开卡流水号 |
+| accdate| String| 记账日期 |
+
+**返回示例:**
+
+- 成功
+
+```json
+{
+    "status": "success",
+    "data": "CF_SINGLEMAXAMT=3000;CF_DAYMAXAMT=20000;CF_CARDNO=259;CF_SHOWCARDNO=0000000000;CF_CARDVERNO=000000000000;CF_CARDSTATUS=0;CF_FEETYPE=14;CF_STARTDATE=20170825;CF_EXPIREDATE=20300901;CF_CARDTYPE=4;CF_CARDPWD=926441;CF_CUSTID=2000081;CF_CUSTTYPE=14;CF_STUEMPNO=10002255;CF_NAME=蒋国民;CF_SCHOOLCODE=2;CF_SEX=1;CF_DEPTCODE=03;CF_IDNO=310104480926441;CF_IDTYPE=1;CF_NATIONALITY=1;CF_COUNTRY=CHN;CF_CREDITLIMIT=20000;CF_CREDITSEQNO=1",
+    "cardmode": "A",
+    "chargeid": "2000081",
+    "amount": 0.12,
+    "cost": 0,
+    "accdate": "20170825",
+    "refno": "20170825105300003182",
+    "cardno": 259
+}
+```
+
+- 失败
+
+```json
+{
+    "status": "fail",
+    "amount": "签名验证失败"
+}
+
+```
+
+
+## 7.1 写卡确认和充值 ##
+
+**请求URL:**
+
+- `https://ip:port/epayapi/services/front/card/publish/opencardconfirm`
+
+**请求方式/格式:** 
+
+- POST
+- application/x-www-form-urlencoded
+
+**请求参数:**
+
+- 签名说明:除设备签到专用参数(app_id,term_id,timestamp,sign_method,sign)外,其他参数按参数名称的字典排序拼接非空参数值,然后加上timestamp,最后加上sessionkey构成加密字符串。
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| accdate | String | 记账日期,第一步获取的accdate |
+| refno | String | 开卡流水号,第一步获取的refno |
+| cardno | Integer | 新卡卡号,第一步获取的cardno |
+| isok | Integer | 写卡成功标志 |
+| isbreak | Integer | 中途拔卡标志 |
+| errmsg | String | 写卡失败原因 |
+| samno | String | PSAM卡号 |
+| custid | Integer | 客户号,第一步获取的chargeid |
+| amount | Integer | 总金额(充值金额+费用),单位分。包含cost |
+| cost | Integer | 发卡费用,单位分 |
+| fundtype | Integer | 资金类型 1-现金 2-支票 3-经费本 |
+| voucherno | String | 票据号码,fundtype不为1时必填 |
+| cardmode | String | 卡模式 |
+| operid | Integer | 操作员ID |
+| termid | Integer | 设备ID |
+| app_id | String | 应用ID |
+| term_id| String | 设备终端号或物理ID |
+| timestamp | String | 时间戳 ‘yyyyMMddHHmmss’ |
+| sign | String | 签名 |
+| sign_method | String | 签名方法 |
+
+**返回参数说明:**
+
+| 参数名 | 类型 | 说明 |
+| --- | --- | --- |
+| status | String | 状态 success/fail |
+| error | String | 错误信息 |
+| succmsg | String | 发卡信息 |
+| refno |String| 开卡流水号 |
+| endflag | String | 结束标志 ‘YES’或‘NO’ (暂不支持B卡充值,发B卡请勿充值)|
+| cardno | Integer| 新卡卡号 |
+| custid | Integer | 客户号 |
+| stuempno | String| 学工号 |
+| name | String | 姓名 |
+| charge | String | 实际充值金额 |
+| feeamt | String | 充值手续费金额 |
+| ftyname | String | 收取的基金类型 |
+| fundmsg | String | 发卡收费说明 |
+| accbal | String | 账户余额 |
+
+**返回示例:**
+
+- 成功
+
+```json
+{
+    "status": "success",
+    "succmsg": "发卡成功! 收入【现金】金额为:0.12元,扣除成本费:0.0元,扣除手续费:0.01元,成功充值:0.11元。",
+    "refno": "20170825110000003183",
+    "endflag": "YES",
+    "cardno": "260",
+    "custid": "2000081",
+    "name": "蒋国民",
+    "stuempno": "10002255",
+    "charge": "0.11元",
+    "feeamt": "0.01元",
+    "ftyname": "现金",
+    "fundmsg": "0.12元(含成本费:0.0元)",
+    "accbal": "0.11元"
+}
+```
+
+- 失败
+
+```json
+{
+    "status": "fail",
+    "error": "签名验证失败"
+}
+
+```