接口会根据支付订单情况自动判断退款或撤销。退款交易适用于已成功的支付交易,有效期一般有几个月,不同的支付平台有所差异;撤销适用于所有状态的支付交易,但是有效期只有24小时。

交易请求报文

  1. <?xml version="1.0" encoding="GBK"?>
  2. <business_trans>
  3. <request_type>barcode_refundbycashfee_request</request_type>
  4. <isspid>39493002</isspid>
  5. <pos_id>1511300001</pos_id>
  6. <store_id>1511300001</store_id>
  7. <pos_seq>1511300000004</pos_seq>
  8. <user_id>user01</user_id>
  9. <system_id>8888</system_id>
  10. <barcode_refundbycashfee_request>
  11. <pay_type>503</pay_type>
  12. <tx_amt>10</tx_amt>
  13. <org_pos_seq>1511300000001</org_pos_seq>
  14. <goods_detail><![CDATA[商品信息(JSON)]]></goods_detail>
  15. </barcode_refundbycashfee_request>
  16. </business_trans>

交易请求报文说明

节点名称中文名称类型说明是否必填
request_type请求类型String(32)标识请求报文的类型,固定为barcode_refundbycashfee_request必填
isspid商户号String(8)接入SP的ID号,由翼码平台分配给ipos接入受理商户的机构号(原值返回)必填
pos_id终端号String(20)终端号必填
store_id门店号String(20)门店号必填
pos_seq终端流水号String(32)同一个商户必须唯一,且大于12位必填
user_id操作员标识String(20)操作员号可空
system_id系统平台号String(4)由翼码提供必填
barcode_refundbycashfee_request->pay_type支付类型String(3)503:微信支付可空
barcode_refundbycashfee_request->tx_amt交易金额Number(9)实际退款金额,单位为分,不支持小数点必填
barcode_refundbycashfee_request->org_pos_seq需要退款交易的流水号String(32)需要退款的原支付流水号,且大于12位必填
barcode_refundbycashfee_request->goods_detail退款商品信息String(6000)需要退款的商品信息列表,以JSON格式传入若传入信息带特殊字符请使用CDATA标签包裹内容详细参数见下表可空

交易请求参数附表

goods_detail商品信息 json体参数:

参数类型说明是否必填范例
goods_idString(32)商品的编号必填apple-01
payment_goods_idString(32)支付平台商品编号可空20010001
goods_nameString(256)商品名称必填ipad
quantityNumber(9)商品数量必填1
priceNumber(8)商品单价,单位为分必填200000
goods_categoryString(24)商品类目仅支付宝时生效可空34543238
bodyString(1000)商品描述信息仅支付宝时生效可空特价手机
show_urlString(400)商品的展示地址仅支付宝时生效可空http://www.alipay.com/xxx.jpg

json样例:

[
    {
        "goods_id" : "apple-01",
        "payment_goods_id" : "20010001",
        "goods_name" : "ipad",
        "quantity" : 1,
        "price" : 200000,
        "goods_category" : "34543238",
        "body" : "特价手机",
        "show_url" : "http://www.alipay.com/xxx.jpg"
    },
    {
        "goods_id" : "apple-02",
        "payment_goods_id" : "20010002",
        "goods_name" : "ipad2",
        "quantity" :"1,
        "price" : 200000,
        "goods_category" : "34543239",
        "body" : "特价手机2",
        "show_url" : "http://www.alipay.com/xxx2.jpg"
    }
]

交易返回报文

<?xml version="1.0" encoding="GBK"?>
<business_trans>
    <response_type>barcode_refundbycashfee_response</response_type>
    <isspid>39493002</isspid>
    <pos_id>123456789</pos_id>
    <pos_seq>000000000001</pos_seq>
    <sys_seq>000000000244</sys_seq>
    <trans_time>20090405010104</trans_time>
    <pay_type>502</pay_type>
    <buss_discount_amt>2</buss_discount_amt>
    <platform_discount_amt>2</platform_discount_amt>
    <wxpay_res_info>
        <trade_no>4200000254201901093869466982</trade_no>
        <out_trade_no>1901090000036</out_trade_no>
        <app_id>wx5acb63e448b4fc22</app_id>
        <mch_id>1241109502</mch_id>
        <total_fee>10002</total_fee>
        <cash_fee>3</cash_fee>
        <refund_fee>10001</refund_fee>
        <cash_refund_fee>2</cash_refund_fee>
        <detail_error_code>SUCCESS</detail_error_code>
        <detail_error_desc>OK</detail_error_desc>
    </wxpay_res_info>
    <result>
        <id>0000</id>
        <comment>成功</comment>
    </result>
</business_trans>

交易返回报文说明

标准接口会因业务升级需要而新增节点,请在解析返回报文时避免新增未知节点产生的程序出错!

节点名称中文名称类型说明是否必填
response_type返回类型String(32)标识返回报文的类型,固定为barcode_refundbycashfee_response必填
isspid商户号String(8)接入SP的ID号,为翼码平台的提供的业务商机构号必填
pos_id终端号String(20)终端号必填
pos_seq终端流水号String(32)终端交易流水号,和请求报文中的交易流水号相同必填
sys_seq平台流水号String(16)由翼码平台产生,供跟踪之用必填
trans_time交易时间String(14)交易时间,格式:yyyyMMddHHmmss必填
pay_type支付类型String(3)503:微信支付必填
buss_discount_amt商家优惠金额String(16)商家优惠金额,单位为分可空
platform_discount_amt平台优惠金额String(16)平台优惠金额,单位为分可空
result->id响应码String(4)翼码平台返回的处理结果,0000-成功,其它失败,错误信息说明见“响应码解释”字段必填
result->comment响应码解释String(64)响应码对应中文注解,用于显示提示必填
微信支付的时候,返回以下数据
wxpay_res_info->trade_no支付平台处理流水String(64)交易成功时候,必填可空
wxpay_res_info->out_trade_no支付交易请求流水String(64)交易成功时候,必填可空
wxpay_res_info->detail_error_code支付详细错误码String(48)交易成功时候,必填可空
wxpay_res_info->detail_error_desc支付详细错误码说明String(128)交易成功时候,必填可空
wxpay_res_info->app_id微信公众帐号String(32)交易成功时候,必填可空
wxpay_res_info->mch_id微信商户帐号String(32)交易成功时候,必填可空
wxpay_res_info->total_fee订单总金额String(16)交易成功时候,必填,单位为分可空
wxpay_res_info->cash_fee现金支付金额String(16)用户使用现金支付的金额交易成功时候,必填,单位为分可空
wxpay_res_info->refund_fee退款金额String(16)本次订单退款总金额:1、当累计现金退款金额小于用户支付金额时,refund_fee=cash_refund_fee2、当累计现金退款金额小于用户支付金额时,refund_fee=cash_refund_fee+券金额交易成功时候,必填,单位为分可空
wxpay_res_info->cash_refund_fee现金退款金额String(16)现金退款金额,即用户实际可到账退款金额,小于等于用户支付金额交易成功时候,必填,单位为分可空

标准接口会因业务升级需要而新增节点,请在解析返回报文时避免新增未知节点产生的程序出错!