-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
997eca9
commit 4e53cb2
Showing
1 changed file
with
14 additions
and
99 deletions.
There are no files selected for viewing
113 changes: 14 additions & 99 deletions
113
packages/ui-extensions/src/surfaces/point-of-sale/types/payment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |