Send Secure Payment

Secure Send Payment will required Lekir-Signature key to generate secure hash using HMAC_SHA256 to verify the integrity of a file or a data transfer.

Lekir-Signature Calculation Method

The message level security is implemented by using signing and verification of the message.

  • Step 1 - Construct the source string
    1. The source string should be formed with elements, construct with key and value pair data.
    2. The elements should then be sorted in ascending order, case-insensitive.
    3. Each element should be separated by a "|" (pipe) character in between them.

      Below is format of source string, in ascending order;

      amount|email|item|name|callback_url|reference_no

      Will sign the source string as below,

      amount1|[email protected]|itembaju kemeja|namenurhidayah|callback_urlwww.example.com/callback|reference_noORDER99181TEST1

  • STEP 2 - Generate the hash.
    1. Get your Lekir-Signature Key from profile page.
    2. Sign the source string using HMAC_SHA256 and the shared Lekir-Signature Key.

      Below is the final Lekir-Signature value using above source string with 'uxDSFkVdywUiIUgX' as Lekir-Signature Key.

      2fc72fe487b1acfba6d682e588bed4baaeff43d21e7377107f09e613511de7aa

    3. Put the final Lekir-Signature value into parameter checksum

Request

Redirect URL Method #
https://app.lekirpay.com/api/payments/payment/secure POST
Parameter Type Position Required? Description
Content-Type string Header Not Required application/json
Accept string Header Not Required application/json
Authorization string Header Required Bearer TOKEN
item string Body Required Your item name, will display as payment title
description string Body Not Required Your payment description
amount double Body Required Key in the payment amount
reference_no string Body Required Provide your own unique system reference no. You may use this reference no to check the payment status. <= 140 characters
quantity string Body Not Required Item quantity
callback_url string Body Required Web hook URL to be called after payment's transaction completed. It will POST a payment object. refer here
redirect_url string Body Not Required URL to redirect the customer after payment completed. The customer will see lekirpay receipt if redirect_url is not present.
cancel_url string Body Not Required URL to redirect the customer if the payment canceled.
method string Body Not Required Either GET or POST. Allows clients to select data redirect via GET or POST. Default is POST due to legacy compatibility.
phone number Body Not Required Customer phone number
email string Body Required Customer email
name string Body Required Customer name
charge_to_payer string Body Not Required "true" or "false"
Transfer the total transaction fee to Payer/Buyer to bear it
group_id string Body Not Required Added to default group if group_id is not present
checksum string Body Required Your generated hash checksum using Lekir-Signature

Example request

  curl -X POST \
  https://app.lekir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jTVzuiRqUB3ts4nYyzTurC9pydf7KAHeBp-c' \
  -F amount=1 \
  -F reference_no=ORDER99181TEST1 \
  -F 'item=baju kemeja' \
  -F callback_url=https://www.example.com/callback \
  -F [email protected] \
  -F name=example \
  -F checksum=632d815520bc0ad7d4f1cbeb27eba5a2dc66e528b964507acd6e2c461f87b160
					

Response

{
"payment_id": "833711424511",
"reference_no": "2",
"payment_url": "https://app.lekirpay.com/public/pay/833711424511",
"status": "created",
"created_date": {
"date": "2018-07-21 05:28:25.000000",
"timezone_type": 3,
"timezone": "Asia/Kuala_Lumpur"
}
}