diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/types/payment.ts b/packages/ui-extensions/src/surfaces/point-of-sale/types/payment.ts index 89e2ba11e..be0d6e5d6 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/types/payment.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/types/payment.ts @@ -1,100 +1,15 @@ -export type PaymentMethod = - | CashPayment - | CustomPayment - | CreditCardPayment - | CardPresentRefund - | StripeCardPresentRefund - | GiftCardPayment - | StripeCreditCardPayment - | ShopPay - | UnknownPayment; - -export interface BasePayment { - amount: string; +export type PaymentMethodType = + | 'Cash' + | 'Custom' + | 'CreditCard' + | 'CardPresentRefund' + | 'StripeCardPresentRefund' + | 'GiftCard' + | 'StripeCreditCard' + | 'ShopPay' + | 'Unknown'; +export interface PaymentMethod { + amount: number; + currency: string; + type: PaymentMethodType; } - -interface CashPayment extends BasePayment { - type: 'Cash'; - amountIn: string; - roundedAmount?: string; -} - -interface CustomPayment extends BasePayment { - type: 'Custom'; - name: string; -} - -interface Customer extends BasePayment { - id: string; -} - -export interface CreditCardPayment extends BasePayment { - type: 'CreditCard'; - brand: string; - lastDigits: string; - customer?: Customer; - isSignatureRequired: boolean; - checkAmountToSkipSignature: boolean; - vaultedCardSessionId?: string; - cardSource?: CardSource; - receipt?: Receipt; -} -interface Receipt { - metadata?: Metadata; - authorizationCode?: string; - emvReceiptDetails?: EmvReceiptDetails; -} - -interface Metadata { - shopId?: string; - cardReadMethod?: string; - cardSource?: string; -} - -interface EmvReceiptDetails { - applicationIdentifierAidTerminal: string; - terminalIdentification: string; - applicationLabel?: string; - terminalVerificationResults: string; - transactionStatusInformation: string; - issuerApplicationData: string; - verificationMethod: string; - authorisationResponseCode?: string; - interacAccountType?: string; - applicationPreferredName?: string; -} -interface CardPresentRefund extends BasePayment { - type: 'CardPresentRefund'; - lastDigits: string; - vaultedCardSessionId?: string; - cardSource?: CardSource; -} - -interface StripeCardPresentRefund extends BasePayment { - type: 'StripeCardPresentRefund'; - refundId: string; - cardSource?: string; -} - -interface StripeCreditCardPayment extends BasePayment { - type: 'StripeCreditCard'; - brand: string; - lastDigits: string; -} - -interface GiftCardPayment extends BasePayment { - type: 'GiftCard'; - lastCharacters: string; - giftCardId: string; - balance?: string; -} - -interface ShopPay extends BasePayment { - type: 'ShopPay'; - isInstallmentsPayment: boolean; -} - -interface UnknownPayment extends BasePayment { - type: 'Unknown'; -} -export type CardSource = 'manual' | 'swiped' | 'emv';