UNPKG

cybersource-rest-client-typescript

Version:
142 lines (122 loc) 5.6 kB
/** * CyberSource Merged Spec * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html * * OpenAPI spec version: 0.0.1 * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.3.0 * * Do not edit the class manually. * */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient', 'model/InvoiceSettingsRequest', 'model/InvoicingV2InvoiceSettingsGet200Response', 'model/InvoicingV2InvoicesAllGet400Response', 'model/InvoicingV2InvoicesAllGet502Response'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('../model/InvoiceSettingsRequest'), require('../model/InvoicingV2InvoiceSettingsGet200Response'), require('../model/InvoicingV2InvoicesAllGet400Response'), require('../model/InvoicingV2InvoicesAllGet502Response')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.InvoiceSettingsApi = factory(root.CyberSource.ApiClient, root.CyberSource.InvoiceSettingsRequest, root.CyberSource.InvoicingV2InvoiceSettingsGet200Response, root.CyberSource.InvoicingV2InvoicesAllGet400Response, root.CyberSource.InvoicingV2InvoicesAllGet502Response); } }(this, function(ApiClient, InvoiceSettingsRequest, InvoicingV2InvoiceSettingsGet200Response, InvoicingV2InvoicesAllGet400Response, InvoicingV2InvoicesAllGet502Response) { 'use strict'; /** * InvoiceSettings service. * @module api/InvoiceSettingsApi * @version 0.0.1 */ /** * Constructs a new InvoiceSettingsApi. * @alias module:api/InvoiceSettingsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ var exports = function(configObject, apiClient) { this.apiClient = apiClient || ApiClient.instance; this.apiClient.setConfiguration(configObject); /** * Callback function to receive the result of the getInvoiceSettings operation. * @callback module:api/InvoiceSettingsApi~getInvoiceSettingsCallback * @param {String} error Error message, if any. * @param {module:model/InvoicingV2InvoiceSettingsGet200Response} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Invoice Settings * Get the invoice settings for the invoice payment page. * @param {module:api/InvoiceSettingsApi~getInvoiceSettingsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InvoicingV2InvoiceSettingsGet200Response} */ this.getInvoiceSettings = function(callback) { var postBody = null; if ('GET' == 'POST') { postBody = '{}'; } var pathParams = { }; var queryParams = { }; var headerParams = { }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = InvoicingV2InvoiceSettingsGet200Response; return this.apiClient.callApi( '/invoicing/v2/invoiceSettings', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the updateInvoiceSettings operation. * @callback module:api/InvoiceSettingsApi~updateInvoiceSettingsCallback * @param {String} error Error message, if any. * @param {module:model/InvoicingV2InvoiceSettingsGet200Response} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Update Invoice Settings * Update invoice settings for the invoice payment page. * @param {module:model/InvoiceSettingsRequest} invoiceSettingsRequest * @param {module:api/InvoiceSettingsApi~updateInvoiceSettingsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/InvoicingV2InvoiceSettingsGet200Response} */ this.updateInvoiceSettings = function(invoiceSettingsRequest, callback) { var postBody = invoiceSettingsRequest; // verify the required parameter 'invoiceSettingsRequest' is set if (invoiceSettingsRequest === undefined || invoiceSettingsRequest === null) { throw new Error("Missing the required parameter 'invoiceSettingsRequest' when calling updateInvoiceSettings"); } var pathParams = { }; var queryParams = { }; var headerParams = { }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/json;charset=utf-8']; var returnType = InvoicingV2InvoiceSettingsGet200Response; return this.apiClient.callApi( '/invoicing/v2/invoiceSettings', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } }; return exports; }));