import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-GCCHFONX.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-ZPGWM4VJ.mjs";
import "../../chunk-IZYPRCCV.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-BONN6PYB.mjs";
import "../../chunk-5XJJKYXE.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-W7NJUABI.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-3QQCDR3E.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-QHMIK7U3.mjs";
import "../../chunk-64EFLUS3.mjs";
import "../../chunk-B5T7AQLH.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({ apiKey: "test-key", instanceId: "in_000000000000" });
      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({
            receiver_id: "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({
            receiver_id: "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("re_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedVirtualAccount);
        }));
      });
    });
  }
});
export default require_virtual_accounts_test();
