card-management-sdk
Version:
The Shell Card Management API is REST-based and employs OAUTH 2.0,Basic and ApiKey authentication. The API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard HTTP response codes. All resources are located in the S
405 lines • 25.6 kB
JavaScript
"use strict";
/**
* Shell Card Management APIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerController = void 0;
var tslib_1 = require("tslib");
var accountReq_js_1 = require("../models/accountReq.js");
var accountRes_js_1 = require("../models/accountRes.js");
var auditReq_js_1 = require("../models/auditReq.js");
var auditResponse_js_1 = require("../models/auditResponse.js");
var cardGroupReq_js_1 = require("../models/cardGroupReq.js");
var cardGroupRes_js_1 = require("../models/cardGroupRes.js");
var cardTypeReq_js_1 = require("../models/cardTypeReq.js");
var cardTypeRes_js_1 = require("../models/cardTypeRes.js");
var createCardGroupRequest_js_1 = require("../models/createCardGroupRequest.js");
var createCardGroupRes_js_1 = require("../models/createCardGroupRes.js");
var customerReq_js_1 = require("../models/customerReq.js");
var customerRes_js_1 = require("../models/customerRes.js");
var loggedInUserReq_js_1 = require("../models/loggedInUserReq.js");
var loggedInUserRes_js_1 = require("../models/loggedInUserRes.js");
var payerReq_js_1 = require("../models/payerReq.js");
var payerRes_js_1 = require("../models/payerRes.js");
var updateCardGroupRequest_js_1 = require("../models/updateCardGroupRequest.js");
var updateCardGroupRes_js_1 = require("../models/updateCardGroupRes.js");
var schema_js_1 = require("../schema.js");
var baseController_js_1 = require("./baseController.js");
var errorObjectError_js_1 = require("../errors/errorObjectError.js");
var CustomerController = /** @class */ (function (_super) {
tslib_1.__extends(CustomerController, _super);
function CustomerController() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* This operation allows querying the user data of the logged in user.
* This operation should be called only after successful authentication of the end user in client
* application. This operation will return the user access details such as payers and/or accounts.
* This operation will also validate that logged in user has access to the requested operation, on
* failure it will return HasAPIAccess flag as false in the response.
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.loggedinUser = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/user-management/v1/loggedinuser');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, loggedInUserReq_js_1.loggedInUserReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(loggedInUserRes_js_1.loggedInUserResSchema, requestOptions)];
});
});
};
/**
* This API allows querying the payer accounts details from the Shell Cards
* Platform. It provides flexible search criteria for searching payer
* information and supports paging.
*
* Paging is applicable only when all the
* payers passed in the input are from the same ColCo.
*
* However, paging will
* be ignored and the API will return all the matching data by merging the
* data queried from each ColCo when payers passed in the input are from
* multiple ColCos.
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.customerPayers = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/payers');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, payerReq_js_1.payerReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(payerRes_js_1.payerResSchema, requestOptions)];
});
});
};
/**
* This API allows querying the card delivery addresses of a given account from the Shell Cards
* Platform. Only active delivery addresses will be returned.
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.customerDetail = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/customer');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, customerReq_js_1.customerReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(customerRes_js_1.customerResSchema, requestOptions)];
});
});
};
/**
* This API allows querying the customer account details from the Shell Cards Platform. It provides a
* flexible search criterion and supports pagination.
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.postCardAccounts = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/accounts');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, accountReq_js_1.accountReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(accountRes_js_1.accountResSchema, requestOptions)];
});
});
};
/**
*
* This API provides allows querying the active card types that are associated to the given account.
*
* The API returns the card type configurations, purchase categories associated with the card type and
* the card type restriction limits.
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.customerCardType = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v2/cardtype');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, cardTypeReq_js_1.cardTypeReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(cardTypeRes_js_1.cardTypeResSchema, requestOptions)];
});
});
};
/**
* This API allows querying the card group details from the Shell Cards
* Platform. It provides flexible search criteria and supports paging.
*
* When the account is not passed in the input and card group type is configured as
* ‘Vertical’ in the cards platform, this API will return all card groups from
* the payer as well as from all the accounts under the payer.
*
* When the account is not passed in the input and card group type is configured as
* ‘Horizontal’ in cards platform, this API will return all card groups
* configured directly under the payer.
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.cardGroups = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/cardgroups');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, cardGroupReq_js_1.cardGroupReqSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(cardGroupRes_js_1.cardGroupResSchema, requestOptions)];
});
});
};
/**
* This operation allows users to fetch audit data of account or card operations performed by users of
* a given customer
*
* The audit data includes details of below API operations
*
*
*
* * Order Card
*
* * Create Card Group
*
* * PIN reminder
*
* * Move Cards
*
* * Update Card Status
*
* * Update Card Group
*
* * Auto renew
*
* * Bulk card order
*
* * Bulk card block
*
* * Bulk Card Order (Multi Account)
*
* * BCOSummary
*
* * BCOMultiAccountSummary
*
* * BCBSummary
*
* * Mobile Payment Registration
*
* * Fund Transfer (Scheduled & Realtime)
*
* * Delivery Address Update.
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests and
* responses. This will be played back in the response from the request.
* @param body request body
* @return Response from the API call
*/
CustomerController.prototype.auditReport = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/auditreport');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, (0, schema_js_1.optional)(auditReq_js_1.auditReqSchema)],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(auditResponse_js_1.auditResponseSchema, requestOptions)];
});
});
};
/**
* This API allows creating a new Card Group in the Shell Cards Platform. It will
* also allow moving of cards (up to 500 cards) into the newly created
* card-group.
*
* Move Card requests are queued after
* passing the below validations
*
* - Given PAN matches with only one
* card.
* - Card is allowed to be moved to the Target Card Group and/or
* Target account requested.
* - There is no pending Move Card request for
* the same card in the queue which is submitted on the same date
* (customer’s local) and is yet to be processed or has been processed
* successfully
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.customerCreateCardGroup = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/createcardgroup');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, createCardGroupRequest_js_1.createCardGroupRequestSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(createCardGroupRes_js_1.createCardGroupResSchema, requestOptions)];
});
});
};
/**
* This API allows updating or removing a Card Group in the Shell Cards
* Platform.
*
* It also allows moving of cards out of a card group or from one card group to another existing card
* group.
*
* The request for updating or removing of the card group, creationg of a new card group (where-
* applicable) and moving of card into another card group will be queued after passing the basic
* validations.
*
*
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body
* @return Response from the API call
*/
CustomerController.prototype.customerUpdateCardGroup = function (requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/customer-management/v1/updatecardgroup');
mapped = req.prepareArgs({
requestId: [requestId, (0, schema_js_1.string)()],
body: [body, updateCardGroupRequest_js_1.updateCardGroupRequestSchema],
});
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, errorObjectError_js_1.ErrorObjectError, 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).');
req.throwOn(401, errorObjectError_js_1.ErrorObjectError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, errorObjectError_js_1.ErrorObjectError, 'Forbidden');
req.throwOn(404, errorObjectError_js_1.ErrorObjectError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, errorObjectError_js_1.ErrorObjectError, 'The server encountered an unexpected condition that prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(updateCardGroupRes_js_1.updateCardGroupResSchema, requestOptions)];
});
});
};
return CustomerController;
}(baseController_js_1.BaseController));
exports.CustomerController = CustomerController;
//# sourceMappingURL=customerController.js.map