import { A as Api } from './Api.js';
import './Plaid.js';
import './Pagination.js';
import './Business.js';
import './ApplePay.js';

const api = Api();
class PlaidService {
    async getLinkToken(authToken, accountId, checkoutId, signal) {
        const endpoint = `plaid/${accountId}/link`;
        const body = { checkout_id: checkoutId };
        return api.post({ endpoint, body, authToken, signal });
    }
    async getLinkTokenForVerification(authToken, businessId, signal) {
        const endpoint = `entities/plaid/${businessId}/link_token`;
        const body = {};
        return api.post({ endpoint, body, authToken, signal });
    }
    async getBankAccountData(authToken, businessId, signal) {
        const endpoint = `entities/plaid/${businessId}/bank_account`;
        return api.get({ endpoint, authToken, signal });
    }
    async postPlaidVerifiedBankAccountData(authToken, businessId, payload, signal) {
        const endpoint = `entities/plaid/${businessId}/bank_account`;
        return api.post({ endpoint, body: payload, authToken, signal });
    }
    async tokenizeBankAccount(authToken, accountId, publicToken, linkTokenId, paymentMethodGroupId, signal) {
        const endpoint = `plaid/${accountId}/tokenize`;
        const body = { public_token: publicToken };
        if (linkTokenId) {
            body.link_token_id = linkTokenId;
        }
        if (paymentMethodGroupId) {
            body.payment_method_group_id = paymentMethodGroupId;
        }
        return api.post({ endpoint, body, authToken, signal });
    }
}

export { PlaidService as P };
