🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
**1.初始化收银台** ~~~[api] //- (void)initCashierVCWithOrderInfo:(NSDictionary *)orderInfo; *nsdictionary:orderInfo#订单信息 <<< orderInfo 订单信息 字典里的字段 | field name | data type | most | description | appId string yes 品牌ID requestTime string yes 发送请求时间,如:20190226153808 signType string yes 加密方式(md5) version string yes 版本号(1.0) orderId string yes 订单编号(123456789012) orderName string yes 订单名称(13.3英寸MacBook银色) orderAmount string yes 订单金额(元) totalFee string yes 支付金额(元) storeId string yes 店铺id(4450) attach string yes 附加数据,在查询接口和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据 body string yes 商品描述,订单信息 mchCreateIp string yes 订单生成的机器 IP orderTime string yes 业务订单生成时间(20190226153808) timeExpire string yes 业务订单支付过期时间(20190226153808) customid string yes 会员编号(MDA2MDQ5NDcO0O0O) callbackUrl string yes 回调地址 subject string yes 商品的标题/交易标题/订单标题/订单关键字等 orderList string yes 订单集合orderList集合含子订单号、子订单金额、店铺id、店铺名称 例: [{"outOrderNo":"sw20190417001013222","outOrderAmount":15.00,"storeId":"4450","storeName":"商户名称1"},{"outOrderNo":"sw20190417001013332","outOrderAmount":25.00,"storeId":"4458","storeName":"商户名称2"}] prepareUrl string yes 参数加密接口 mainIp string yes 收银台服务器域名 limitPay string no 禁用支付方式(nowx|noali|nounion|nojycoin|nobalance|notbj) key string yes 签名加密要使用 <<< 示例 NSDictionary *orderInfoDict = @{ @"appId":appId, @"requestTime":requestTime, @"signType":signType, @"version":version, @"orderId":orderId, @"orderName":orderName, @"orderAmount":orderAmount, @"totalFee":totalFee, @"storeId":storeId, @"attach":attach, @"body":body, @"mchCreateIp":mchCreateIp, @"orderTime":orderTime, @"timeExpire":timeExpire, @"customid":customid, @"callbackUrl":callbackUrl, @"subject":subject, @"orderList":orderListStr, @"limitPay":limitPay, @"prepareUrl":prepareUrl, @"mainIp":mainIp, @"key":key }; [[CashierManager shareManager] initCashierVCWithOrderInfo:orderInfoDict]; ~~~ ******************************************************************** **2.获取收银台支付类型** ~~~[api] //- (void)getPayTypelistWithParDict:(NSDictionary *)parDict result:(resultBlock)result; *nsdictionary:parDict#参数字典 block:result#请求结果 <<< parDict 字典里的字段 | field name | data type | most | description | appId string yes 品牌id requestTime string yes 请求时间(20190226153808) version string yes 版本(1.0) signType string yes 签名加密类型(md5) storeId string yes 店铺id totalFee string yes 支付金额 (int 单位为分) outOrderId string yes 订单id(123456789012) customid string yes 会员id limitPay string no 禁用支付方式(nowx|noali|nounion|nojycoin|nobalance|notbj) <<< 示例 NSDictionary *dic = @{ @"appId":appId, @"requestTime":requestTime, @"signType":signType, @"version":version, @"storeId":storeId, @"customid":customid, @"limitPay":limitPay, @"totalFee":totalFee, @"outOrderId":outOrderId, }; [[CashierManager shareManager] getPayTypelistWithParDict:dic result:^(id _Nullable responseObject, NSError * _Nonnull error) { }]; ~~~ ******************************************************************** **3.支付** ~~~[api] //- (void)startPayWithParDict:(NSDictionary *)parDict result:(resultBlock)result; *nsdictionary:parDict#参数字典 block:result#请求结果 <<< parDict 字典里的字段 | field name | data type | most | description | appId string yes 品牌id requestTime string yes 请求时间(20190226153808) version string yes 版本(1.0) signType string yes 签名加密类型(md5) outOrderId string yes 业务订单 outOrderTime string yes 业务订单生成时间20190226153808 outOrderAmount string yes 业务订单金额 (int 单位为分) totalFee string yes 支付金额(int 单位为分) timeExpire string yes 业务订单支付过期时间20091225091010 callbackUrl string yes 回调地址 orderList string yes 订单集合orderList集合含子订单号、子订单金额、店铺id、店铺名称 例: [{"outOrderNo":"sw20190417001013222","outOrderAmount":15.00,"storeId":"4450","storeName":"商户名称1"},{"outOrderNo":"sw20190417001013332","outOrderAmount":25.00,"storeId":"4458","storeName":"商户名称2"}] payInfo string yes 支付信息 例: [{"type":"app_wx","amount":"10"},{"type":"app_tb","amount":"90"}] amount单位为分 type:支付类型目前有六种:app_wx app微信 , app_ali app支付宝 ,app_upay app云闪付,app_tb app通宝 ,app_tbj app通宝+,app_zz app至尊余额 deduction string yes 是否有通宝抵扣(0无 1有) customid string no 会员id body string no 商品描述 attach string no 附加数据,在查询接口和支付通知中原样返回,该字段主要用于商户携带订单的自定义数据 mchCreateIp string no 订单生成的机器 IP subject string no 商品的标题/交易标题/订单标题/订单关键字等 payPwd string no 支付密码,体系内非通宝抵扣需要支付密码 <<< 示例 NSDictionary *dic = @{ @"appId":appId, @"requestTime":requestTime, @"signType":signType, @"version":version, @"outOrderId":outOrderId, @"outOrderTime":outOrderTime, @"outOrderAmount":outOrderAmount, @"totalFee":totalFee, @"timeExpire":timeExpire, @"callbackUrl":callbackUrl, @"customid":customid, @"orderList":orderList, @"body":body, @"attach":attach, @"mchCreateIp":mchCreateIp, @"subject":subject, @"deduction":deduction, @"payInfo":payInfo, @"payPwd":payPwd, }; [[CashierManager shareManager] startPayWithParDict:dic result:^(id _Nullable responseObject, NSError * _Nonnull error) { }]; ~~~ ********************************************************************