UNPKG

digital-payments-sdk

Version:

The APIs detailed within this SDK will enable Shell's Fleet Solutions Customers to digitalize Shell Card/s and use them to pay to refuel their vehicles at Shell Stations.

52 lines 3.41 kB
"use strict"; /** * Shell SmartPay APILib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ exports.__esModule = true; exports.DigitalPaymentEnablementController = void 0; var tslib_1 = require("tslib"); var mobilePaymentRegistrationRequest_1 = require("../models/mobilePaymentRegistrationRequest"); var paymentEnablementResponse_1 = require("../models/paymentEnablementResponse"); var baseController_1 = require("./baseController"); var core_1 = require("@apimatic/core"); var paymentEnablementErrorResponseError_1 = require("../errors/paymentEnablementErrorResponseError"); var DigitalPaymentEnablementController = /** @class */ (function (_super) { tslib_1.__extends(DigitalPaymentEnablementController, _super); function DigitalPaymentEnablementController() { return _super !== null && _super.apply(this, arguments) || this; } /** * Generates a DPAN and stores the relationship between the Reference ID, DPAN and the real PAN. This * method is called during the customer registration process, ahead of any payment. The Reference ID is * an identifier chosen by the client system for mobile payment registration. It must be unique in * context of the client system, and is the key to obtaining and managing the payment details later. * * @param body * @return Response from the API call */ DigitalPaymentEnablementController.prototype.mpayV1TokensRefPut = function (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('PUT', '/PaymentEnablement/v1/ref'); mapped = req.prepareArgs({ body: [body, mobilePaymentRegistrationRequest_1.mobilePaymentRegistrationRequestSchema] }); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.throwOn(400, paymentEnablementErrorResponseError_1.PaymentEnablementErrorResponseError, 'Error Occurred. The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, invalid request message).'); req.throwOn(401, core_1.ApiError, 'Unauthorized. The request has not been applied because it lacks valid authentication credentials for the target resource.'); req.throwOn(403, core_1.ApiError, 'Forbidden. The server understood the request but refuses to authorize it.'); req.throwOn(404, core_1.ApiError, 'Not Found. 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, core_1.ApiError, 'Internal Server Error. The server encountered an unexpected condition that prevented it from fulfilling the request.'); req.authenticate([{ oAuthTokenPost: true }]); return [2 /*return*/, req.callAsJson(paymentEnablementResponse_1.paymentEnablementResponseSchema, requestOptions)]; }); }); }; return DigitalPaymentEnablementController; }(baseController_1.BaseController)); exports.DigitalPaymentEnablementController = DigitalPaymentEnablementController; //# sourceMappingURL=digitalPaymentEnablementController.js.map