Создание модуля выплат
Структура файлов:
plugins/payouts/__NAME_PAYOUT
- папка с модулем./icon.png
or./icon.jpg
- иконка модуля 1:1 (рекомендуемый 150px на 150px)./configure.js
- файл правил конфигурация модуля также конфигурирование доступов./index.js
- Класс модуля (точка входа в модуль)./template/admin.html
- Шаблон админ страници настроек модуля (vue template)./template/admin.js
- файл експорта клиентской логики js (vue js)
configure.js
:
configure.js
:Пример файла и его функции
index.js
:
index.js
:Должен иметь экспортный класс
Как работать с конфигурацией:
Пример конструктора
Function getFields(lang,xml){}
getFields(lang,xml){}
Param lang
has Sting:
ru, en, etc...
- Краткий ключ языка
Param xml
has Sting:
Пример конструктора
Should Return Array (when xml is support)
Should Return NULL
(when xml is not support)
Function transfer(order){}
transfer(order){}
Param order
has object:
key | Type | Required | Value |
---|---|---|---|
order.uid | Number | YES | order uid |
order.outAmount | Float | YES | order outAmount |
order.outXML | String | YES | XML of currency for withdrawal |
order.outValues | Object | YES | Order requisites |
Should Return Promise -> resolve (when transfer success) {Object}
key | Type | Required | Value |
---|---|---|---|
ok | Number | YES | 1 - success |
transaction | String | YES | transaction id or transfer id |
to | String | YES | Wallet id or other requisites who received payment |
currency | String | YES | Currency ISO (example USD) |
amount | Float | YES | amount of transfer |
fee | Float | No | Fee of tx (will add comment for admin) |
note | String | No | Note for order (will show to user) |
Should Return Promise -> reject (when transfer fail) {String}
Message of fail
Last updated