Callback

Request Completion via Callback

When an action is completed, the results are sent to a callback URL that you provide.

Hash Generation (Optional)

If you prefer to use a hash for added security, the hash algorithm used is SHA256.

Example Data

Here is an example of the data that might be before hashing:

{
    "id": 91,
    "username": "Bennett84",
    "firstName": "Florencio",
    "lastName": "Thompson",
    "amount": 1001,
    "currency": "TRY",
    "type": "Deposit",
    "status": "Confirm",
    "message": "",
    "reference": "9e9d387d-908a-4666-b119-a3743280d9f4",
    "hash": ""
}

Hash Generation Process

  1. Salt: Your API key provided by us.

    • Example API key: e0d26036720740f4a04452ec7370ffb4

  2. Data to Hash: Concatenate the data with the salt.

    • Example:

      {"id":91,"username":"Bennett84","firstName":"Florencio","lastName":"Thompson","amount":1001,"currency":"TRY","type":"Deposit","status":"Confirm","message":"","reference":"9e9d387d-908a-4666-b119-a3743280d9f4","hash":""}e0d26036720740f4a04452ec7370ffb4
  3. Generated Hash:

    • Hash: 5c19ac3344d0e42bb5774e20310d76b47d58fd9881d317f30eb5e4d695f6013d

The codes given below calculate the SHA256 hash value of the transaction object.

import hashlib

hash_str = '{"id":91,"username":"Bennett84","firstName":"Florencio","lastName":"Thompson","amount":1001,"currency":"TRY","type":"Deposit","status":"Confirm","message":"","reference":"9e9d387d-908a-4666-b119-a3743280d9f4","hash":""}'
salt = "e0d26036720740f4a04452ec7370ffb4"
has_data = hash_str + salt

hash_object = hashlib.sha256(has_data.encode())
calculated_hash = hash_object.hexdigest()

print(calculated_hash)

We Use Unicode Escape in JSON Serialization

Why Use Unicode Escape?

Security: Ensures safe data processing across different systems, crucial for maintaining data integrity in payment systems.

Compatibility: Guarantees consistent interpretation of JSON data across all systems and applications, improving integration with payment gateways and third-party services.

Error Reduction: Reduces potential character encoding errors.

Key Point: In our payment systems and multi-system integrations, we use Unicode escape during serialization for better security and compatibility.

Resulting JSON

Here is the resulting JSON that includes the generated hash:

{
  "id": 91,
  "username": "Bennett84",
  "firstName": "Florencio",
  "lastName": "Thompson",
  "amount": 1001,
  "currency": "TRY",
  "type": "Deposit",
  "status": "Confirm",
  "message": "",
  "reference": "9e9d387d-908a-4666-b119-a3743280d9f4",
  "hash": "5c19ac3344d0e42bb5774e20310d76b47d58fd9881d317f30eb5e4d695f6013d"
}

Send a callback

POST https://yourdomain.com/your-path

Headers

Name
Value

Content-Type

application/json

x-api-key

<x-api-key>

Body

Name
Type
Description

id

integer

Transaction Id

username

string

The user's unique username. It should be dynamically generated or retrieved from your user database.

firstName

string

The user's first name.

lastName

string

The user's last name.

amount

decimal

The deposit amount in the smallest currency unit (e.g., cents, pence).

currency

string

The currency of the deposit amount (e.g., TRY, USD, EUR, GBP).

type

string

"Deposit" or "Withdrawal"

status

string

"Confirm" or "Reject"

message

string

Optional field for additional information about the transaction.

reference

string

A unique identifier for the transaction, typically a UUID or your unique transaction Id.

hash

string

Security measure to ensure data integrity and authenticity.

Response

For the callback, you can return a response as shown below or simply return a 204 No Content status. It is preferred to use appropriate HTTP status codes. The success of the result is determined based on the HTTP status codes.

{
  "message": "Transaction has been confirmed"
}

Last updated