'use strict';

var Api = require('./Api-D9vOcUw4.js');
require('./Plaid-CPESyiiV.js');
require('./Pagination-Dediz133.js');
require('./Business-oBifyXkW.js');

const api = Api.Api();
class PayoutService {
    async fetchPayouts(accountId, authToken, params) {
        const endpoint = `account/${accountId}/payouts`;
        return api.get({ authToken, endpoint, params });
    }
    async fetchPayout(payoutId, authToken) {
        const endpoint = `payouts/${payoutId}`;
        return api.get({ authToken, endpoint });
    }
    async fetchCSV(payoutId, authToken) {
        const endpoint = `reports/payouts/${payoutId}`;
        return api.get({ authToken, endpoint });
    }
    async fetchPayoutTransactions(accountId, authToken, params) {
        const endpoint = `balance_transactions`;
        const headers = { 'sub-account': accountId };
        return api.get({ authToken, endpoint, params, headers });
    }
}

exports.PayoutService = PayoutService;
