/* * Copyright (C) 2023 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { Payment } from './Payment' import { Telephone } from './Telephone' import { TelephoneMapper } from './TelephoneMapper' import { JsonObject, JsonProperty } from 'typescript-json-serializer' import { PaymentProperties } from './Payment' @JsonObject({ constructorParams: [{}] }) export class DirectDebit extends Payment { /** * A code that identifies the financial institution for a specific bank account. `routing_number` is required if given `INTER_COMPANY` or `ELV` as `brand`. */ @JsonProperty({ name: 'routing_number' }) routingNumber?: string /** * Cleartext (unencrypted) DirectDebit bank account number associated with the payment instrument. */ @JsonProperty({ name: 'account_number' }) accountNumber: string /** * The `mandate_type` is required if given `brand` as `SEPA_ELV` under `DirectDebit`. It is used for the wire transfer or direct debit transaction whose `routing_number` could not be provided or not supported. Allows values: - `ONE_OFF` - `RECURRING` */ @JsonProperty({ name: 'mandate_type' }) mandateType?: DirectDebitMandateTypeEnum /** * Telephone(s) associated with direct debit payment provider. */ @JsonProperty({ name: 'telephones', type: (property) => TelephoneMapper.getType(property), }) telephones: Array @JsonProperty('method') readonly method = 'DIRECT_DEBIT' public constructor(directDebit: DirectDebitProperties) { super({ brand: directDebit.brand, reason: directDebit.reason, billingName: directDebit.billingName, billingAddress: directDebit.billingAddress, billingEmailAddress: directDebit.billingEmailAddress, authorizedAmount: directDebit.authorizedAmount, verifiedAmount: directDebit.verifiedAmount, threeDigitsSecureCriteria: directDebit.threeDigitsSecureCriteria, operations: directDebit.operations, extensions: directDebit.extensions, }) this.routingNumber = directDebit.routingNumber this.accountNumber = directDebit.accountNumber this.mandateType = directDebit.mandateType this.telephones = directDebit.telephones } } export type DirectDebitMandateTypeEnum = 'ONE_OFF' | 'RECURRING' export interface DirectDebitProperties extends PaymentProperties { routingNumber?: string accountNumber: string mandateType?: DirectDebitMandateTypeEnum telephones: Array }