import { Base } from './base'; import { PaymentMethodResponse } from './types/payment-method'; export class PaymentMethod extends Base { private membershipApi = this.config.get('membershipApi'); private createTestPaymentMethodKey = this.config.get('createTestPaymentMethodKey'); /** * This function creates a test credit card payment method by accesses Zuora behind the tyk gateway * An api key is required with the policy "Create Payment Method TEST" * @returns Promise */ public async createTestPaymentMethod(): Promise { const url = `${this.membershipApi}/v1/payment-methods/`; const body = { cardType: 'Visa', cardNumber: '4242424242424242', expirationMonth: '01', expirationYear: '2050', type: 'CreditCard', cardHolderInfo: { cardHolderName: 'John Doe' } }; return this.requestPost({ url, key: this.createTestPaymentMethodKey, body }); } }