@lomray/microservice-payment-stripe
Version:
Stripe payment microservice based on NodeJS & inverted json.
53 lines (52 loc) • 1.41 kB
TypeScript
import Customer from "./customer.js";
/**
* Card params
* @description
* 1. Card with paymentMethodId (from setupIntent) uses for CHARGING specific
* amount from user card without user manual approve
* 2. Card with the cardId it's related to user connect account card for
* ACCEPTING payments and money payout. Can't be used for money transfer
* 3. Card can be default for connect account and for charge
*/
interface IParams {
cardId?: string;
isApproved?: boolean;
setupIntentId?: string;
paymentMethodId?: string;
issuer?: string | null;
}
/**
* Card entity
* @description Stipe should store both cards from connect account and from SetupIntent
*/
declare class Card {
id: string;
userId: string;
/**
* Uses in client queries
*/
paymentMethodId: string | null;
fingerprint: string | null;
lastDigits: string;
expired: string;
/**
* @TODO: add converter for stripe funding enum to funding type
*/
funding: string;
brand: string;
origin: string | null;
country: string | null;
postalCode: string | null;
holderName: string | null;
isInstantPayoutAllowed: boolean;
params: IParams;
isDefault: boolean;
createdAt: Date;
updatedAt: Date;
/**
* Should be deleted cascade
* NOTE: Uses in integration tests
*/
customer: Customer;
}
export { Card as default, IParams };