import { BNPLInfo, Offer, PRODUCT_TYPE, UserProfile } from "credify-web-sdk" import { UserInfo } from "../../../src" export interface OrderLine { name: string reference_id: string image_url: string category: string product_url: string quantity: number unit_price: TotalAmount subtotal: TotalAmount measurement_unit: string } export interface TotalAmount { value: string currency: string } export interface PaymentRecipient { type: string; bank_account?: PaymentRecipientDetail } export interface PaymentRecipientDetail { name: string number: string branch: string bank: string } export interface OfferType { reference_id: string total_amount: TotalAmount order_lines: OrderLine[] payment_recipient: PaymentRecipient user_id: string is_business: boolean; } export interface LodgeRequest { type: "BNPL" | "OFFER" bnpl_order?: { reference_id: string total_amount: TotalAmount order_lines: OrderLine[] payment_recipient: PaymentRecipient is_business: boolean } offer?: { // Offer code to redeem. Required if not specified a product. offer_code?: string, // Product code to redeem. Must be empty if specified an offer code. product_code?: string, } user: UserInfo, service?: { available_provider_ids?: string[], available_product_codes?: string[], available_offer_codes?: string[], product_code?: string, offer_code?: string, package_code?: string, ui?: { theme?: any, locale?: string } } } export type CURRENCY = "VND" | "USD" | "JPY" export const REG_CURRENCY_VND = { THOUSAND_SEPARATOR: /\B(?=(\d{3})+(?!\d))/g, DETECT_DOT: /\$\s?|(\.*)/g, } export interface UnitPrice { value: string currency: string } export interface Subtotal { value: string currency: string } export interface CreateOfferResponse { id: string referenceId: string totalAmount: TotalAmount orderLines: OrderLine[] paymentRecipient: PaymentRecipient orderStatus: string bnplAccountNumber: string } export interface Category { id: string name: string } export interface Provider { appUrl: string categories: Category[] description: string id: string logoUrl: string name: string scopes: string[] } export interface GetOffersRequest { localId: string phoneNumber?: string countryCode?: string credifyId?: string productTypes?: PRODUCT_TYPE[] } export interface GetOfferResponse { success: boolean data?: { offers: Offer[] credifyId?: string } } export interface GetBnplInfoRequest { localId: string phoneNumber?: string countryCode?: string credifyId?: string productTypes?: string[] } export interface GetBnplInfoResponse { success: boolean data: BNPLInfo } export interface WindowSize { width: number height: number top: number left: number systemZoom: number }