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.

112 lines (108 loc) 7.44 kB
/** * AdvancedBilling * * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { expandoObject, nullable, number, optional, Schema, string, } from '../schema'; import { AllVaults, allVaultsSchema } from './allVaults'; import { CardType, cardTypeSchema } from './cardType'; import { PaymentProfileAttributesExpirationMonth, paymentProfileAttributesExpirationMonthSchema, } from './containers/paymentProfileAttributesExpirationMonth'; import { PaymentProfileAttributesExpirationYear, paymentProfileAttributesExpirationYearSchema, } from './containers/paymentProfileAttributesExpirationYear'; import { PaymentType, paymentTypeSchema } from './paymentType'; /** alias to credit_card_attributes */ export interface PaymentProfileAttributes { /** (Optional) Token received after sending billing information using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) */ chargifyToken?: string; id?: number; paymentType?: PaymentType; /** (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. */ firstName?: string; /** (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. */ lastName?: string; maskedCardNumber?: string; /** The full credit card number (string representation, i.e. 5424000000000015) */ fullNumber?: string; /** (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. */ cardType?: CardType; /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 */ expirationMonth?: PaymentProfileAttributesExpirationMonth; /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 */ expirationYear?: PaymentProfileAttributesExpirationYear; /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. */ billingAddress?: string; /** (Optional) Second line of the customer’s billing address i.e. Apt. 100 */ billingAddress2?: string | null; /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. */ billingCity?: string; /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ billingState?: string; /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ billingCountry?: string; /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. */ billingZip?: string; /** (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. */ currentVault?: AllVaults; /** (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile */ vaultToken?: string; /** (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token */ customerVaultToken?: string; customerId?: number; paypalEmail?: string; /** (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) */ paymentMethodNonce?: string; /** (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. */ gatewayHandle?: string; /** (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. */ cvv?: string; /** (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. */ lastFour?: string; [key: string]: unknown; } export const paymentProfileAttributesSchema: Schema<PaymentProfileAttributes> = expandoObject( { chargifyToken: ['chargify_token', optional(string())], id: ['id', optional(number())], paymentType: ['payment_type', optional(paymentTypeSchema)], firstName: ['first_name', optional(string())], lastName: ['last_name', optional(string())], maskedCardNumber: ['masked_card_number', optional(string())], fullNumber: ['full_number', optional(string())], cardType: ['card_type', optional(cardTypeSchema)], expirationMonth: [ 'expiration_month', optional(paymentProfileAttributesExpirationMonthSchema), ], expirationYear: [ 'expiration_year', optional(paymentProfileAttributesExpirationYearSchema), ], billingAddress: ['billing_address', optional(string())], billingAddress2: ['billing_address_2', optional(nullable(string()))], billingCity: ['billing_city', optional(string())], billingState: ['billing_state', optional(string())], billingCountry: ['billing_country', optional(string())], billingZip: ['billing_zip', optional(string())], currentVault: ['current_vault', optional(allVaultsSchema)], vaultToken: ['vault_token', optional(string())], customerVaultToken: ['customer_vault_token', optional(string())], customerId: ['customer_id', optional(number())], paypalEmail: ['paypal_email', optional(string())], paymentMethodNonce: ['payment_method_nonce', optional(string())], gatewayHandle: ['gateway_handle', optional(string())], cvv: ['cvv', optional(string())], lastFour: ['last_four', optional(string())], } );