Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Deposit of funds (API)

Доступ к общему API реализован по белому листу IP-адресов и секретному ключу. Перед началом работы с API на ввод, необходимо передать ТП Paykassma IP-адрес с которого будут отправляться запросы.

PLUGINAPI_SECRET - строка секретного ключа. Ее необходимо будет добавлять ко всем запросам в виде get-параметра secret.
    Например: https://api.{URL_сервера_Paykassma}/api/v1/deposit-info?secret=pluginapi_secret 

При отправки запроса без использования данных параметров, будет выдаваться ошибка 404 'Не найдено'

Attention: Before starting to work with the API for deposit, it is necessary to send the IP address from which requests will be sent to the Paykassma TS.

Saving the client’s ID transaction

Request for sending your transaction ID (custom_transaction_id) to Paykassma. In the future, this ID is assigned to the transaction performed by the user and is transmitted in the postback.

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/payment/save-transaction-custom-id

Request method: POST

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

label

string (190)

YES

Unique identifier (ID) of the user making the payment

transaction_custom_id

string (190)

YES

Transaction ID in the Client’s system

Code Block
themeDJango
titleRequest
{
    "label": "55",
    "transaction_custom_id": "123465477897"
}
Code Block
themeDJango
titleResponse Success
{
    "status": "ok"
}
Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}

Obtaining available PSs

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/payment-systems/available

Request method: GET

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

currency_code

string[] (3)

YES

An array consisting of currency codes. PS that work with the specified currencies will be displayed

label

string (190)

YES

Unique identifier (ID) of the user making the payment

Code Block
themeDJango
titleRequest
{
    "currency_code": [ "USD", "INR" ],
    "label": "55"
}


Code Block
themeDJango
titleResponse Success
collapsetrue
{
  "status": "ok",
  "params": {
    "gif_guide": {
      "upi": "http:\/\/api.pay.test\/storage\/guide-image\/upi.mp4?cache=1587635151",
      "phonePe": "http:\/\/api.pay.test\/storage\/guide-image\/phonePe.gif?cache=1589958899",
      "bkash": "http:\/\/api.pay.test\/storage\/guide-image\/bkash.mpg?cache=1611553163"
    },
    "currency_data": [
      {
        "code": "INR",
        "symbol": "₹"
      }
    ],
    "wallets": [
      {
        "type": "paytm",
        "currency_code": "INR",
        "order": 5,
        "logo": "http:\/\/api.pay.test\/storage\/payment_system\/logos\/paytm_default.svg",
        "name": "PayTM"
      },
      {
        "type": "paytm",
        "currency_code": "INR",
        "order": 5,
        "logo": "http:\/\/api.pay.test\/storage\/payment_system\/logos\/paytm_34.svg",
        "name": "paytm",
        "hints": [
          {
            "type": "requisites_hint",
            "text": null
          },
          {
            "type": "payment_hint",
            "text": null
          },
          true
        ],
        "show_limits": true
      }
    ],
      "imps": {
        "INR": {
          "min": "8000",
          "max": "560000"
        }
      },
      "bkash": {
        "BDT": {
          "min": "100",
          "max": "1000000"
        }
      },
      "upi": {
        "INR": {
          "min": "20000",
          "max": "50000"
        }
      },
      "paytm": {
        "INR": {
          "min": "100000",
          "max": "20000000"
        }
      },
      "phone_pe": {
        "INR": {
          "min": "100",
          "max": "800000"
        }
      }
    }
  }
}


Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}

Creating a payment

Currently, there are two types of requests for creating a payment, depending on the PS.

Info

Attention! To get a complete list of available PSs, you need to contact Paykassma TS. TS will provide complete examples of requests for currently available PSs. They will also determine the correct request, depending on the selected PS.

Type of request №1:

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/transaction/create/{wallet_type}

1.1

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/transaction/create/paytm

In this case, first we accept a request for deposit via PayTM, then in response we will provide details of the wallet to which the user should transfer the payment, and after payment you need to send a request to activate the transaction

Request method: POST

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

currency

string (3)

YES

Currency code

label

string (190)

YES

Unique identifier of the user making the payment

Code Block
themeDJango
titleRequest
{
    "currency": "INR",
    "label": "eligendi"
}


Code Block
themeDJango
titleResponse Success
{
    "status": "ok",
    "params":  {
        "identifier": "6234234234"
                      }
}


Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}

1.2 Activation request: 

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/transaction/activate

Request method: POST

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

currency_code

string (3)

YES

Currency code

wallet_type

string (190)

YES

Value from the list of available PSs.
Attention: To get a complete available list, contact Paykassma TS.

label

string (190)

YES

Unique identifier of the user making the payment

key1

string (190)

YES

A code on which activation is performed (Transiction_ID), received from the user

Code Block
themeDJango
titleRequest
{
    "currency_code": "USD",
    "wallet_type": "paytm",
    "label": "55",
    "key1": "123-ABC-456-DEF"
}


Code Block
themeDJango
titleResponse Success
{
    "status": "ok"
}


Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}

