Methods
Static createDocumentLink
- createDocumentLink(orderId: string | number, storefrontUrl: string, orderKey: string): string
Parameters
orderId: string | number
storefrontUrl: string
orderKey: string
Returns string
Static Private getCurrencyRateFromStripeMetaData
- getCurrencyRateFromStripeMetaData(stripeFee: string | number, stripeNet: string | number, total: number): number
Parameters
stripeFee: string | number
stripeNet: string | number
total: number
Returns number
Static getDocumentSource
- getDocumentSource(order: WcOrder): null | string
Parameters
Returns null | string
Static getFilteredMetaDataByKeys
Static getInvoiceReference
- getInvoiceReference(order: WcOrder): undefined | string
Parameters
Returns undefined | string
Static getMetaDataValueByKey
Parameters
Returns undefined | string
Static getPaymentDate
- getPaymentDate(order: WcOrder): string
Static getRefunds
- getRefunds(order: WcOrder): undefined | RefundElement[] | Refund[]
Parameters
Returns undefined | RefundElement[] | Refund[]
Static getShippingTax
- getShippingTax(order: WcOrder): number
Static getShippingTotal
- getShippingTotal(order: WcOrder): number
Static getStorefrontPrefix
- getStorefrontPrefix(order: WcOrder): undefined | string
Parameters
Returns undefined | string
Static getStorefrontUrl
- getStorefrontUrl(order: WcOrder): undefined | string
Parameters
Returns undefined | string
Static hasGiftCardsRedeem
- hasGiftCardsRedeem(order: WcOrder): boolean
Parameters
Returns boolean
Static hasInvoiceReference
- hasInvoiceReference(order: WcOrder): boolean
Parameters
Returns boolean
Static hasPaymentFee
- hasPaymentFee(order: WcOrder, paymentMethod: string): boolean
Parameters
Returns boolean
Static hasPaymentMethod
- hasPaymentMethod(order: WcOrder): boolean
Parameters
Returns boolean
Static isPartiallyRefunded
- isPartiallyRefunded(order: WcOrder): boolean
Parameters
Returns boolean
Static tryCanBeRefunded
- tryCanBeRefunded(order: WcOrder): boolean
Parameters
Returns boolean
Static tryCreatePaymentFeeExpense
- tryCreatePaymentFeeExpense(order: WcOrder, currencyRate: number, paymentMethod: "PayPal" | "Stripe"): Expense
Parameters
currencyRate: number
paymentMethod: "PayPal" | "Stripe"
Static tryGetAccurateTotal
- tryGetAccurateTotal(order: WcOrder, epsilon?: number): number
Parameters
epsilon: number = 0.000_000_000_000_1
Returns number
Static tryGetBillingName
- tryGetBillingName(order: WcOrder): string
Static tryGetCurrency
- tryGetCurrency(order: WcOrder): "SEK" | "EUR" | "USD"
Parameters
Returns "SEK" | "EUR" | "USD"
Static tryGetCurrencyRate
- tryGetCurrencyRate(order: WcOrder, stripeFee: string | number, stripeNet: string | number, accurateTotal?: number): number
Parameters
stripeFee: string | number
stripeNet: string | number
Optional accurateTotal: number
Returns number
Static tryGetCustomerAddresses
Static tryGetCustomerEmail
- tryGetCustomerEmail(order: WcOrder): string
Static tryGetCustomerName
- tryGetCustomerName(order: WcOrder): string
Static tryGetDeliveryName
- tryGetDeliveryName(order: WcOrder): string
Static tryGetDocumentLink
- tryGetDocumentLink(order: WcOrder, storefrontUrl?: string): string
Parameters
Optional storefrontUrl: string
Returns string
Static tryGetGiftCardsPurchases
- tryGetGiftCardsPurchases(order: WcOrder): { amountCurrency: number; containsOnlyGiftCards: boolean; giftCards: WcOrderLineItem[]; hasGiftCards: boolean }
Parameters
Returns { amountCurrency: number; containsOnlyGiftCards: boolean; giftCards: WcOrderLineItem[]; hasGiftCards: boolean }
amountCurrency: number
containsOnlyGiftCards: boolean
hasGiftCards: boolean
Static tryGetInvoiceReference
- tryGetInvoiceReference(order: WcOrder): number
Static tryGetPaymentFee
- tryGetPaymentFee(order: WcOrder, paymentMethod: string): number
Static tryGetPaymentMethod
Static tryGetTaxRateLabels
Static tryVerifyCurrencyRate
- tryVerifyCurrencyRate(order: WcOrder, currencyRate: number): undefined | number
Parameters
Returns undefined | number
Static tryVerifyOrder
- tryVerifyOrder(order: WcOrder): void
Static tryVerifyStripePayout
WcOrders