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/receivers/receivers.test.ts
var require_receivers_test = __commonJS({
  "src/resources/receivers/receivers.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Receivers", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("List receivers", () => {
        it("should list receivers", () => __async(null, null, function* () {
          const mockedReceivers = [
            {
              id: "re_000000000000",
              type: "individual",
              kyc_type: "standard",
              kyc_status: "verifying",
              kyc_warnings: [
                {
                  code: null,
                  message: null,
                  resolution_status: null,
                  warning_id: null
                }
              ],
              email: "email@example.com",
              tax_id: "536804398",
              address_line_1: "738 Plain St",
              address_line_2: "Building 22",
              city: "Marshfield",
              state_province_region: "MA",
              country: "US",
              postal_code: "02050",
              ip_address: "127.0.0.1",
              image_url: "https://example.com/image.png",
              phone_number: "+1234567890",
              proof_of_address_doc_type: "UTILITY_BILL",
              proof_of_address_doc_file: "https://example.com/image.png",
              first_name: "John",
              last_name: "Doe",
              date_of_birth: "1998-01-01T00:00:00Z",
              id_doc_country: "BR",
              id_doc_type: "PASSPORT",
              id_doc_front_file: "https://example.com/image.png",
              id_doc_back_file: "https://example.com/image.png",
              legal_name: "Company Name Inc.",
              alternate_name: "Company Name Inc.",
              formation_date: "1998-01-01T00:00:00Z",
              website: "https://example.com",
              owners: [
                {
                  id: "ub_000000000000",
                  first_name: "John",
                  last_name: "Doe",
                  address_line_1: "738 Plain St",
                  address_line_2: "Building 22",
                  city: "Marshfield",
                  state_province_region: "MA",
                  country: "US",
                  postal_code: "02050",
                  id_doc_country: "BR",
                  id_doc_type: "PASSPORT",
                  id_doc_front_file: "https://example.com/image.png",
                  id_doc_back_file: "https://example.com/image.png"
                }
              ],
              incorporation_doc_file: "https://example.com/image.png",
              proof_of_ownership_doc_file: "https://example.com/image.png",
              source_of_funds_doc_type: "business_income",
              source_of_funds_doc_file: "https://example.com/image.png",
              individual_holding_doc_front_file: "https://example.com/image.png",
              purpose_of_transactions: "business_transactions",
              purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
              external_id: "your_company_external_id",
              instance_id: "in_000000000000",
              tos_id: "to_000000000000",
              aiprise_validation_key: "",
              created_at: "2021-01-01T00:00:00Z",
              updated_at: "2021-01-01T00:00:00Z",
              limit: {
                per_transaction: 1e5,
                daily: 2e5,
                monthly: 1e6
              }
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceivers), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.list();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceivers);
        }));
      });
      describe("Create receiver", () => {
        const mockedReceiver = {
          id: "re_000000000000"
        };
        it("should create a receiver", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.create({
            type: "individual",
            kyc_type: "standard",
            email: "email@example.com",
            tax_id: "536804398",
            address_line_1: "738 Plain St",
            address_line_2: "Building 22",
            city: "Marshfield",
            state_province_region: "MA",
            country: "US",
            postal_code: "02050",
            ip_address: "127.0.0.1",
            image_url: "https://example.com/image.png",
            phone_number: "+1234567890",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            date_of_birth: "1998-01-01T00:00:00Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            legal_name: "Company Name Inc.",
            alternate_name: "Company Name Inc.",
            formation_date: "1998-01-01T00:00:00Z",
            website: "https://example.com",
            owners: [
              {
                first_name: "John",
                last_name: "Doe",
                role: "beneficial_owner",
                date_of_birth: "1998-01-01T00:00:00Z",
                tax_id: "536804398",
                address_line_1: "738 Plain St",
                address_line_2: "Building 22",
                city: "Marshfield",
                state_province_region: "MA",
                country: "US",
                postal_code: "02050",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png",
                proof_of_address_doc_file: "https://example.com/image.png",
                proof_of_address_doc_type: "UTILITY_BILL"
              }
            ],
            incorporation_doc_file: "https://example.com/image.png",
            proof_of_ownership_doc_file: "https://example.com/image.png",
            source_of_funds_doc_type: "business_income",
            source_of_funds_doc_file: "https://example.com/image.png",
            individual_holding_doc_front_file: "https://example.com/image.png",
            purpose_of_transactions: "business_transactions",
            purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
            external_id: "your_company_external_id",
            tos_id: "to_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ id: "re_000000000000" });
        }));
      });
      describe("Get receiver", () => {
        it("should get a receiver", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_000000000000",
            type: "individual",
            kyc_type: "standard",
            kyc_status: "verifying",
            kyc_warnings: [
              {
                code: null,
                message: null,
                resolution_status: null,
                warning_id: null
              }
            ],
            email: "email@example.com",
            tax_id: "536804398",
            address_line_1: "738 Plain St",
            address_line_2: "Building 22",
            city: "Marshfield",
            state_province_region: "MA",
            country: "US",
            postal_code: "02050",
            ip_address: "127.0.0.1",
            image_url: "https://example.com/image.png",
            phone_number: "+1234567890",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            date_of_birth: "1998-01-01T00:00:00Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            legal_name: "Company Name Inc.",
            alternate_name: "Company Name Inc.",
            formation_date: "1998-01-01T00:00:00Z",
            website: "https://example.com",
            owners: [
              {
                id: "ub_000000000000",
                first_name: "John",
                last_name: "Doe",
                address_line_1: "738 Plain St",
                address_line_2: "Building 22",
                city: "Marshfield",
                state_province_region: "MA",
                country: "US",
                postal_code: "02050",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png"
              }
            ],
            incorporation_doc_file: "https://example.com/image.png",
            proof_of_ownership_doc_file: "https://example.com/image.png",
            source_of_funds_doc_type: "business_income",
            source_of_funds_doc_file: "https://example.com/image.png",
            individual_holding_doc_front_file: "https://example.com/image.png",
            purpose_of_transactions: "business_transactions",
            purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
            external_id: "your_company_external_id",
            instance_id: "in_000000000000",
            tos_id: "to_000000000000",
            aiprise_validation_key: "",
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z",
            limit: {
              per_transaction: 1e5,
              daily: 2e5,
              monthly: 1e6
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.get("re_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceiver);
        }));
      });
      describe("Update receiver", () => {
        it("should update a receiver", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.update({
            receiver_id: "re_000000000000",
            email: "email@example.com",
            tax_id: "536804398",
            address_line_1: "738 Plain St",
            address_line_2: "Building 22",
            city: "Marshfield",
            state_province_region: "MA",
            country: "US",
            postal_code: "02050",
            ip_address: "127.0.0.1",
            image_url: "https://example.com/image.png",
            phone_number: "+1234567890",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            date_of_birth: "1998-01-01T00:00:00Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            legal_name: "Company Name Inc.",
            alternate_name: "Company Name Inc.",
            formation_date: "1998-01-01T00:00:00Z",
            website: "https://example.com",
            owners: [
              {
                id: "ub_000000000000",
                first_name: "John",
                last_name: "Doe",
                role: "beneficial_owner",
                date_of_birth: "1998-01-01T00:00:00Z",
                tax_id: "536804398",
                address_line_1: "738 Plain St",
                address_line_2: "Building 22",
                city: "Marshfield",
                state_province_region: "MA",
                country: "US",
                postal_code: "02050",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png"
              }
            ],
            incorporation_doc_file: "https://example.com/image.png",
            proof_of_ownership_doc_file: "https://example.com/image.png",
            source_of_funds_doc_type: "business_income",
            source_of_funds_doc_file: "https://example.com/image.png",
            individual_holding_doc_front_file: "https://example.com/image.png",
            purpose_of_transactions: "business_transactions",
            purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
            external_id: "your_company_external_id",
            tos_id: "to_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Delete receiver", () => {
        it("should delete a receiver", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.delete("re_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Get receiver limits", () => {
        it("should get receiver limits", () => __async(null, null, function* () {
          const mockedReceiverLimits = {
            limits: {
              payin: {
                daily: 1e4,
                monthly: 5e4
              },
              payout: {
                daily: 2e4,
                monthly: 1e5
              }
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiverLimits), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.getLimits("re_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceiverLimits);
        }));
      });
    });
  }
});
export default require_receivers_test();
