Sale
Request address
POST
https://sandbox.j-pay.net/pay_index
Test account
Merchant ID:10151
ApiKey: 3p17o32a83gge5tho3vpv0m61nvhtye9
Test Card
Card number | Expiration date | cvv | |
---|---|---|---|
4242424242424242 | 12 2027 | 123 | success |
4000000000001018 | 12 2027 | 123 | failed |
4141414141414141 | 12 2027 | 123 | redirect |
Request parameters
Parameter Name | Type | Required | Sign(Y OR N) | Parameter Description |
---|---|---|---|---|
pay_memberid | String | Y | Y | The platform assigns merchant ID |
pay_orderid | String | Y | Y | Merchant order number |
pay_applydate | String | Y | Y | Order submission time, format:2016-12- 26 18:18:18 |
pay_bankcode | String | Y | Y | Bank code, see table below |
pay_notifyurl | String | Y | Y | Asynchronous notification address. (POST return data) |
pay_callbackurl | String | Y | Y | Synchronization notification address (POST return data) |
pay_amount | String | Y | Y | Amount of the transaction |
pay_md5sign | String | Y | N | Please see MD5 signature field method |
pay_currency | String | Y | N | Currency code, uppercase letters (USD) |
pay_url | String | Y | N | Website URL(Subject to review), needs to include http(s):// |
pay_cardno | String | Y | N | Card No. |
pay_cardmonth | String | Y | N | Two digits of month (02) |
pay_cardyear | String | Y | N | Four digits of year (2023) |
pay_cardcvv | String | Y | N | cvv |
+pay_productname | String | Y | N | Product information parameters are composed of the following set of data in JSON format. Please note that parameter names are case-sensitive. This field is filled with a JSON array. Example:[{"sku":"123456789","productName":"Mac Book Pro","productImage":"url","attributes":"Size:US8 Color:blue","price":"11000.00","quantity":" 1"},{"sku":"9876543231","productName":"IPhone 12","productImage":"url","attributes":"Size:US8 Color:blue","price":"11000.00","quantity":" 1"}] |
「sku | String | Y | N | Product number (unique) |
「productName | String | Y | N | Product name |
「productImage | String | Y | N | Product image URL |
「attributes | String | Y | N | Product attributes |
「price | String | Y | N | Product price |
「quantity | String | Y | N | Product quantity |
pay_firstname | String | Y | N | Bill name |
pay_lastname | String | Y | N | Billing last name |
pay_street_address1 | String | Y | N | Billing address 1 |
pay_street_address2 | String | Y | N | Billing address 2 |
pay_city | String | Y | N | Billing city |
pay_postcode | String | Y | N | Billing zip code |
pay_state | String | Y | N | Billing State/Province |
pay_country_iso_code_2 | String | Y | N | Billing country |
pay_email_address | String | Y | N | Billing email |
pay_telephone | String | Y | N | Billing telephone |
shipping_firstname | String | Y | N | Shipping name |
shipping_lastname | String | Y | N | Shipping last name |
shipping_street_address1 | String | Y | N | Shipping address 1 |
shipping_street_address2 | String | Y | N | Shipping address 2 |
shipping_city | String | Y | N | Shipping city |
shipping_state | String | Y | N | Shipping State/Province |
shipping_postcode | String | Y | N | Shipping zip code |
shipping_country_iso_code_2 | String | Y | N | Shipping country |
shipping_telephone | String | Y | N | Shipping telephone |
pay_ip | String | Y | N | User IP address |
pay_useragent | String | Y | N | User browser information |
pay_language | String | Y | N | Language |
system | String | Y | N | Website system name(Shopyy,Shopline ) |
Return parameters
Parameter Name | Type | Parameter Description |
---|---|---|
status | Int | status = 0:SUCCESS status = 1:3d payment status = 2:failed |
msg | String | Order placed successfully or order failed |
url | String | 3D redirectUrl |
Return example
Transaction successful : {
"status": 0,
"msg": "transaction success"
}
Transaction failed : {
"status": 2,
"msg": "transaction failed"
}
Redirect/3ds payment successful : {
"status": 1,
"url": "redirectUrl"
}
3DS verification
Jump payment and direct credit card payment require 3DS verification
Synchronous notification parameters:(application/x-www-form-urlencoded)
Parameter Name | Type | Required(Y or N) | Parameter Description |
---|---|---|---|
paymentStatus | String | Y | Succeeded: success Fail:fail Processing:processing |
orderID | String | Y | Merchant order number |
Example
https://www.xxxx.com/callback.html?paymentStatus=succeeded&orderID=1001
Asynchronous notification parameters:(application/x-www-form-urlencoded)
Parameter Name | Type | Required(Y or N) | Parameter Description |
---|---|---|---|
memberid | String | Y | Merchant ID |
orderid | String | Y | Merchant order number |
amount | String | Y | Submitted order amount |
true_amount | String | Y | The amount actually paid by the buyer |
transaction_id | String | Y | Transaction order number |
returncode | String | Y | "00": success "2":fail |
datetime | String | Y | Format:20220419000114 |
sign | String | N | Please see the verification signature field format |
attach | String |
Array{
["memberid"]=>
string(5) "10012"
["orderid"]=>
string(7) "7758292"
["transaction_id"]=>
string(20) "20230117104641499957"
["amount"]=>
string(5) "85.95"
["true_amount"]=>
string(5) "85.95"
["datetime"]=>
string(14) "20230117111809"
["returncode"]=>
string(2) "00"
["sign"]=>
string(32) "48CF5D99A2ADE25DCEF73BC1B1136B9E"
["attach"]=>
string(0) ""
}
Demo
- Javascript
- Php
- Python
import { md5 } from "js-md5";
import axios from "axios";
const KEY = "3p17o32a83gge5tho3vpv0m61nvhtye9";
const MEMBER_ID = "10151";
let query = {
pay_memberid: MEMBER_ID,
pay_orderid: "O" + Date.now().valueOf(),
pay_applydate: "2024-07-18 06:22:55",
pay_bankcode: "901",
pay_notifyurl: "https://yourdomain.com",
pay_callbackurl: "https://yourdomain.com",
pay_amount: "0.01",
};
let signData = [];
Object.keys(query)
.sort()
.forEach((key) => signData.push(`${key}=${query[key]}`));
signData.push(`key=${KEY}`);
Object.assign(query, {
pay_md5sign: md5(signData.join("&")).toUpperCase(),
pay_url: "https://yourdomain.com",
pay_currency: "USD",
pay_cardno: "4242424242424242",
pay_cardmonth: "08",
pay_cardyear: "2026",
pay_cardcvv: "123",
pay_productname: JSON.stringify([
{
sku: "123456789",
productName: "Mac Book Pro",
productImage: "url",
attributes: "Size:US8 Color:blue",
price: "11000.00",
quantity: " 1",
},
{
sku: "9876543231",
productName: "IPhone 12",
productImage: "url",
attributes: "Size:US8 Color:blue",
price: "11000.00",
quantity: " 1",
},
]),
pay_firstname: "Rodrigo",
pay_lastname: "lopez",
pay_street_address1: "Nemesio Vicuña 2254 villa cordillera",
pay_street_address2: "Nemesio Vicuña 2254 villa cordillera",
pay_city: "Puente Alto",
pay_postcode: "8150000",
pay_state: "RM",
pay_country_iso_code_2: "CL",
pay_email_address: "[email protected]",
pay_telephone: "+920508435",
shipping_firstname: "Rodrigo",
shipping_lastname: "lopez",
shipping_street_address1: "Nemesio Vicuña 2254 villa cordillera",
shipping_street_address2: "Nemesio Vicuña 2254 villa cordillera",
shipping_city: "Puente Alto",
shipping_state: "RM",
shipping_postcode: "8150000",
shipping_country_iso_code_2: "CL",
shipping_telephone: "+920508435",
pay_ip: "186.156.221.158",
pay_useragent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.43",
pay_language: "zh",
system: "shopyy",
});
axios
.request({
url: "https://sandbox.j-pay.net/pay_index",
method: "post",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: query,
})
.then(({ data }) => {
console.log("success", data);
})
.catch((error) => {
console.log("error", error);
});
$url = 'https://sandbox.j-pay.net/pay_index';
$data = [
'pay_memberid' => '10151',
'pay_orderid' => 'O' . date('YmdHis', time()),
'pay_applydate' => date('Y-m-d H:i:s', time()),
'pay_bankcode' => '901',
'pay_notifyurl' => 'https://yourdomain.com',
'pay_callbackurl' => 'https://yourdomain.com',
'pay_amount' => '10.00',
];
ksort($data);
$md5str = "";
foreach ($data as $key => $val) {
if (!empty($val)) {
$md5str = $md5str . $key . "=" . $val . "&";
}
}
$sign_str = $md5str . 'key=3p17o32a83gge5tho3vpv0m61nvhtye9';
$sign = strtoupper(md5($sign_str));
$data = array_merge($data, [
'pay_md5sign' => $sign,
'pay_url' => 'https://yourdomain.com',
'pay_currency' => 'USD',
'pay_cardno' => '4242424242424242',
'pay_cardmonth' => '08',
'pay_cardyear' => '2026',
'pay_cardcvv' => '123',
'pay_productname' => json_encode([
[
'sku' => '123456789',
'productName' => 'Mac Book Pro',
'productImage' => 'url',
'attributes' => 'Size:US8 Color:blue',
'price' => '11000.00',
'quantity' => ' 1',
]
]),
'pay_firstname' => 'Rodrigo',
'pay_lastname' => 'lopez',
'pay_street_address1' => 'Nemesio Vicuña 2254 villa cordillera',
'pay_street_address2' => 'Nemesio Vicuña 2254 villa cordillera',
'pay_city' => 'Puente Alto',
'pay_postcode' => '8150000',
'pay_state' => 'RM',
'pay_country_iso_code_2' => 'CL',
'pay_email_address' => '[email protected]',
'pay_telephone' => '+920508435',
'shipping_firstname' => 'Rodrigo',
'shipping_lastname' => 'lopez',
'shipping_street_address1' => 'Nemesio Vicuña 2254 villa cordillera',
'shipping_street_address2' => 'Nemesio Vicuña 2254 villa cordillera',
'shipping_city' => 'Puente Alto',
'shipping_state' => 'RM',
'shipping_postcode' => '8150000',
'shipping_country_iso_code_2' => 'CL',
'shipping_telephone' => '+920508435',
'pay_ip' => '186.156.221.158',
'pay_useragent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.43',
'pay_language' => 'es',
'system' => 'shopyy'
]);
$header = [
'Content-Type: application/x-www-form-urlencoded',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
$data = curl_exec($ch);
if (curl_error($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
var_dump($data);
import hashlib
import requests
import time
import json
url = 'https://sandbox.j-pay.net/pay_index'
key = '3p17o32a83gge5tho3vpv0m61nvhtye9'
params = {
'pay_memberid': '10151',
'pay_orderid': 'O' + time.strftime('%Y%m%d%H%M%S', time.localtime()),
'pay_applydate': time.strftime('%Y%m%d%H%M%S', time.localtime()),
'pay_bankcode': '901',
'pay_notifyurl': 'http://yourdomain.com',
'pay_callbackurl': 'http://yourdomain.com',
'pay_amount': '10.00',
}
strParam = ''
for p in sorted(params):
strParam = strParam + str(p) + "=" + str(params[p]) + '&'
strParam = strParam + 'key' + '=' + key
parmStr = strParam.encode("utf-8")
m = hashlib.md5()
m.update(parmStr)
params['pay_md5sign'] = m.hexdigest().upper()
otherParms = {
"pay_url": "http://yourdomain.com",
"pay_currency": "USD",
"pay_cardno": "4242424242424242",
"pay_cardmonth": "08",
"pay_cardyear": "2026",
"pay_cardcvv": "123",
"pay_productname": json.dumps([
{
"sku": "123456789",
"productName": "Mac Book Pro",
"productImage": "url",
"attributes": "Size:US8 Color:blue",
"price": "10.00",
"quantity": " 1"
},
{
"sku": "9876543231",
"productName": "IPhone 12",
"productImage": "url",
"attributes": "Size:US8 Color:blue",
"price": "10.00",
"quantity": " 1"
}
]),
"pay_firstname": "Rodrigo",
"pay_lastname": "lopez",
"pay_street_address1": "Nemesio Vicuña 2254 villa cordillera",
"pay_street_address2": "Nemesio Vicuña 2254 villa cordillera",
"pay_city": "Puente Alto",
"pay_postcode": "8150000",
"pay_state": "RM",
"pay_country_iso_code_2": "CL",
"pay_email_address": "[email protected]",
"pay_telephone": "+920508435",
"shipping_firstname": "Rodrigo",
"shipping_lastname": "lopez",
"shipping_street_address1": "Nemesio Vicuña 2254 villa cordillera",
"shipping_street_address2": "Nemesio Vicuña 2254 villa cordillera",
"shipping_city": "Puente Alto",
"shipping_state": "RM",
"shipping_postcode": "8150000",
"shipping_country_iso_code_2": "CL",
"shipping_telephone": "+920508435",
"pay_ip": "186.156.221.158",
"pay_useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.43",
"pay_language": "es",
"system": "shopyy"
}
res = requests.post(url = url, data = dict(params, **otherParms))
print('response:' + res.text)