跨境系统-支付宝主扫下单

接口描述

商户通过本接口将订单信息上送至合利宝-跨境系统,合利宝-跨境系统调用支付宝下单接口生成二维码返回给商户,商户将二维码信息展示给用户,由用户扫描二维码完成订单支付。

流程图

基本信息

测试请求地址 https://cbtrxtest.helipay.com/cbtrx/rest/pay/appScan
请求地址 https://cbptrx.helipay.com/cbtrx/rest/pay/appScan
提交方式 采用POST方法提交,requestbody传值 Content-Type=[application/json;charset=UTF-8]
签名算法 UTF-8字符编码 SHA256签名 AES加密

请求参数

名称 参数 类型 必填 示例值 说明
产品编码 productCode String(20) ALIPAYSCAN
商户订单号 orderNo String(64) p_20170302185347
商户编号 merchantNo String(10) Me10000002 合利宝-跨境系统分配的商户编号
订单金额 orderAmount Number(10.2) 0.01 单位:元
用户姓名 memberName String(10) 张三
用户身份证号 memberID String(18) 110101200001012999
用户手机号 memberMobile String(20) 13701234567
商品名称 goodsName String(400) Iphone7
下单ip orderIp String(15) 1.1.1.1
有效期 period String(6) 1 默认为7
有效期单位 periodUnit String(10) HOUR YEAR/MONTH/DAY/HOUR/MINUTE/SECOND;默认为DAY
服务器回调地址 serverCallbackUrl String(300) http://www.456.com
平台商户编号 platMerchantNo String(10) 如下说明 电商平台商户所属的平台商编号
报备号 reportId String(20) 123123 产品开通后,此值会发送到商户侧,商户可选择性上送
分账请求参数明细 shareList List(100) 如下说明 若商户开通分账产品,且本次交易需要分账,则此参数必填

分账请求参数明细

名称 参数 类型 必填 示例值 说明
排序参数 index Integer 1 用于交易加密参数排序,不能重复
分账账户编号 shareMerchantNo String(10) Me10000002
分账金额 shareAmount Number(10.2) 0.01 单位:元
所有明细分账金额相加必须等于交易金额
主账户分账金额必须大于交易手续费

响应参数

名称 参数 类型 必填 示例值 说明
产品编码 productCode String(20) ALIPAYSCAN
商户订单号 orderNo String(64) p_20170302185347
商户编号 merchantNo String(10) Me10000002 合利宝-跨境系统分配的商户编号
平台流水号 serialNumber String(32) 201702241400010002 合利宝-跨境系统生成的唯一交易流水号
响应码 errorCode String(10) 0000 0000 代表请求成功
响应信息 errorMessage String(200) 成功 响应信息 错误信息
响应时间 current String(20) 2018-04-01 12:00:00 格式yyyy-MM-dd HH:mm:ss
二维码 qrCode String https://qr.alipay.com/bax052289bs0pus354aw002f 用于生成二维码图片,展示给用户进行扫码支付(下单成功返回)

代码示例

  @Test
    public void testAliScan() {
        RemoteService remoteService = new RemoteServiceImpl();
        AppScanPayRequestForm appScanPayRequestForm = new AppScanPayRequestForm();
        //必填
        appScanPayRequestForm.setMemberMobile("13612345678");
        //付款人姓名
        appScanPayRequestForm.setMemberName("");
        //付款人身份证号
        appScanPayRequestForm.setMemberID("130130123456780000");
        appScanPayRequestForm.setMerchantNo(LoadPropertiesUtils.getProperty("merchantNo"));
        appScanPayRequestForm.setOrderNo("ALIPAYScan1223456");
        appScanPayRequestForm.setProductCode(ProductEnumType.ALIPAYSCAN.name());
        //订单金额
        appScanPayRequestForm.setOrderAmount(new BigDecimal(""));
       //商品名称
        appScanPayRequestForm.setGoodsName("");
        //选填
        appScanPayRequestForm.setOrderIp("127.0.0.1");
        HeliRequest param = HandleDataUtils.encodeAndSign(appScanPayRequestForm,appScanPayRequestForm.getProductCode(),appScanPayRequestForm.getMerchantNo());
        HeliRequest heliRequest = remoteService.postRemoteInvoke(LoadPropertiesUtils.getProperty("aliScanUrl"), JSONObject.toJSONString(param), HeliRequest.class);
        APPScanPayResponseForm appScanPayResponseForm = HandleDataUtils.decode(heliRequest, APPScanPayResponseForm.class,heliRequest.getProductCode(),heliRequest.getMerchantNo());
        logger.info("#####解密后的内容为{}", appScanPayResponseForm);
    }

                                

                                

                                

错误码

错误码 错误码描述 解决方案