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.

69 lines 3.23 kB
"use strict"; /** * AdvancedBilling * * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ exports.__esModule = true; exports.PaymentProfile = exports.paymentProfileSchema = void 0; var schema_1 = require("../../schema"); var applePayPaymentProfile_1 = require("../applePayPaymentProfile"); var bankAccountPaymentProfile_1 = require("../bankAccountPaymentProfile"); var creditCardPaymentProfile_1 = require("../creditCardPaymentProfile"); var paypalPaymentProfile_1 = require("../paypalPaymentProfile"); var discriminatorMap = { 'apple_pay': applePayPaymentProfile_1.applePayPaymentProfileSchema, 'bank_account': bankAccountPaymentProfile_1.bankAccountPaymentProfileSchema, 'credit_card': creditCardPaymentProfile_1.creditCardPaymentProfileSchema, 'paypal_account': paypalPaymentProfile_1.paypalPaymentProfileSchema }; exports.paymentProfileSchema = (0, schema_1.anyOf)([ applePayPaymentProfile_1.applePayPaymentProfileSchema, bankAccountPaymentProfile_1.bankAccountPaymentProfileSchema, creditCardPaymentProfile_1.creditCardPaymentProfileSchema, paypalPaymentProfile_1.paypalPaymentProfileSchema, ], discriminatorMap, 'paymentType'); var PaymentProfile; (function (PaymentProfile) { /** * Validation method to narrow down union type to ApplePayPaymentProfile type case. * * This is ApplePay Payment Profile case. */ function isApplePayPaymentProfile(value) { var validationResult = (0, schema_1.validateAndMap)(value, applePayPaymentProfile_1.applePayPaymentProfileSchema); return validationResult.errors === false; } PaymentProfile.isApplePayPaymentProfile = isApplePayPaymentProfile; /** * Validation method to narrow down union type to BankAccountPaymentProfile type case. * * This is Bank Account Payment Profile case. */ function isBankAccountPaymentProfile(value) { var validationResult = (0, schema_1.validateAndMap)(value, bankAccountPaymentProfile_1.bankAccountPaymentProfileSchema); return validationResult.errors === false; } PaymentProfile.isBankAccountPaymentProfile = isBankAccountPaymentProfile; /** * Validation method to narrow down union type to CreditCardPaymentProfile type case. * * This is Credit Card Payment Profile case. */ function isCreditCardPaymentProfile(value) { var validationResult = (0, schema_1.validateAndMap)(value, creditCardPaymentProfile_1.creditCardPaymentProfileSchema); return validationResult.errors === false; } PaymentProfile.isCreditCardPaymentProfile = isCreditCardPaymentProfile; /** * Validation method to narrow down union type to PaypalPaymentProfile type case. * * This is Paypal Payment Profile case. */ function isPaypalPaymentProfile(value) { var validationResult = (0, schema_1.validateAndMap)(value, paypalPaymentProfile_1.paypalPaymentProfileSchema); return validationResult.errors === false; } PaymentProfile.isPaypalPaymentProfile = isPaypalPaymentProfile; })(PaymentProfile = exports.PaymentProfile || (exports.PaymentProfile = {})); //# sourceMappingURL=paymentProfile.js.map