import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-GCCHFONX.mjs";
import {
  Blindpay,
  init_client
} from "../../chunk-ES7RXEM7.mjs";
import "../../chunk-GEDDLCJY.mjs";
import "../../chunk-LK3JPQ6I.mjs";
import "../../chunk-CNNEROQ7.mjs";
import "../../chunk-GNDAATIJ.mjs";
import "../../chunk-VKN2AMCW.mjs";
import "../../chunk-LUDGZPXY.mjs";
import "../../chunk-3CZJEDS5.mjs";
import "../../chunk-UCAW3RTZ.mjs";
import "../../chunk-M6IYYMRW.mjs";
import "../../chunk-HKFAJXJG.mjs";
import "../../chunk-QVOSGLUO.mjs";
import "../../chunk-2DAKB5XK.mjs";
import "../../chunk-QHMIK7U3.mjs";
import "../../chunk-LLWEHHKB.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/virtual-accounts/virtual-accounts.test.ts
var require_virtual_accounts_test = __commonJS({
  "src/resources/virtual-accounts/virtual-accounts.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Virtual accounts", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new Blindpay("test-key");
      describe("Update virtual account", () => {
        it("should update a virtual account", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.virtualAccounts.update({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            blockchain_wallet_id: "bw_000000000000",
            token: "USDC"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Create virtual account", () => {
        it("should create a virtual account", () => __async(null, null, function* () {
          const mockedVirtualAccount = {
            id: "va_000000000000",
            us: {
              ach: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              wire: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              rtp: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              swift_bic_code: "CHASUS33",
              account_type: "Business checking",
              beneficiary: {
                name: "Receiver Name",
                address_line_1: "8 The Green, #19364",
                address_line_2: "Dover, DE 19901"
              },
              receiving_bank: {
                name: "JPMorgan Chase",
                address_line_1: "270 Park Ave",
                address_line_2: "New York, NY, 10017-2070"
              }
            },
            token: "USDC",
            blockchain_wallet_id: "bw_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedVirtualAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.virtualAccounts.create({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            blockchain_wallet_id: "bw_000000000000",
            token: "USDC"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedVirtualAccount);
        }));
      });
      describe("Get virtual account", () => {
        it("should get a virtual account", () => __async(null, null, function* () {
          const mockedVirtualAccount = {
            id: "va_000000000000",
            us: {
              ach: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              wire: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              rtp: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              swift_bic_code: "CHASUS33",
              account_type: "Business checking",
              beneficiary: {
                name: "Receiver Name",
                address_line_1: "8 The Green, #19364",
                address_line_2: "Dover, DE 19901"
              },
              receiving_bank: {
                name: "JPMorgan Chase",
                address_line_1: "270 Park Ave",
                address_line_2: "New York, NY, 10017-2070"
              }
            },
            token: "USDC",
            blockchain_wallet_id: "bw_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedVirtualAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.virtualAccounts.get({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedVirtualAccount);
        }));
      });
    });
  }
});
export default require_virtual_accounts_test();
