UNPKG

@maxio-com/advanced-billing-sdk

Version:

Ultimate billing and pricing flexibility for B2B SaaS. Maxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments.

79 lines 3.35 kB
/** * AdvancedBilling * * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { anyOf, validateAndMap } from '../../schema'; import { paymentMethodApplePaySchema, } from '../paymentMethodApplePay'; import { paymentMethodBankAccountSchema, } from '../paymentMethodBankAccount'; import { paymentMethodCreditCardSchema, } from '../paymentMethodCreditCard'; import { paymentMethodExternalSchema, } from '../paymentMethodExternal'; import { paymentMethodPaypalSchema, } from '../paymentMethodPaypal'; const discriminatorMap = { 'apple_pay': paymentMethodApplePaySchema, 'bank_account': paymentMethodBankAccountSchema, 'credit_card': paymentMethodCreditCardSchema, 'external': paymentMethodExternalSchema, 'paypal_account': paymentMethodPaypalSchema, }; export const invoiceEventPaymentSchema = anyOf([ paymentMethodApplePaySchema, paymentMethodBankAccountSchema, paymentMethodCreditCardSchema, paymentMethodExternalSchema, paymentMethodPaypalSchema, ], discriminatorMap, 'type'); export var InvoiceEventPayment; (function (InvoiceEventPayment) { /** * Validation method to narrow down union type to PaymentMethodApplePay type case. * * This is Payment Method Apple Pay case. */ function isPaymentMethodApplePay(value) { const validationResult = validateAndMap(value, paymentMethodApplePaySchema); return validationResult.errors === false; } InvoiceEventPayment.isPaymentMethodApplePay = isPaymentMethodApplePay; /** * Validation method to narrow down union type to PaymentMethodBankAccount type case. * * This is Payment Method Bank Account case. */ function isPaymentMethodBankAccount(value) { const validationResult = validateAndMap(value, paymentMethodBankAccountSchema); return validationResult.errors === false; } InvoiceEventPayment.isPaymentMethodBankAccount = isPaymentMethodBankAccount; /** * Validation method to narrow down union type to PaymentMethodCreditCard type case. * * This is Payment Method Credit Card case. */ function isPaymentMethodCreditCard(value) { const validationResult = validateAndMap(value, paymentMethodCreditCardSchema); return validationResult.errors === false; } InvoiceEventPayment.isPaymentMethodCreditCard = isPaymentMethodCreditCard; /** * Validation method to narrow down union type to PaymentMethodExternal type case. * * This is Payment Method External case. */ function isPaymentMethodExternal(value) { const validationResult = validateAndMap(value, paymentMethodExternalSchema); return validationResult.errors === false; } InvoiceEventPayment.isPaymentMethodExternal = isPaymentMethodExternal; /** * Validation method to narrow down union type to PaymentMethodPaypal type case. * * This is Payment Method Paypal case. */ function isPaymentMethodPaypal(value) { const validationResult = validateAndMap(value, paymentMethodPaypalSchema); return validationResult.errors === false; } InvoiceEventPayment.isPaymentMethodPaypal = isPaymentMethodPaypal; })(InvoiceEventPayment || (InvoiceEventPayment = {})); //# sourceMappingURL=invoiceEventPayment.js.map