import { Base } from './base'; export class Zuora extends Base { private zuoraApi = this.config.get('zuoraApi'); /** * This function is the public method for creating a Zuora payment reference. * * Note, this calls the Zuora api directly, and should be avoided. The preferred method * for making test user payment methods is using the payment-methodSDK.createTestPaymentMethod() */ public async createPaymentMethod(): Promise<{success: boolean, id: string}> { const url = `${this.zuoraApi}/v1/payment-methods`; const accessKeyId = this.config.get('zuoraAccessKeyId'); const accessKeySecret = this.config.get('zuoraAccessKeySecret'); const headers = { apiAccessKeyId: accessKeyId, apiSecretAccessKey: accessKeySecret }; const body = { cardType: 'Visa', cardNumber: '4242424242424242', expirationMonth: '01', expirationYear: '2050', type: 'CreditCard', cardHolderInfo: { cardHolderName: 'John Doe' } }; return this.requestPost({ url, additionalHeaders: headers, body }); } }