Skip to main content

SDK - Sale

Test Card

Card numberExpiration datecvv
424242424242424212 2027123success
400000000000101812 2027123failed
414141414141414112 2027123redirect

Request parameters

Parameter NameTypeRequiredSign(Y OR N)Parameter Description
pay_memberidStringYYThe platform assigns merchant ID
pay_orderidStringYYMerchant order number
pay_applydateStringYYOrder submission time, format:2016-12- 26 18:18:18
pay_bankcodeStringYYBank code, see table below
pay_notifyurlStringYYAsynchronous notification address. (POST return data)
pay_callbackurlStringYYSynchronization notification address (POST return data)
pay_amountStringYYAmount of the transaction
pay_md5signStringYNPlease see MD5 signature field method
pay_currencyStringYNCurrency code, uppercase letters (USD)
pay_urlStringYNWebsite URL(Subject to review), needs to include http(s)://
pay_cardnoStringNNCard No.
pay_cardmonthStringNNTwo digits of month (02)
pay_cardyearStringNNFour digits of year (2023)
pay_cardcvvStringNNcvv
+pay_productnameStringYNProduct 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"}]
「skuStringYNProduct number (unique)
「productNameStringYNProduct name
「productImageStringYNProduct image URL
「attributesStringYNProduct attributes
「priceStringYNProduct price
「quantityStringYNProduct quantity
pay_firstnameStringYNBill name
pay_lastnameStringYNBilling last name
pay_street_address1StringYNBilling address 1
pay_street_address2StringYNBilling address 2
pay_cityStringYNBilling city
pay_postcodeStringYNBilling zip code
pay_stateStringYNBilling State/Province
pay_country_iso_code_2StringYNBilling country
pay_email_addressStringYNBilling email
pay_telephoneStringYNBilling telephone
shipping_firstnameStringYNShipping name
shipping_lastnameStringYNShipping last name
shipping_street_address1StringYNShipping address 1
shipping_street_address2StringYNShipping address 2
shipping_cityStringYNShipping city
shipping_stateStringYNShipping State/Province
shipping_postcodeStringYNShipping zip code
shipping_country_iso_code_2StringYNShipping country
shipping_telephoneStringYNShipping telephone
pay_ipStringYNUser IP address
pay_useragentStringYNUser browser information
pay_languageStringYNLanguage
systemStringYNWebsite system name(Shopyy,Shopline )

Return parameters

Parameter NameTypeParameter Description
statusIntstatus = 0:SUCCESS
status = 1:3d payment
status = 2:failed
msgStringOrder placed successfully or order failed
urlString3D 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 NameTypeRequired(Y or N)Parameter Description
paymentStatusStringYSucceeded: success
Fail:fail
Processing:processing
orderIDStringYMerchant order number

Example

https://www.xxxx.com/callback.html?paymentStatus=succeeded&orderID=1001

Asynchronous notification parameters:(application/x-www-form-urlencoded)

Parameter NameTypeRequired(Y or N)Parameter Description
memberidStringYMerchant ID
orderidStringYMerchant order number
amountStringYSubmitted order amount
true_amountStringYThe amount actually paid by the buyer
currencyStringYPayment currency
transaction_idStringYTransaction order number
returncodeStringY"00": success
"2":fail
datetimeStringYFormat:20220419000114
signStringNPlease see the verification signature field format
attachString

Demo

require_once 'vendor/autoload.php';
use Jpay\PaymentSDK\JpayPaymentSDK;
$sdk = new JpayPaymentSDK(
'your_merchant_id',
'your_secret_key',
'entity', // entity
'true' // true or false, define true(dev environment)
);
//.The request parameters should be passed in according to the above requirements.
// There are mandatory and optional parameters to be passed in,
// depending on the document specifications.
$paymentData = [
'pay_orderid' => 'your pay orderid',
'pay_notifyurl' => 'https://your-domain.com/notify',
'pay_callbackurl' => 'https://your-domain.com/callback',
'pay_amount' => '100.00',
'pay_currency' => 'USD',
'pay_firstname' => 'John',
'pay_lastname' => 'Doe',
'pay_email_address' => '[email protected]',
'pay_telephone' => '1234567890',
'pay_country_iso_code_2' => 'US',
'pay_productname' => 'Test Product'
];

$result = $sdk->payment($paymentData);