Paypal
参数列表
如下:(浏览器重定向)
| 参数名 | 类型 | 最大长度 | 是否必填 | 描述 |
|---|---|---|---|---|
| 订单信息 | ||||
| merNo | String | 5 | Yes | 【商户号】 |
| gatewayNo | String | 8 | Yes | 【网关接入号】 |
| orderNo | String | 50 | Yes | 【商户订单号】 |
| orderAmount | String | 10 | Yes | 【交易总金额】 包括订单的其他所有金额之和. 只能为数字,并且只限小数点后2位小数. |
| orderCurrency | String | 3 | Yes | 【交易币种】 说明:3位国际货币通用码,货币代码见附件。 |
| signInfo | String | 64 | Yes | 【签名数据】明文签名结构: merNo + gatewayNo + orderNo + orderCurrency + orderAmount + returnUrl + signkey; 返回数据为大写,各语言签名方式不同. 具体详见附录:sha256签名方式 |
| paymentMethod | String | 50 | Yes | Payment method, 固定 Paypal |
| returnUrl | String | 500 | Yes | 【实时返回地址】 用来返回交易结果信息到商户。 |
| notifyUrl | String | 500 | NO | 【异步返回地址】 用来返回交易结果信息到商户。 |
| firstName | String | 100 | No | 【客人的名】 |
| lastName | String | 50 | No | 【客人的姓】 |
| String | 200 | No | 【客人的邮件】 | |
| phone | String | 50 | No | 【客人的联系电话】 |
| shipFee | String | 100 | No | 【运费】 只能为数字,并且只限小数点后2位小数. |
| discount | String | 100 | No | 【折扣】 折扣默认为负值 只能为数字,并且只限小数点后2位小数. |
| goodsInfo | String | 5000 | No | 【货物详细信息,实体商品必传】 包括货物名称,ID,单价,数量具体详见附录:货物信息 |
| 收货信息(可选,实体商品必传) | ||||
| shipFirstName | String | 100 | No | 【收货人姓】 |
| shipLastName | String | 100 | No | 【收货人名】 |
| shipEmail | String | 100 | No | 【收货人邮箱】 |
| shipPhone | String | 100 | No | 【收货人电话】 |
| shipCountry | String | 100 | No | 【收货人国家】简称. 如美国:US |
| shipState | String | 100 | No | 【收货人省份】全称. |
| shipCity | String | 100 | No | 【收货人城市】全称. |
| shipAddress | String | 500 | No | 【收货人详细地址】 |
| shipZip | String | 100 | No | 【收货人邮编】 |
| 其他 | ||||
| remark | String | 1000 | No | 【备注】可作为扩展信息. |
返回数据
支付完成后,系统把支付结果重定向到返回地址(包括 POST 和 GET 两种方式返回),所以返回页面必须确保两种支付返回方式都能接收。其中:默认先浏览器返回,后服务器 POST 返回。
| Name | Type | Description |
|---|---|---|
| merNo | String | 【商户号】 |
| gatewayNo | String | 【网关接入号】 |
| tradeNo | String | 【交易流水订单号】 |
| orderNo | String | 【商户订单号】 |
| orderCurrency | String | 【交易币种】 |
| orderAmount | String | 【交易金额】 |
| orderStatus | String | 【交易状态】 返回数字:-2/-1/0/1 -2: 待确认 -1: 待处理 0: 失败 1: 成功 |
| orderInfo | String | 【交易结果信息】 Code+具体信息。 |
| signInfo | String | 【数据签名(大写)】 signInfo=sha256(merNo + gatewayNo + tradeNo + orderNo + orderCurrency + orderAmount + orderStatus + orderInfo + signkey); |
| orderErrorCode | String | 支付失败返回码 |
| returnType | String | 1: 浏览器实时返回 2:服务器实时返回 3:服务器异步返回 |
| Remark | String | 【备注】 发送数据的时候,传输的什么,就返回什么。 |
提交示例
java
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "merNo=80000&gatewayNo=80000001&orderAmount=58.88&orderCurrency=USD&signInfo=61be55a8e2f6b4e172338b&paymentMethod=Paypal&returnUrl=https://xxx.com/returnUrl¬ifyUrl=https://xxx.com/notifyurl");
Request request = new Request.Builder()
.url("sandbox.fireantspay.com/PaypalInterface")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'sandbox.fireantspay.com/PaypalInterface',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'merNo=80000&gatewayNo=80000001&orderAmount=58.88&orderCurrency=USD&signInfo=61be55a8e2f6b4e172338b&paymentMethod=Paypal&returnUrl=https%3A%2F%2Fxxx.com%2FreturnUrl¬ifyUrl=https%3A%2F%2Fxxx.com%2Fnotifyurl',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;js
var request = require('request')
var options = {
method: 'POST',
url: 'sandbox.fireantspay.com/PaypalInterface',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
merNo: '80000',
gatewayNo: '80000001',
orderAmount: '58.88',
orderCurrency: 'USD',
signInfo: '61be55a8e2f6b4e172338b',
paymentMethod: 'Paypal',
returnUrl: 'https://xxx.com/returnUrl',
notifyUrl: 'https://xxx.com/notifyurl'
}
}
request(options, function (error, response) {
if (error) throw new Error(error)
console.log(response.body)
})js
var settings = {
url: 'sandbox.fireantspay.com/PaypalInterface',
method: 'POST',
timeout: 0,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: {
merNo: '80000',
gatewayNo: '80000001',
orderAmount: '58.88',
orderCurrency: 'USD',
signInfo: '61be55a8e2f6b4e172338b',
paymentMethod: 'Paypal',
returnUrl: 'https://xxx.com/returnUrl',
notifyUrl: 'https://xxx.com/notifyurl'
}
}
$.ajax(settings).done(function (response) {
console.log(response)
})perl
curl --location 'sandbox.fireantspay.com/PaypalInterface' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'merNo=80000' \
--data-urlencode 'gatewayNo=80000001' \
--data-urlencode 'orderAmount=58.88' \
--data-urlencode 'orderCurrency=USD' \
--data-urlencode 'signInfo=61be55a8e2f6b4e172338b' \
--data-urlencode 'paymentMethod=Paypal' \
--data-urlencode 'returnUrl=https://xxx.com/returnUrl' \
--data-urlencode 'notifyUrl=https://xxx.com/notifyurl'