@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.
66 lines • 2.77 kB
JavaScript
/**
* AdvancedBilling
*
* This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
import { anyOf, validateAndMap } from '../../schema';
import { applePayPaymentProfileSchema, } from '../applePayPaymentProfile';
import { bankAccountPaymentProfileSchema, } from '../bankAccountPaymentProfile';
import { creditCardPaymentProfileSchema, } from '../creditCardPaymentProfile';
import { paypalPaymentProfileSchema, } from '../paypalPaymentProfile';
const discriminatorMap = {
'apple_pay': applePayPaymentProfileSchema,
'bank_account': bankAccountPaymentProfileSchema,
'credit_card': creditCardPaymentProfileSchema,
'paypal_account': paypalPaymentProfileSchema,
};
export const paymentProfileSchema = anyOf([
applePayPaymentProfileSchema,
bankAccountPaymentProfileSchema,
creditCardPaymentProfileSchema,
paypalPaymentProfileSchema,
], discriminatorMap, 'paymentType');
export var PaymentProfile;
(function (PaymentProfile) {
/**
* Validation method to narrow down union type to ApplePayPaymentProfile type case.
*
* This is ApplePay Payment Profile case.
*/
function isApplePayPaymentProfile(value) {
const validationResult = validateAndMap(value, 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) {
const validationResult = validateAndMap(value, 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) {
const validationResult = validateAndMap(value, 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) {
const validationResult = validateAndMap(value, paypalPaymentProfileSchema);
return validationResult.errors === false;
}
PaymentProfile.isPaypalPaymentProfile = isPaypalPaymentProfile;
})(PaymentProfile || (PaymentProfile = {}));
//# sourceMappingURL=paymentProfile.js.map