Paypal
Authorize
The next table describes the request parameters to perform an Authorize.
| Name | Type | Max Length | Required | Description |
|---|---|---|---|---|
| Order Info | ||||
| merNo | String | 5 | Yes | This value is provided by and is used to authenticate a merchant. |
| gatewayNo | String | 8 | Yes | This value is provided by and is used to authenticate a merchant. |
| orderNo | String | 50 | Yes | This value is the order number or tracking code, it can contain any alphanumeric value with a maximum length of 50 chars. The value must be unique. |
| orderCurrency | String | 3 | Yes | ISO 4217 Currency code that indicates the currency of the transaction. |
| orderAmount | String | 10 | Yes | Transaction amount. The decimal separator must be a point “.” |
| returnUrl | String | 500 | Yes | Payment result will be posted to this URL provided by merchant. |
| notifyUrl | String | 200 | No | return the abnormal trade to this address by server asynchronous (POST method).Please return "OK" after receiving the request. |
| signInfo | String | 64 | Yes | Digital signature on the payment of the results of key fields. signInfo=sha256(merNo + gatewayNo + orderNo + orderCurrency + orderAmount + returnUrl + signkey); |
| paymentMethod | String | 50 | Yes | Payment method, fixed Paypal |
| returnUrl | String | 500 | Yes | Payment result will be posted to this URL provided by merchant. |
| notifyUrl | String | 500 | NO | return the payment result to this address by server asynchronous (POST method).Please return "OK" after receiving the request. |
| firstName | String | 100 | NO | Customer’s first name. |
| lastName | String | 50 | NO | Customer’s last name. |
| String | 200 | NO | Customer's email address. | |
| phone | String | 50 | NO | Customer’s billing phone. |
| country | String | 100 | NO | Customer’s billing country. |
| city | String | 100 | NO | Customer’s billing city. |
| address | String | 500 | NO | Customer’s billing address |
| zip | String | 100 | NO | Customer’s billing zipCode |
| state | String | 100 | NO | Customer's billing state. |
| shipFee | String | 100 | No | 【Ship Fee】 Only for the digital, and only two decimal places after the decimal point.. |
| discount | String | 100 | No | 【Discount】 Default negative discount only for digital, and only two decimal places after the decimal point. |
| goodsInfo | String | 5000 | No | Goods detail Information, mandatory when physical goods. Including goods name, ID, unit price, number of specific detailed in the appendix: Goods Information |
| Receiving information (optional,mandatory when physical goods.) | ||||
| shipFirstName | String | 100 | No | 【Delivery First Name】 |
| shipLastName | String | 100 | No | 【Delivery Last Name】 |
| shipEmail | String | 100 | No | 【Delivery Email】 |
| shipPhone | String | 100 | No | 【Delivery Phone】 |
| shipCountry | String | 100 | No | 【Delivery Country】short name. Such as the United States:US |
| shipState | String | 100 | No | 【Delivery State】full name. |
| shipCity | String | 100 | No | 【Delivery City】full name. |
| shipAddress | String | 500 | No | 【Delivery Address】 |
| shipZip | String | 100 | No | 【Delivery Zip】 |
| Other | ||||
| remark | String | 1000 | No | EG: order Info |
Operation Responses
The next table describes the fields returned in all the responses.
| Name | Type | Description |
|---|---|---|
| merNo | String | This value is provided by and is used to authenticate a merchant. |
| gatewayNo | String | This value is provided by and is used to authenticate a merchant. |
| tradeNo | String | Unique identifier allocated by fastcloudpay. |
| orderNo | String | Customer’s order number |
| orderCurrency | String | Customer’s order currency. |
| orderAmount | String | Customer’s order amount. |
| orderStatus | String | Transaction status: -2: To be confirmed -1: Pending 0: Failure 1: Success |
| orderInfo | String | Transaction result code + the result of a transaction information |
| signInfo | String | Digital signature on the payment of the results of key fields. signInfo=sha256(merNo + gatewayNo + tradeNo + orderNo + orderCurrency + orderAmount + orderStatus + orderInfo + signkey); |
| orderErrorCode | String | Error Code Error codes corresponding to various reasons for failure. |
| returnType | String | 1: Browser real-time return 2: Server real-time return 3: Server asynchronous return The data format returned by the server in real-time is XML, while the data format returned by the server asynchronously and by the browser is NVP. |
| Remark | String | Remark The self-defined message for merchant. It will be returned exactly as the original one. |
Submission Example
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'