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

    Builds the CARD_TRANSACTION email payload for a card-transaction status change and hands it to the CustomerNotificationService core. Lives in girasol-card-services (next to the writer) so it can use the GirasolCardTransaction domain type; the writer calls notify right where it publishes the event + busts the cache, once per published customer.

    Relocated from the customer-dashboard sendCardTransactionNotification handler.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Notify the relevant recipients of a card-transaction status change for the given customer. Best-effort. customerId is the customer the event was published for — the writer publishes the same event for both the cardholder and the Girasol settlement customer, so notify is called once per customer. The card lookup is customer-scoped: for the Girasol settlement customer it returns null and we skip (those events are not notified).

      Parameters

      • __namedParameters: {
            customerId: string;
            transaction: {
                amount: BigNumber;
                clearing?: {
                    amountAdjusted: string;
                    amountCleared: string;
                    receipt?: { id: string; type: "SOLANA_TRANSACTION_SIGNATURE" };
                    type: "OVER_CLEARED" | "UNDER_CLEARED" | "MATCH";
                };
                createdAt: Date;
                currency: string;
                girasolTransactionId: string;
                id: string;
                merchant?: {
                    categoryCode?: string;
                    city?: string;
                    country?: string;
                    mcc: string;
                    name: string;
                };
                originalGirasolTransactionId: string
                | null;
                reason: string | null;
                receipt?: { id: string; type: "SOLANA_TRANSACTION_SIGNATURE" };
                status:
                    | "PENDING"
                    | "FAILED"
                    | "COMPLETED"
                    | "DECLINED"
                    | "CANCELLED"
                    | "AUTHORIZED"
                    | "CLEARED"
                    | "REVERSED";
                type: "authorization"
                | "notification"
                | "reversal";
                updatedAt: Date;
            } & { cardId: string };
        }

      Returns Promise<void>