Registration - API E-Wallet (Direct Debit) SNAP
Tentang Registration - API E-Wallet (Direct Debit) SNAP
API ini digunakan untuk mengajukan pendaftaran transaksi melakukan pembayaran menggunakan metode pembayaran E-Wallet dengan Fitur Direct Debit Host to Host yang sesuai standar SNAP.
Registration - API E-Wallet (Direct Debit) SNAP
Silakan mengajukan akses token terlebih dahulu untuk melakukan autentikasi melalui bagian Request Access Token API - SNAP.
Service Code | 54 |
|---|---|
API Endpoint | |
HTTP Method | POST |
Description | Request Direct Debit transaction for authentication payment |
Content-type | application/json |
Request Header Parameter for Registration - API E-Wallet (Direct Debit) SNAP
Parameter | Tipe | Ukuran | Kebutuhan | Deskripsi | Contoh |
|---|---|---|---|---|---|
Content-Type | String | 127 | Mandatory | Content type, value always application/json | |
Authorization | String | Variable | Mandatory | Bearer “accessToken” | |
X-TIMESTAMP | String | 25 | Mandatory | Using ISO 8601 as timestamp format. Transaction date time, in format YYYYMMDDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time). 2022-03-21T10:11:40+07:00. | |
X-SIGNATURE | String | Variable | Mandatory | Signature will be generated by Merchant. | |
X-PARTNER-ID | String | 20 | Mandatory | Unique Partner ID, Partner ID = Client ID | |
X-EXTERNAL-ID | String | 40 | Mandatory | Unique messaging Reference ID generated by Merchant. Numeric String. Reference number that should be unique in every transaction. | |
CHANNEL-ID | String | 20 | Mandatory | Unique Channel Merchant Credential ID Number. Client ID + "01" = Channel ID "IONPAYTEST" + "01" = "IONPAYTEST01" | IONPAYTEST01 |
Request Body Parameter for Registration - API E-Wallet (Direct Debit) SNAP
Parameter | Tipe | Kebutuhan | Ukuran | Deskripsi atau Contoh |
|---|---|---|---|---|
partnerReferenceNo | String | Mandatory | 40 | Transaction ID from Merchant |
merchantId | String | Mandatory | 10 | Merchant Identifier that is unique per each Merchant |
subMerchantId | String | Optional | 32 | Sub-Merchant Identifier |
externalStoreId | String | Optional | 32 | Unique Identifier of Shop ID in Client system |
amount | Array of JSON Object | Mandatory | Variable | Amount Information |
value | String | Mandatory | 12 | Transaction amount, including thecents |
currency | String | Mandatory | 3 | Currency code based on ISO |
urlParams | Array of JSON Object | Mandatory | Variable | Notify URL that Merchant must send the payment notification. "urlParams":[ {...}, {...} ] |
url | String | Mandatory | 512 | Indicates the URL of the Client’s app to redirect back to once payment has been completed in Merchant. Merchant accepts HTTP links and URL scheme formats. |
type | String | Mandatory | 32 | Indicates the type of the sent URL. Only accepts ‘PAY_RETURN” and ‘PAY_NOTIFY” value. |
isDeeplink | String | Mandatory | 1 | Indicates whether the URL is a deep link or not, only accepts ‘Y’ value |
validUpTo | String | Optional | 25 | The time when the payment will be automatic only expired. ISO 8601, in YYYY-MMDDTHH format. mm:ss+07:00. Time must be in GMT+7 (Jakarta time). |
pointOfInitiation | String | Optional | 20 | Used for getting more info regarding source of request of the ser |
additionalInfo | Array of JSON Object | Optional | Variable | Additional information "additionalInfo":{...} |
mitraCd | String | Mandatory | 4 | |
goodsNm | String | Mandatory | 200 | Goods Name |
billingNm | String | Mandatory | 100 | Buyer Name |
billingPhone | String | Mandatory | 20 | Buyer Phone Number |
billingEmail | String | Optional | 40 | Buyer E-mail |
callBackUrl | String | Mandatory | 500 | Payment result forward URL (on browser) |
dbProcessUrl | String | Mandatory | 500 | Payment Notification URL (Async Notification) |
cartData | String | Mandatory | 4000 | {Format_JSON_String} { "count": "2", "item": [ {...}, {...} ] } |
msId | String | Optional | 20 | Merchant Seller ID |
msFee | String | Optional | 7 | Merchant Seller Fee |
msFeeType | String | Optional | 2 | Merchant Seller Fee Type |
mbFee | String | Optional | 7 | Merchant Balance Fee |
mbFeeType | String | Optional | 2 | Merchant Balance Fee Type |
Response Parameter for Registration - API E-Wallet (Direct Debit) SNAP
Parameter | Tipe | Kebutuhan | Ukuran | Deskripsi atau Contoh |
|---|---|---|---|---|
responseCode | String | Mandatory | 7 | Refer to General Response Code and Message - API SNAP list |
responseMessage | String | Mandatory | 150 | Refer to General Response Code and Message - API SNAP list |
partnerReferenceNo | String | Mandatory | 40 | Merchant transaction identifier |
referenceNo | String | Mandatory | 40 | Original transaction identifier on service provider system |
appRedirectUrl | String | Optional | 2048 | Returns an URL scheme to payment page in native app For ShopeePay, this value will be deprecated |
webRedirectUrl | String | Optional | 2048 | Partner checkout URL |
additionalInfo | String | Optional | Variable | Additional information "additionalInfo": { ...} |
redirectToken | String | Optional | 255 | Partner checkout token |
Sample Parameter for Registration API E-Wallet (Direct Debit) SNAP
Request Parameter
$this->configSnap = NICEPay::builder()
->setIsProduction(false)
->setClientSecret("_YOUR_CLIENT_SECRET_")
->setPartnerId("TNICEEW051")
->setExternalID("tXid202402111402271707638099")
->setTimestamp("2024-12-31T10:11:40+07:00")
->setPrivateKey("_YOUR_PRIVATE_KEY_")
->build();
$requestBody = Ewallet::builder()
->partnerReferenceNo("2020102900000000000001")
->merchantId("TNICEEW051")
->subMerchantId("310928924949487")
->externalStoreId("239840198240795109")
->validUpTo("2020-12-23T07:44:11+07:00")
->pointOfInitiation("Mobile App")
->amount("12345678.00", "IDR")
->additionalInfo(
[
"mitraCd" => "DANA",
"goodsNm" => "Merchant Goods 1",
"billingNm" => "Buyer Name",
"billingPhone" => "02112345678",
"billingEmail" => "[email protected]",
"callBackUrl" => "http://www.merchant.com/callback",
"dbProcessUrl" => "http://www.merchant.com/notification",
"cartData" => '{"count":"2","item":[{"img_url":"http://img.aaa.com/ima1.jpg","goods_name":"Item 1 Name","goods_detail":"Item 1 Detail","goods_amt":"0.00","goods_quantity":"1"},{"img_url":"http://img.aaa.com/ima2.jpg","goods_name":"Item 2 Name","goods_detail":"Item 2 Detail","goods_amt":"12345678.00","goods_quantity":"1"}]}',
"msId" => "",
"msFee" => "",
"msFeeType" => "",
"mbFee" => "",
"mbFeeType" => ""
]
)
->urlParams([
["https://test1.bi.go.id/v1/test", "PAY_NOTIFY", "Y"],
["https://test2.bi.go.id/v1/test", "PAY_RETURN", "Y"]
])
->build();
$accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJJT05QQVlURVNUIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJCUklOIiwiZXhwIjoiMjAyNC0wMi0xMVQwODowOTozNVoifQ==.aIybLX36dYwfFvW7dcoenXkOe2EAwIYq84ZtPuIf3K8=";
$ewalletService = new SnapEwalletService($this->configSnap);
try {
$response = $ewalletService->paymentEwallet($requestBody, $accessToken);
} catch (\Exception $e) {
// Handle exception
}Response Parameter
{
"responseCode": "2005400",
"responseMessage": "Successful",
"partnerReferenceNo": "2020102900000000000001",
"referenceNo": "TNICEEW05105202210141451109841",
"webRedirectUrl": "https://pjsp.com/universal?bizNo=REF993883&...",
"additionalInfo": {
"redirectToken": " df548fff93e82aad9174c657820a85aa5d10042535157c7e89f52499"
}
}