import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-D6N3USMR.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-VWWGGMMT.mjs";
import "../../chunk-FG25JHDX.mjs";
import "../../chunk-KMU6V4LW.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-ISHZTBAN.mjs";
import "../../chunk-UDRMLZWT.mjs";
import "../../chunk-LEPGLH7Q.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-F5Z45GCA.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-YIZJM2GU.mjs";
import "../../chunk-Z6EYX4D3.mjs";
import "../../chunk-ALHMJWQN.mjs";
import "../../chunk-B5T7AQLH.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-VGU72ZNI.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-WE73MTQL.mjs";
import "../../chunk-UOAM7SX3.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/payins/payins.test.ts
var require_payins_test = __commonJS({
  "src/resources/payins/payins.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Payins", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("List payins", () => {
        it("should list payins", () => __async(null, null, function* () {
          const mockedPayins = {
            data: [
              {
                receiver_id: "re_000000000000",
                id: "re_000000000000",
                pix_code: "00020101021226790014br.gov.bcb.pix2557brcode.starkinfra.com/v2/bcf07f6c4110454e9fd6f120bab13e835204000053039865802BR5915Blind Pay, Inc.6010Vila Velha62070503***6304BCAB",
                memo_code: "8K45GHBNT6BQ6462",
                clabe: "014027000000000008",
                status: "processing",
                payin_quote_id: "pq_000000000000",
                instance_id: "in_000000000000",
                tracking_transaction: {
                  step: "processing",
                  status: "failed",
                  external_id: "12345678",
                  completed_at: "2011-10-05T14:48:00.000Z",
                  sender_name: "John Doe Smith",
                  sender_tax_id: "123.456.789-10",
                  sender_bank_code: "00416968",
                  sender_account_number: "1234567890",
                  trace_number: "1234567890",
                  transaction_reference: "1234567890",
                  description: "Payment from John Doe Smith",
                  pse_instruction: {
                    payment_link: "https://pse.example.com/payment/abc123",
                    fid: "fid_abc123",
                    full_name: "Juan P\xE9rez Garc\xEDa",
                    tax_id: "1234567890",
                    document_type: "CC",
                    phone: "+573001234567",
                    email: "juan@example.com",
                    bank_code: "1007"
                  },
                  transfers_instruction: {
                    account: "0000003100012389237485",
                    type: "CVU",
                    tax_id: "20123456783"
                  }
                },
                tracking_payment: {
                  step: "on_hold",
                  provider_name: "blockchain",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_complete: {
                  step: "on_hold",
                  transaction_hash: "0x123...890",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_partner_fee: {
                  step: "on_hold",
                  transaction_hash: "0x123...890",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                created_at: "2021-01-01T00:00:00Z",
                updated_at: "2021-01-01T00:00:00Z",
                image_url: "https://example.com/image.png",
                first_name: "John",
                last_name: "Doe",
                legal_name: "Company Name Inc.",
                type: "individual",
                payment_method: "pix",
                sender_amount: 5240,
                receiver_amount: 1010,
                token: "USDC",
                partner_fee_amount: 150,
                total_fee_amount: 1.53,
                commercial_quotation: 495,
                blindpay_quotation: 505,
                currency: "BRL",
                billing_fee: 100,
                name: "Wallet Display Name",
                address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
                network: "polygon",
                blindpay_bank_details: {
                  routing_number: "121145349",
                  account_number: "621327727210181",
                  account_type: "Business checking",
                  swift_bic_code: "CHASUS33",
                  ach: {
                    routing_number: "123456789",
                    account_number: "123456789"
                  },
                  wire: {
                    routing_number: "123456789",
                    account_number: "123456789"
                  },
                  rtp: {
                    routing_number: "123456789",
                    account_number: "123456789"
                  },
                  beneficiary: {
                    name: "BlindPay, Inc.",
                    address_line_1: "8 The Green, #19364",
                    address_line_2: "Dover, DE 19901"
                  }
                }
              }
            ],
            pagination: {
              has_more: true,
              next_page: "pi_123",
              prev_page: "pi_123"
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayins), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.list();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayins);
        }));
      });
      describe("Get payin", () => {
        it("should get a payin", () => __async(null, null, function* () {
          const mockedPayin = {
            receiver_id: "re_000000000000",
            id: "re_000000000000",
            pix_code: "00020101021226790014br.gov.bcb.pix2557brcode.starkinfra.com/v2/bcf07f6c4110454e9fd6f120bab13e835204000053039865802BR5915Blind Pay, Inc.6010Vila Velha62070503***6304BCAB",
            memo_code: "8K45GHBNT6BQ6462",
            clabe: "014027000000000008",
            status: "processing",
            payin_quote_id: "pq_000000000000",
            instance_id: "in_000000000000",
            tracking_transaction: {
              step: "processing",
              status: "failed",
              external_id: "12345678",
              completed_at: "2011-10-05T14:48:00.000Z",
              sender_name: "John Doe Smith",
              sender_tax_id: "123.456.789-10",
              sender_bank_code: "00416968",
              sender_account_number: "1234567890",
              trace_number: "1234567890",
              transaction_reference: "1234567890",
              description: "Payment from John Doe Smith",
              pse_instruction: {
                payment_link: "https://pse.example.com/payment/abc123",
                fid: "fid_abc123",
                full_name: "Juan P\xE9rez Garc\xEDa",
                tax_id: "1234567890",
                document_type: "CC",
                phone: "+573001234567",
                email: "juan@example.com",
                bank_code: "1007"
              },
              transfers_instruction: {
                account: "0000003100012389237485",
                type: "CVU",
                tax_id: "20123456783"
              }
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_complete: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z",
            image_url: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            legal_name: "Company Name Inc.",
            type: "individual",
            payment_method: "pix",
            sender_amount: 5240,
            receiver_amount: 1010,
            token: "USDC",
            partner_fee_amount: 150,
            total_fee_amount: 1.53,
            commercial_quotation: 495,
            blindpay_quotation: 505,
            currency: "BRL",
            billing_fee: 100,
            name: "Wallet Display Name",
            address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
            network: "polygon",
            blindpay_bank_details: {
              routing_number: "121145349",
              account_number: "621327727210181",
              account_type: "Business checking",
              swift_bic_code: "CHASUS33",
              ach: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              wire: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              rtp: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              beneficiary: {
                name: "BlindPay, Inc.",
                address_line_1: "8 The Green, #19364",
                address_line_2: "Dover, DE 19901"
              }
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayin), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.get("pi_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayin);
        }));
      });
      describe("Get payin track", () => {
        it("should get payin tracking information", () => __async(null, null, function* () {
          const mockedPayinTrack = {
            receiver_id: "re_000000000000",
            id: "re_000000000000",
            pix_code: "00020101021226790014br.gov.bcb.pix2557brcode.starkinfra.com/v2/bcf07f6c4110454e9fd6f120bab13e835204000053039865802BR5915Blind Pay, Inc.6010Vila Velha62070503***6304BCAB",
            memo_code: "8K45GHBNT6BQ6462",
            clabe: "014027000000000008",
            status: "processing",
            payin_quote_id: "pq_000000000000",
            instance_id: "in_000000000000",
            tracking_transaction: {
              step: "processing",
              status: "failed",
              external_id: "12345678",
              completed_at: "2011-10-05T14:48:00.000Z",
              sender_name: "John Doe Smith",
              sender_tax_id: "123.456.789-10",
              sender_bank_code: "00416968",
              sender_account_number: "1234567890",
              trace_number: "1234567890",
              transaction_reference: "1234567890",
              description: "Payment from John Doe Smith",
              pse_instruction: {
                payment_link: "https://pse.example.com/payment/abc123",
                fid: "fid_abc123",
                full_name: "Juan P\xE9rez Garc\xEDa",
                tax_id: "1234567890",
                document_type: "CC",
                phone: "+573001234567",
                email: "juan@example.com",
                bank_code: "1007"
              },
              transfers_instruction: {
                account: "0000003100012389237485",
                type: "CVU",
                tax_id: "20123456783"
              }
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_complete: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z",
            image_url: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            legal_name: "Company Name Inc.",
            type: "individual",
            payment_method: "pix",
            sender_amount: 5240,
            receiver_amount: 1010,
            token: "USDC",
            partner_fee_amount: 150,
            total_fee_amount: 1.53,
            commercial_quotation: 495,
            blindpay_quotation: 505,
            currency: "BRL",
            billing_fee: 100,
            name: "Wallet Display Name",
            address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
            network: "polygon",
            blindpay_bank_details: {
              routing_number: "121145349",
              account_number: "621327727210181",
              account_type: "Business checking",
              swift_bic_code: "CHASUS33",
              ach: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              wire: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              rtp: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              beneficiary: {
                name: "BlindPay, Inc.",
                address_line_1: "8 The Green, #19364",
                address_line_2: "Dover, DE 19901"
              }
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayinTrack), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.getTrack("pi_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayinTrack);
        }));
      });
      describe("Create EVM payin", () => {
        it("should create an EVM payin", () => __async(null, null, function* () {
          const mockedEvmPayin = {
            id: "pi_000000000000",
            status: "processing",
            pix_code: "00020101021226790014br.gov.bcb.pix2557brcode.starkinfra.com/v2/bcf07f6c4110454e9fd6f120bab13e835204000053039865802BR5915Blind Pay, Inc.6010Vila Velha62070503***6304BCAB",
            memo_code: "8K45GHBNT6BQ6462",
            clabe: "014027000000000008",
            tracking_complete: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_transaction: {
              step: "processing",
              status: "failed",
              external_id: "12345678",
              completed_at: "2011-10-05T14:48:00.000Z",
              sender_name: "John Doe Smith",
              sender_tax_id: "123.456.789-10",
              sender_bank_code: "00416968",
              sender_account_number: "1234567890",
              trace_number: "1234567890",
              transaction_reference: "1234567890",
              description: "Payment from John Doe Smith",
              pse_instruction: {
                payment_link: "https://pse.example.com/payment/abc123",
                fid: "fid_abc123",
                full_name: "Juan P\xE9rez Garc\xEDa",
                tax_id: "1234567890",
                document_type: "CC",
                phone: "+573001234567",
                email: "juan@example.com",
                bank_code: "1007"
              },
              transfers_instruction: {
                account: "0000003100012389237485",
                type: "CVU",
                tax_id: "20123456783"
              }
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            blindpay_bank_details: {
              routing_number: "121145349",
              account_number: "621327727210181",
              account_type: "Business checking",
              swift_bic_code: "CHASUS33",
              ach: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              wire: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              rtp: {
                routing_number: "123456789",
                account_number: "123456789"
              },
              beneficiary: {
                name: "BlindPay, Inc.",
                address_line_1: "8 The Green, #19364",
                address_line_2: "Dover, DE 19901"
              }
            },
            receiver_id: "re_000000000000",
            receiver_amount: 1010
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedEvmPayin), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.createEvm("pq_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedEvmPayin);
        }));
      });
    });
  }
});
export default require_payins_test();