Type of request №2:

2.1 

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/payment/create/{payment_system}

Request method: POST

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

language

string (2)

YES

Interface language

currency

string (3)

YES

Currency code

bank

string (3)

YES

The bank via which the payment is performed

amount

numeric 

(ограничена max.
депозитом)

YES

Payment amount

label

string (190)

YES

Unique identifier of the user making the payment

redirect_url

url 

YES

URL of the page for redirecting after payment

Code Block
themeDJango
titleRequest
{
   "language": "en",
   "currency": "USD",
   "bank": "MBB",
   "amount": "1000",
   "label": "55",
   "redirect_url": "https:\/\/google.com"
}


Code Block
themeDJango
titleResponse Success
{
    "status": "ok"
}


Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}

Information about savings

Request to provide information about savings of a certain user

Для сохранения информации о транзакциях, сумма которых не превышает размер минимального депозита для конкретной платёжной системы, был реализован функционал накоплений. Транзакции пользователя (выборка по параметру label) копятся в системе и не зачисляются на счёт пользователя до тех пор, пока их сумма не достигнет минимального депозита этой платёжной системы. Постбек на сервер клиента отправится только после достижения суммы минимального депозита. До момента отправки postback транзакция не считается зачисленной на счёт. 

Code Block
themeRDark
titleAPI url
https://api.{URL_сервера_Paykassma}/api/v1/deposit-info

Request method: GET

Format: JSON

Parameters:

Параметр

Тип

Обязательность

Описание

label

string (190) 

YES

Unique identifier of the user making the payment

wallet_type

url 

YES

Value from the list of available PSs.
Attention: To get a complete available list, contact Paykassma TS.

currency

string (3)

YES

Currency code

code

string (190) 
или
“null”

NO

Name of the manual payment system.
It’s filled in when wallet_type = manual

Code Block
themeDJango
titleRequest
{
   "label": "55",
   "wallet_type": "paytm",
   "currency": "UDS"
}


Code Block
themeDJango
titleResponse Success
{
    "status": "ok"
    "stockpiling_sum": 0,
    "lacks_sum": 0,
    "minimum_deposit": 148
}


Code Block
themeDJango
titleResponse Fail
{
    "status": "fail"
    "message": "MESSAGE"
}


Withdrawal of funds (API)

To withdraw funds by the user via payment systems available to the Client, it is necessary to:

  1. Once send Paykassma TS the URL of the server where postbacks with the withdrawal status will be sent.
  2. Send withdrawal requests (POST) to the URL:

    Code Block
    themeRDark
    titleAPI url
    https://api.{ URL сервера }/v2/withdrawal/create



Warning

Attention: When transmitting data, there should be no spaces at the beginning and end

Each withdrawal request is signed by signature, it is formed as follows:

Code Block
themeDJango
titleSignature
$data = [
    ...
];

$data['signature'] = generateSignature($data); // return fa0ee1e2acf7f898635ec417491381c0a4f9d35c

//send $data like json ...

function generateSignature(array $data) {
    $privateKey = 'yourprivatekey';
	ksort($data);
	$implode = implode(':', $data);
	return sha1($privateKey . md5($implode));
}

Required parameters for transmission in POST request:

Наименование

Тип

Обязательность

Описание

withdrawal_idstring(1-7) optional Withdrawal ID, if the parameter is not passed, then the system generates withdrawal _id
payment_systemstring requiredPayment system
amountnumericrequiredWithrawal amount
currency_codestring(3) requiredCurrency code
labelstring required

Unique identifier of the user making the payment

commentstring(4-64) optionalComment
account_numberstring 

*required_if

ПС

PS = bkash,imps,
upi,paytm,....

Number of the bank account

account_namestring *required_if
ПС
PS = imps,
upi,....

Name of the bank account holder

account_emailstring *required_if
ПС
PS = bkash,...

Email of the person who is being paid

receiver_namestring(190)required_if
ПС
PS = impsName of the person who is being paid
payments_details.payments_methodstring *required_if
Payment method
payments_details.payments_providerstring optionalSupplier who makes electronic payment using the selected payment method
bank_details.bank_codestring*required_ifUnique ID assigned by the country's central bank
bank_details.branch_codestring*required_ifBank branch code
bank_details.bank_code_in_payments_systemstring*required_if

Bank code in payments system,

с которой осуществляется обмен данными

 with which data is exchanged

account_typestring*required_if
Тип аккаунта 
Account type
document_typestring*required_if
Тип документа
Document type
document_idstring*required_if
Идентификатор документа получателя
Recipient document ID
account_digitstring*required_if
Цифра счета
Account digit
ibanstring*required_ifIBAN
Info
*В запросе на вывод, имеются поля обязательные только для некоторых платежных системThe withdrawal request contains fields that are required only for some payment systems (required_if), для полного списка обязательных полей для определенной ПС, необходимо обратиться в Техническую поддержку Paykassma.
Обязательные поля для ПС
to get a complete list of required fields for a specific payment system, you need to contact Paykassma technical support.

