⚙️
API Explorer
  • Overview
  • API Reference
    • 交易
      • Sessiontoken
      • customer
      • Payment methods
      • Confirm charge
      • Checkout payment
      • Local payment
    • 授权交易完成/撤销
      • Authorization
    • 拒付
    • 退款
    • 物流
    • 交易查询
    • 网关绑定支付通道查询
    • 结算明细查询
    • 风控-来源网址查询
  • Webhook
    • 概述
    • 交易事件
    • 预授权事件
    • 退款事件
    • 拒付事件
    • 支付结果跳转
  • 附录
    • 数据签名过程
    • 测试账号信息
    • 常见错误码
    • 常见问题
    • 旧版API文档
Powered by GitBook
On this page
  1. API Reference
  2. 交易

Local payment

本地支付直连支付接口

PreviousCheckout paymentNext授权交易完成/撤销

Last updated 11 months ago

本地支付直连支付请求报文示例

curl --request POST \
  --url https://{paymentApiUrl}/V2022-03/local_payment \
  --header 'Content-Type: application/json' \
  --header 'request-id: 58675' \
  --header 'request-time: 1651888520935' \
  --header 'gateway-no: 12345001' \
  --header 'sign-info: 787966BF2479A1BE8E1886CD18E6919447FAF4F357E7056188D4F035661B822B' \
  --data '{
    "billingAddress": {
        "address": "4348  Calico Drive",
        "city": "NEWARK VALLEY",
        "country": "US",
        "email": "indubio@gmail.com",
        "firstName": "Di Mo",
        "lastName": "Shi",
        "phone": "509-675-8948"
        "state": "NY",
        "zip": "13811"
    },
    "callbackUrl": "https://CallResult",
    "deliveryAddress": {
        "shipAddress": "4348  Calico Drive",
        "shipCity": "NEWARK VALLEY",
        "shipCountry": "US",
        "shipFirstName": "Di Mo",
        "shipLastName": "Shi",
        "shipPhone": "509-675-8948",
        "shipState": "NY",
        "shipZip": "13811"
    },
    "goodsDetails": [
        {
            "goodsCount": "1000",
            "goodsPrice": "139",
            "goodsTitle": "Ipad min"
        }
    ],
    "isMobile": "0",
    "orderAmount": "336.73",
    "orderCurrency": "USD",
    "orderNo": "NEW_API2520767716960",
    "paymentMethod": "Klarna",
    "platform": "",
    "remark": "TEST",
    "returnUrl": "https://returnUrl"
}'

结果对象属性描述

property name
type
description

code

String

返回码

message

String

返回信息

data

Object

数据对象

redirectUrl

String

本地支付商户跳转客户的支付页面地址

orderNo

String

商户订单号

tradeNo

String

预下单流水号

orderAmount

String

商户订单金额

orderCurrency

String

商户订单币种

orderStatus

String

【交易状态】

待处理:pending

成功:success

失败:fail

orderInfo

String

银行返回信息

remark

String

备注

  • POSTV2022-03/local_payment
  • 本地支付直连支付请求报文示例

V2022-03/local_payment

post

V2022-03/local_payment,获取跳转URL接口

Header parameters
gateway-nostring(16)Required

网关号

request-idstring(64)Required

请求id,30分钟之内唯一

request-timestring(16)Required

时间戳,以毫秒(ms)为单位,请求误差不能超过10分钟

sign-infostring(255)Required

验签字段,具体加签方式请参阅数据签名过程章节

Body
callbackUrlstring(1000)Optional

服务端异步通知地址;最小长度为1,最大长度为1000,如:https://www.my.shopify.com/callbackUrl

Example: https://www.my.shopify.com/callbackUrl
orderAmountstring(16)Required

商户订单金额; 最多两位小数,注:如果币种最小单位为元,则只能为整数;最小长度为1,最大长度为16,如:100.99

Example: 100.99
orderCurrencystring(3)Required

3位字母的ISO币种代码;固定长度为3,如:USD

Example: USD
orderNostring(50)Required

商户订单号;最小长度为1,最大长度为50,如:12167001000000000001

Example: 12167001000000000000
paymentMethodstring(100)Optional

支付页面上优先展示的支付方式;最大长度为100

Example: Klarna
platformstring(100)Optional

平台标识名称; 如果商户是SaaS平台,则必填;最大长度为100,如:Shopify

Example: Shopify
remarkstring(500)Optional

订单备注;最大长度为500,如:remark

Example: remark
returnUrlstring(1000)Required

交易完成页面跳转地址;最小长度为1,最大长度为1000,如:https://www.my.shopify.com/redirectUrl

Example: https://www.my.shopify.com/redirectUrl
Responses
200
OK
*/*
post
POST /V2022-03/local_payment HTTP/1.1
Host: {paymentapiurl}
gateway-no: null
request-id: null
request-time: null
sign-info: null
Content-Type: application/json
Accept: */*
Content-Length: 1008

{
  "billingAddress": {
    "address": "Address of Maryland",
    "city": "Maryland",
    "country": "US",
    "email": "abc@mail.com",
    "firstName": "asia",
    "lastName": "bill",
    "phone": 13212344321,
    "state": "MD",
    "zip": 21133
  },
  "callbackUrl": "https://www.my.shopify.com/callbackUrl",
  "client": {
    "colorDepth": "colorDepth",
    "customerIp": "192.168.0.1",
    "deviceType": "web",
    "isMobile": 0,
    "language": "language",
    "screenHeight": "screenHeight",
    "screenWidth": "screenWidth",
    "timeZoneOffset": "timeZoneOffset",
    "userAgent": "userAgent"
  },
  "deliveryAddress": {
    "shipAddress": "Address of Maryland",
    "shipCity": "Maryland",
    "shipCountry": "US",
    "shipFirstName": "asia",
    "shipLastName": "bill",
    "shipPhone": 13212344321,
    "shipState": "MD",
    "shipZip": 21133
  },
  "goodsDetails": [
    {
      "goodsCount": 2,
      "goodsPrice": 100,
      "goodsTitle": "iphone"
    }
  ],
  "orderAmount": 100.99,
  "orderCurrency": "USD",
  "orderNo": 12167001000000000000,
  "paymentMethod": "Klarna",
  "paymentMethodData": {
    "cpf": 57731716864,
    "creNum": 1234567890123456
  },
  "platform": "Shopify",
  "remark": "remark",
  "returnUrl": "https://www.my.shopify.com/redirectUrl"
}
200

OK

{
  "code": "success",
  "message": "message response",
  "data": {
    "orderAmount": 100,
    "orderCurrency": "USD",
    "orderInfo": "is order info",
    "orderNo": 12167001000000000000,
    "orderStatus": "success",
    "redirectUrl": "http://192.168.2.23:7080/services/v3/RedirectResultTest",
    "remark": "remark",
    "tradeNo": "2022022416544064513805"
  }
}