文档中心 > API类目 > pos交易api

alibaba.pos.order.pay (pos线下交易支付接口)

pos线下交易支付接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
shop_id Number 必须 1 门店Id
pay_request PayRequest 必须 支付入参
  • └ operator_id
  • String
  • 必须
  • 123
  • 收款操作员Id
  • └ request_id
  • String
  • 必须
  • 75626abc-452d-486e-970d-e65e12fc1456
  • 幂等请求号
  • └ machine_id
  • String
  • 必须
  • 001
  • pos机Id
  • └ pay_code_source
  • String
  • 可选
  • hema
  • 付款码来源
  • └ buyer_id
  • Number
  • 必须
  • 1
  • 买家id
  • └ pay_channel
  • String
  • 必须
  • alipay_facepay_v2
  • 支付渠道
  • └ source
  • String
  • 必须
  • hema
  • 请求来源
  • └ pay_fee
  • Number
  • 必须
  • 100
  • 支付金额
  • └ shop_id
  • String
  • 必须
  • 1
  • 门店Id
  • └ payment_channel
  • Number
  • 必须
  • 1006
  • 支付渠道,支付宝当面付传1006
  • └ payer_id
  • Number
  • 必须
  • 3
  • 支付用户id,当支付宝账号未绑定淘宝账号时为3
  • └ alipay_account
  • String
  • 可选
  • 286086843311281758
  • 支付账号
  • └ checkout_id
  • String
  • 必须
  • 111
  • 支付单号
  • └ channel_account
  • String
  • 可选
  • 111
  • 付款码、卡号等信息,pos扫码获取
  • └ merchant_code
  • String
  • 必须
  • HM
  • 商家编码
  • └ order_id
  • String
  • 必须
  • 111
  • 交易单Id(bizOrderId)
  • └ attributes
  • String
  • 可选
  • attributes

响应参数

名称 类型 示例值 描述
result PosResult result
  • model
  • PayResponse
  • model
  • └ payment_order_id
  • String
  • "123445"
  • 支付单号
  • └ current_pay_fee
  • Number
  • 34
  • 本次支付金额
  • └ current_payment_channel
  • Number
  • 1006
  • 当前支付渠道
  • └ remaining_fee
  • Number
  • 23
  • 剩余需支付金额
  • └ channel_order_id
  • String
  • ""
  • 渠道id
  • └ result_status
  • Number
  • 1
  • 状态结果码 1-支付成功 2-支付失败 3-支付未决
  • └ result_message
  • String
  • ""
  • 业务结果信息
  • └ result_code
  • String
  • "OPERATION_SUCCESS"
  • 业务结果码
  • └ is_success
  • Boolean
  • true
  • 业务是否成功
  • └ attributes
  • String
  • attributes
  • └ msg_code
  • String
  • "SUCCESS"
  • 返回码
  • └ msg_info
  • String
  • ""
  • 返回信息
  • └ is_success
  • Boolean
  • true
  • 是否成功,当该值为true时取业务结果

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaPosOrderPayRequest req = new AlibabaPosOrderPayRequest();
req.setShopId(1L);
AlibabaPosOrderPayRequest.PayRequest obj1 = new AlibabaPosOrderPayRequest.PayRequest();
obj1.setOperatorId("123");
obj1.setRequestId("75626abc-452d-486e-970d-e65e12fc1456");
obj1.setMachineId("001");
obj1.setPayCodeSource("hema");
obj1.setBuyerId(1L);
obj1.setPayChannel("alipay_facepay_v2");
obj1.setSource("hema");
obj1.setPayFee(100L);
obj1.setShopId("1");
obj1.setPaymentChannel(1006L);
obj1.setPayerId(3L);
obj1.setAlipayAccount("286086843311281758");
obj1.setCheckoutId("111");
obj1.setChannelAccount("111");
obj1.setMerchantCode("HM");
obj1.setOrderId("111");
obj1.setAttributes("");
req.setPayRequest(obj1);
AlibabaPosOrderPayResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_pos_order_pay_response>
    <result>
        <model>
            <payment_order_id>&quot;123445&quot;</payment_order_id>
            <current_pay_fee>34</current_pay_fee>
            <current_payment_channel>1006</current_payment_channel>
            <remaining_fee>23</remaining_fee>
            <channel_order_id>&quot;&quot;</channel_order_id>
            <result_status>1</result_status>
            <result_message>&quot;&quot;</result_message>
            <result_code>&quot;OPERATION_SUCCESS&quot;</result_code>
            <is_success>true</is_success>
            <attributes></attributes>
        </model>
        <msg_code>&quot;SUCCESS&quot;</msg_code>
        <msg_info>&quot;&quot;</msg_info>
        <is_success>true</is_success>
    </result>
</alibaba_pos_order_pay_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部