Required fields for PS Bkash, PayTm, IMPS/UPI:

Платежная системаPayment systemaccount_numberaccount_nameaccount_emailreceiver_namepayments_detailsbank_details
payments_methodpayments_providerbank_codebranch_codebank_code_in_payment_system

Bkash

required-required------
IMPS/UPIrequiredrequired-required for IMPS--optional--
Paytmrequired--------

Request:

Code Block
themeDJango
titleПример тела запроса
{
	'withdrawal_id': '1234567',
    'payment_system': 'paytm',
	'amount' : '1000',      
	'type': '0',   
    'currency_code': 'IDR',
	'label': '55',        
	'comment': 'withdrawal',       
	'account_number': '11111111', 
	'account_name' : '',
	'account_email' : '',
	'payments_details':
        {
            'payments_method': '',
            'payments_provider': ''
        },
    'bank_details':
        {
            'bank_code': '',
            'branch_code': '',
            'bank_code_in_payments_system': ''
        },
	'account_type': '',
	'document_type': '',
	'document_id': '',
	'account_digit': '',
	'iban': ''
}
Code Block
languagephp
titleResponse Success
{
    'status': 'ok'
}
Code Block
languagephp
titleResponse Fail
{
    'status': 'fail'
    'message': 'MESSAGE'
}

После обработки вывода, Paykassma пришлет постбек о результате вывода с определенным статусом, подписанной сигнатурой

Статусы выводов

After processing the withdrawal, Paykassma will send a postback about the result of the withdrawal with a status, signed with a signature.

Withdrawal status

СтатусОписание
NEW (0)Новый статус для вывода, с момента принятия заявки на вывод,
до момента, когда будет обработана модератором(принята или отклонена)

In processing

CANCELED (2)Статус для вывода, когда он был отклонён на стороне ПС

Unsuccessful

PROCESSED (1)Статус для вывода, когда заявка на вывод была успешно обработана

Uccessful



The old withdrawal request is also available for work.Так же к работе доступен старый запрос на вывод

API url:

Code Block
themeDJango
https://api.{URL_сервера_Paykassma}/withdrawal/manual/create


Необходимые параметры для передачи в POST запросе
Внимание: При передаче данных не должно быть пробелов в начале и конце параметров в JSON файлеRequired parameters for transmission in POST request:

Параметр

Тип данных

Описание

wallet_type

text(191)

Выбор из доступного списка

Selection from the available list

Type of the payment systemТип платежной системы

wallet_recipient

string(191)

The recipient's wallet, to whose account the payment will be made

Attention!

Кошелек получателя, на чей счет будет совершенна выплата

Внимание! wallet_recipient (Для метода For the Paytm ) должен содержать номер кошелька Paytm без международного кода method) must contain the Paytm wallet number without the international code +91

wallet_sender

string(191)

The sender's wallet, from whose account money will be withdrawn. The final choice of the sender is left to Paykassma.

Attention: it is necessary to fill in the field with arbitrary four digits

Кошелек отправителя, с чьего счета будет снятие денежных средств. Конечный выбор отправителя остается за Paykassma.

Внимание: в текущей реализации необходимо заполнить поле произвольными четырьмя цифрами

account_name

string(191)Имя держателя банковского аккаунта

Name of the bank account holder

account_number

string(191)Номер

банковского аккаунтаNumber of the bank account

email

string(191)Электронная почта того, кому выплачивают

Email of the person who is being paid

amount

double
Внимание: Для выводов для ПС PayTM, поле amount должно быть целым и кратным 10.

Double

Withdrawal amountСумма вывода, в случае с  PayTm, принимается сумма кратная 10!

withdrawal_id

integerInteger

ID вывода на стороне клиента (возвращается в постбекеClient side withdrawal ID (returned in postback).

Пример тела запросаRequest:

Code Block
themeDJango
{
    "wallet_type":"paytm",
    "wallet_recipient":"123123232",
    "wallet_sender":1111,
    "email":"[email protected]",
    "amount":1000,
    "withdrawal_id":"13",
    "signature":"fae51673a8a9c85f724317214bd0bcc665ebc799"
}

При отправки к Paykassma запроса на вывод, в первом ответе получаете сформированные данные по заявке, без сигнатуры следующего вида:

":"13",
    "signature":"fae51673a8a9c85f724317214bd0bcc665ebc799"
}


When sending a withdrawal request to Paykassma, the first response received the generated data on the request, without a signature:

Example first responseПример данных ответа:

Code Block
themeDJango
{
    "id":1,
    "wallet_type":"paytm",
    "wallet_recipient":"123123232",
    "wallet_sender":"1111",
    "email":"[email protected]",
    "amount":1000,
    "status":1,
    "created_at":"2020-07-08 07:06:06",
    "updated_at":"2020-07-08 09:40:39"
}

Вторым ответом уже придет постбек о результате вывода, подписанной сигнатуройThe second response will already come a postback about the withdrawal, signed by the signature.


Table of Contents
minLevel2