UNPKG

@lomray/microservice-payment-stripe

Version:

Stripe payment microservice based on NodeJS & inverted json.

37 lines (33 loc) 1.22 kB
'use strict'; var tslib = require('tslib'); var microserviceHelpers = require('@lomray/microservice-helpers'); var classValidator = require('class-validator'); var stripe = require('../../services/payment-gateway/stripe.js'); class DashboardLoginLinkInput { } tslib.__decorate([ classValidator.Length(1, 36), classValidator.IsString(), tslib.__metadata("design:type", String) ], DashboardLoginLinkInput.prototype, "userId", void 0); class DashboardLoginLinkOutput { } tslib.__decorate([ classValidator.IsString(), tslib.__metadata("design:type", String) ], DashboardLoginLinkOutput.prototype, "url", void 0); /** * Create new link for access to the express account dashboard * @description Eligible only for the express accounts */ const dashboardLoginLink = microserviceHelpers.Endpoint.custom(() => ({ input: DashboardLoginLinkInput, output: DashboardLoginLinkOutput, description: 'Create new link for access to the express account dashboard', }), ({ userId }) => tslib.__awaiter(void 0, void 0, void 0, function* () { const service = yield stripe.init(); return { url: yield service.getDashboardLoginLink(userId), }; })); module.exports = dashboardLoginLink;