Skip to content

Commit 0775944

Browse files
iulian03Iulian Masar
andauthored
[feature] bank wire payin to the repudiation wallet (#494)
* handle bank wire payin to the repudiation wallet * updated function name --------- Co-authored-by: Iulian Masar <iulian.masar@codegile.com>
1 parent 8ecfde8 commit 0775944

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed

lib/apiMethods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ module.exports = {
203203
"client_wallets_transactions": ["/${apiVersion}/${clientId}/clients/wallets/${fundsType}/${currency}/transactions/", "GET"],
204204
"client_create_bankaccount_iban": ["/${apiVersion}/${clientId}/clients/bankaccounts/iban", "POST"],
205205
"client_create_payout": ["/${apiVersion}/${clientId}/clients/payouts", "POST"],
206+
"client_create_bankwire_direct": ["/${apiVersion}/${clientId}/clients/payins/bankwire/direct", "POST"],
206207

207208
"banking_aliases_iban_create": ["/${apiVersion}/${clientId}/wallets/${walletId}/bankingaliases/iban", "POST"],
208209
"banking_aliases_get": ["/${apiVersion}/${clientId}/bankingaliases/${id}", "GET"],

lib/services/Clients.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var Transaction = require('../models/Transaction');
1111
var ClientWallet = require('../models/ClientWallet');
1212
var BankAccount = require('../models/BankAccount');
1313
var PayOut = require('../models/PayOut');
14+
var PayIn = require('../models/PayIn');
1415

1516
var Clients = Service.extend({
1617
/**
@@ -180,6 +181,15 @@ var Clients = Service.extend({
180181
});
181182

182183
return this._api.method('client_create_payout', callback, options);
184+
},
185+
186+
createBankWireDirectPayIn: function(payIn, callback, options) {
187+
options = this._api._getOptions(callback, options, {
188+
data: payIn,
189+
dataClass: PayIn
190+
});
191+
192+
return this._api.method('client_create_bankwire_direct', callback, options);
183193
}
184194
});
185195

test/services/Clients.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,31 @@ describe("Clients", function () {
204204
expect(createdPayOut.Id).not.to.be.undefined;
205205
});
206206
});
207+
208+
describe("Create PayIn BankWire Direct", function () {
209+
var created;
210+
211+
before(function (done) {
212+
const dto = {
213+
"CreditedWalletId": "CREDIT_EUR",
214+
"DeclaredDebitedFunds": {
215+
"Currency": "EUR",
216+
"Amount": 1000
217+
}
218+
};
219+
api.Clients.createBankWireDirectPayIn(dto, function(data) {
220+
created = data;
221+
done();
222+
});
223+
});
224+
225+
it('should create the payin', function () {
226+
expect(created).not.to.be.undefined;
227+
expect(created.Id).not.to.be.undefined;
228+
expect(created.Type).to.eq('PAYIN');
229+
expect(created.Status).to.eq('CREATED');
230+
expect(created.PaymentType).to.eq('BANK_WIRE');
231+
expect(created.ExecutionType).to.eq('DIRECT');
232+
});
233+
});
207234
});

typings/models/client.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import { ValueOf } from "../types";
22
import { enums } from "../enums";
33
import { address } from "./address";
44
import { entityBase } from "./entityBase";
5+
import { money } from "./money";
56

67
export namespace client {
8+
import MoneyData = money.MoneyData;
9+
710
type BusinessType = "MARKETPLACE" | "CROWDFUNDING" | "FRANCHISE" | "OTHER";
811

912
type Sector =
@@ -183,4 +186,18 @@ export namespace client {
183186
*/
184187
File: string;
185188
}
189+
190+
interface CreateBankWireDirectPayIn {
191+
/**
192+
* The unique identifier of the credited wallet.
193+
* In the case of the direct bank wire to the Repudiation Wallet,
194+
* this value has the format CREDIT_CCY where CCY is the currency of the Client Wallet to be credited (e.g., CREDIT_EUR).
195+
*/
196+
CreditedWalletId: string;
197+
198+
/**
199+
* Information about the declared funds to be wired by the platform to the returned bank account.
200+
*/
201+
DeclaredDebitedFunds: MoneyData;
202+
}
186203
}

typings/services/Clients.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { wallet } from "../models/wallet";
33
import { CurrencyISO } from "../types";
44
import { transaction } from "../models/transaction";
55
import { base } from "../base";
6+
import { payIn } from "../models/payIn";
67
import NoArgMethodOverload = base.NoArgMethodOverload;
78
import MethodOverload = base.MethodOverload;
89
import TwoArgsMethodOverload = base.TwoArgsMethodOverload;
@@ -67,4 +68,10 @@ export class Clients {
6768
getClientWalletTransactions: TwoArgsMethodOverload<wallet.ClientFundsType,
6869
CurrencyISO,
6970
transaction.TransactionData[]>;
71+
72+
/**
73+
* Create a Direct Bank Wire PayIn, instead of a Settlement Transfer, to the Repudiation Wallet in order to settle the negative balance due to a LOST dispute.
74+
* The object expires 1 month after creation if no funds are received.
75+
*/
76+
createBankWireDirectPayIn: MethodOverload<client.CreateBankWireDirectPayIn, payIn.BankWireDirectPayInData>
7077
}

0 commit comments

Comments
 (0)