wallee
Version:
TypeScript/JavaScript client for wallee
606 lines (583 loc) • 35.4 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Wallee AG TypeScript SDK
*
* This library allows to interact with the Wallee AG payment service.
*
* Copyright owner: Wallee AG
* Website: https://en.wallee.com
* Developer email: ecosystem-team@wallee.com
*
* 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.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentWebAppsService = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
const ServiceApiUtils_1 = require("../utils/ServiceApiUtils");
/**
*
*/
class PaymentWebAppsService extends runtime.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* Permanently deletes a connector. It cannot be undone.
* Delete a connector
*/
deletePaymentWebAppsConnectorsConnectorExternalIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['connectorExternalId'] == null) {
throw new runtime.RequiredError('connectorExternalId', 'Required parameter "connectorExternalId" was null or undefined when calling deletePaymentWebAppsConnectorsConnectorExternalId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deletePaymentWebAppsConnectorsConnectorExternalId().');
}
const queryParameters = {};
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'DELETE';
const path = `/payment/web-apps/connectors/{connectorExternalId}`.replace(`{${"connectorExternalId"}}`, encodeURIComponent(String(requestParameters['connectorExternalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/connectors/{connectorExternalId}`.replace(`{${"connectorExternalId"}}`, encodeURIComponent(String(requestParameters['connectorExternalId']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Permanently deletes a connector. It cannot be undone.
* Delete a connector
*/
deletePaymentWebAppsConnectorsConnectorExternalId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.deletePaymentWebAppsConnectorsConnectorExternalIdRaw(requestParameters, initOverrides);
});
}
/**
* Permanently deletes a processor. It cannot be undone.
* Delete a processor
*/
deletePaymentWebAppsProcessorsExternalIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['externalId'] == null) {
throw new runtime.RequiredError('externalId', 'Required parameter "externalId" was null or undefined when calling deletePaymentWebAppsProcessorsExternalId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deletePaymentWebAppsProcessorsExternalId().');
}
const queryParameters = {};
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'DELETE';
const path = `/payment/web-apps/processors/{externalId}`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/processors/{externalId}`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.VoidApiResponse(response);
});
}
/**
* Permanently deletes a processor. It cannot be undone.
* Delete a processor
*/
deletePaymentWebAppsProcessorsExternalId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
yield this.deletePaymentWebAppsProcessorsExternalIdRaw(requestParameters, initOverrides);
});
}
/**
* Updates the state of a charge attempt for transactions created with a processor linked to the invoking web app, returning the specified charge attempt.
* Update a charge attempt
*/
patchPaymentWebAppsChargeAttemptsIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchPaymentWebAppsChargeAttemptsId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsChargeAttemptsId().');
}
if (requestParameters['paymentAppChargeAttemptUpdate'] == null) {
throw new runtime.RequiredError('paymentAppChargeAttemptUpdate', 'Required parameter "paymentAppChargeAttemptUpdate" was null or undefined when calling patchPaymentWebAppsChargeAttemptsId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/charge-attempts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/charge-attempts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppChargeAttemptUpdateToJSON)(requestParameters['paymentAppChargeAttemptUpdate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChargeAttemptFromJSON)(jsonValue));
});
}
/**
* Updates the state of a charge attempt for transactions created with a processor linked to the invoking web app, returning the specified charge attempt.
* Update a charge attempt
*/
patchPaymentWebAppsChargeAttemptsId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsChargeAttemptsIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Updates the state of a completion for transactions created with a processor linked to the invoking web app, returning the specified completion.
* Update a completion
*/
patchPaymentWebAppsCompletionsIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchPaymentWebAppsCompletionsId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsCompletionsId().');
}
if (requestParameters['paymentAppCompletionUpdate'] == null) {
throw new runtime.RequiredError('paymentAppCompletionUpdate', 'Required parameter "paymentAppCompletionUpdate" was null or undefined when calling patchPaymentWebAppsCompletionsId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/completions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/completions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppCompletionUpdateToJSON)(requestParameters['paymentAppCompletionUpdate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TransactionCompletionFromJSON)(jsonValue));
});
}
/**
* Updates the state of a completion for transactions created with a processor linked to the invoking web app, returning the specified completion.
* Update a completion
*/
patchPaymentWebAppsCompletionsId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsCompletionsIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Update a connector
*/
patchPaymentWebAppsConnectorsConnectorExternalIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['connectorExternalId'] == null) {
throw new runtime.RequiredError('connectorExternalId', 'Required parameter "connectorExternalId" was null or undefined when calling patchPaymentWebAppsConnectorsConnectorExternalId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsConnectorsConnectorExternalId().');
}
if (requestParameters['paymentAppConnectorDetails'] == null) {
throw new runtime.RequiredError('paymentAppConnectorDetails', 'Required parameter "paymentAppConnectorDetails" was null or undefined when calling patchPaymentWebAppsConnectorsConnectorExternalId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/connectors/{connectorExternalId}`.replace(`{${"connectorExternalId"}}`, encodeURIComponent(String(requestParameters['connectorExternalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/connectors/{connectorExternalId}`.replace(`{${"connectorExternalId"}}`, encodeURIComponent(String(requestParameters['connectorExternalId']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppConnectorDetailsToJSON)(requestParameters['paymentAppConnectorDetails']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentAppConnectorFromJSON)(jsonValue));
});
}
/**
* Update a connector
*/
patchPaymentWebAppsConnectorsConnectorExternalId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsConnectorsConnectorExternalIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Update a processor
*/
patchPaymentWebAppsProcessorsExternalIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['externalId'] == null) {
throw new runtime.RequiredError('externalId', 'Required parameter "externalId" was null or undefined when calling patchPaymentWebAppsProcessorsExternalId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsProcessorsExternalId().');
}
if (requestParameters['paymentAppProcessorDetails'] == null) {
throw new runtime.RequiredError('paymentAppProcessorDetails', 'Required parameter "paymentAppProcessorDetails" was null or undefined when calling patchPaymentWebAppsProcessorsExternalId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/processors/{externalId}`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/processors/{externalId}`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppProcessorDetailsToJSON)(requestParameters['paymentAppProcessorDetails']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentAppProcessorFromJSON)(jsonValue));
});
}
/**
* Update a processor
*/
patchPaymentWebAppsProcessorsExternalId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsProcessorsExternalIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Updates the state of a refund for transactions created with a processor linked to the invoking web app, returning the specified refund.
* Update a refund
*/
patchPaymentWebAppsRefundsIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchPaymentWebAppsRefundsId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsRefundsId().');
}
if (requestParameters['paymentAppRefundUpdate'] == null) {
throw new runtime.RequiredError('paymentAppRefundUpdate', 'Required parameter "paymentAppRefundUpdate" was null or undefined when calling patchPaymentWebAppsRefundsId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/refunds/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/refunds/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppRefundUpdateToJSON)(requestParameters['paymentAppRefundUpdate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.RefundFromJSON)(jsonValue));
});
}
/**
* Updates the state of a refund for transactions created with a processor linked to the invoking web app, returning the specified refund.
* Update a refund
*/
patchPaymentWebAppsRefundsId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsRefundsIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Updates the state of a void for transactions created with a processor linked to the invoking web app, returning the specified void.
* Update a void
*/
patchPaymentWebAppsVoidsIdRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchPaymentWebAppsVoidsId().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentWebAppsVoidsId().');
}
if (requestParameters['paymentAppVoidUpdate'] == null) {
throw new runtime.RequiredError('paymentAppVoidUpdate', 'Required parameter "paymentAppVoidUpdate" was null or undefined when calling patchPaymentWebAppsVoidsId().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'PATCH';
const path = `/payment/web-apps/voids/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/voids/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppVoidUpdateToJSON)(requestParameters['paymentAppVoidUpdate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TransactionVoidFromJSON)(jsonValue));
});
}
/**
* Updates the state of a void for transactions created with a processor linked to the invoking web app, returning the specified void.
* Update a void
*/
patchPaymentWebAppsVoidsId(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.patchPaymentWebAppsVoidsIdRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Create a processor
*/
postPaymentWebAppsProcessorsRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postPaymentWebAppsProcessors().');
}
if (requestParameters['paymentAppProcessorDetailsCreate'] == null) {
throw new runtime.RequiredError('paymentAppProcessorDetailsCreate', 'Required parameter "paymentAppProcessorDetailsCreate" was null or undefined when calling postPaymentWebAppsProcessors().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'POST';
const path = `/payment/web-apps/processors`;
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/processors`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppProcessorDetailsCreateToJSON)(requestParameters['paymentAppProcessorDetailsCreate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentAppProcessorFromJSON)(jsonValue));
});
}
/**
* Create a processor
*/
postPaymentWebAppsProcessors(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postPaymentWebAppsProcessorsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Activate a processor for production
*/
postPaymentWebAppsProcessorsExternalIdActivateForProductionRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['externalId'] == null) {
throw new runtime.RequiredError('externalId', 'Required parameter "externalId" was null or undefined when calling postPaymentWebAppsProcessorsExternalIdActivateForProduction().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postPaymentWebAppsProcessorsExternalIdActivateForProduction().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'POST';
const path = `/payment/web-apps/processors/{externalId}/activate-for-production`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/processors/{externalId}/activate-for-production`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentAppProcessorFromJSON)(jsonValue));
});
}
/**
* Activate a processor for production
*/
postPaymentWebAppsProcessorsExternalIdActivateForProduction(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postPaymentWebAppsProcessorsExternalIdActivateForProductionRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
* Create a connector
*/
postPaymentWebAppsProcessorsExternalIdConnectorsRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters['externalId'] == null) {
throw new runtime.RequiredError('externalId', 'Required parameter "externalId" was null or undefined when calling postPaymentWebAppsProcessorsExternalIdConnectors().');
}
if (requestParameters['space'] == null) {
throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postPaymentWebAppsProcessorsExternalIdConnectors().');
}
if (requestParameters['paymentAppConnectorDetailsCreate'] == null) {
throw new runtime.RequiredError('paymentAppConnectorDetailsCreate', 'Required parameter "paymentAppConnectorDetailsCreate" was null or undefined when calling postPaymentWebAppsProcessorsExternalIdConnectors().');
}
const queryParameters = {};
if (requestParameters['expand'] != null) {
queryParameters['expand'] = requestParameters['expand'];
}
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['space'] != null) {
headerParameters['Space'] = String(requestParameters['space']);
}
const method = 'POST';
const path = `/payment/web-apps/processors/{externalId}/connectors`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId'])));
if (this.configuration.httpBearerAuth) {
yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters);
}
// Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value
const requestTimeoutInSeconds = this.configuration.requestTimeout;
const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds);
const response = yield this.request({
path: `/payment/web-apps/processors/{externalId}/connectors`.replace(`{${"externalId"}}`, encodeURIComponent(String(requestParameters['externalId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.PaymentAppConnectorDetailsCreateToJSON)(requestParameters['paymentAppConnectorDetailsCreate']),
}, updatedInitOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentAppConnectorFromJSON)(jsonValue));
});
}
/**
* Create a connector
*/
postPaymentWebAppsProcessorsExternalIdConnectors(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.postPaymentWebAppsProcessorsExternalIdConnectorsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
}
exports.PaymentWebAppsService = PaymentWebAppsService;