Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

In current version registration of deposits and withdrawals is carried out manually by the administrator through the admin panel.

1. Deposit flow

Current flow:

Administrator from AdminPanel sends following mutation

type Mutation {
    adminDeposit(
        currencyId: String!,
        paymentInterfaceId: String!,
        address: String!,
        amount: Float!,
        documentId: String
    ): String
}

Service "paymentGateway" receive this mutation and call action “processTransaction” of service "operations"

await ctx.call('paymentGateway.processTransaction', {
  txid: String(ctx.params.documentId || new Date().getTime()), // # bank transaction or if it is Null - unix time
  amount: Number(ctx.params.amount), // deposit amount
  paymentInterfaceId: piId, // fiat payment interface ID
  currencyId: ctx.params.currencyId, // deposit currency ID
  address: ctx.params.address, // user ref No
});

Deposit flow without administrator participation:

To do this, in the payment interface it is necessary to implement the receipt of information from the bank. And if a deposit has arrived from the client, call the action processTransaction of service “operations” with parameters:

  • txid - String - original bank document ID

  • amount - Number - amount of payment

  • paymentInterfaceId - String

  • currencyId - String

  • address - String - user refNo from payment description

Example call:

await ctx.call('paymentGateway.processTransaction', {
  txid: String(documentId),
  amount: Number(amount),
  paymentInterfaceId: 'FIAT-PI',
  currencyId: 'EUR',
  address: 'C03457' // user ref No
});

If the bank uses webhooks following docs can be used https://moleculer.services/docs/0.12/moleculer-web.html

Or use schedule for receive bank statement and analyse it.

2. Withdrawal flow

Current flow:

N.B. Set minimum withdrawal amount = 0 for Currency/Bank-PI. This will definitely pause the withdrawal operation until the administrator approves it.

Withdrawal flow without administrator participation:

You need to add a code to the action {Bank-PI}.transfer - send new payment to bank

  • No labels