@cfxlabsinc/b2b-services
    Preparing search index...

    Hierarchy

    • GirasolCardService
      • GirasolPhysicalCardService
    Index

    Constructors

    Properties

    dbHelper: DbHelper
    girasolCardQueryService: GirasolCardQueryService
    girasolClient: GirasolClient

    Methods

    • Parameters

      • input: Input

      Returns Promise<
          | {
              error: | ServiceError<"INVALID_ENTITY">
              | ServiceError<"ENTITY_NOT_FOUND">
              | ServiceError<"CARD_ACCOUNT_NOT_FOUND" | "CARD_ACCOUNT_NOT_ACTIVE">;
              ok: false;
          }
          | {
              ok: true;
              value: {
                  createdAt: Date;
                  displayName: string;
                  expiryMonth?: string;
                  expiryYear?: string;
                  firstName: string;
                  girasolCardId: string;
                  id: string;
                  lastFourDigits?: string;
                  lastName: string;
                  phone: string;
                  shippingAddress?: {
                      city: string;
                      countryCode: string;
                      line1: string;
                      line2?: string;
                      postalCode: string;
                      region?: string;
                  };
                  status: GirasolCardStatus;
                  type: "VIRTUAL"
                  | "PHYSICAL";
                  updatedAt: Date;
              };
          },
      >

    • Fetches the active Girasol card account for the customer.

      Parameters

      • __namedParameters: { customerId: string }

      Returns Promise<
          | {
              ok: true;
              value: {
                  girasolAccountNumber: string;
                  id: number;
                  status: "ACTIVE"
                  | "DELETED"
                  | "INACTIVE"
                  | "UNKNOWN";
              };
          }
          | { error: ServiceError; ok: false },
      >

    • Returns auth token to fetch the card's data from Girasol. Consumer must implement their own logic to fetch the card data from Girasol using the token.

      Parameters

      • customerId: { customerId: string; id: string }

        The ID of the customer.

      Returns Promise<
          | { ok: true; value: { girasolCardId: string; token: string } }
          | { error: ServiceError; ok: false },
      >

      A promise that resolves to the auth token and Girasol card ID.