@orenda-inc/nestjs-webx-pay
Version:
NestJS module for WebX Pay integration
146 lines (145 loc) • 5.89 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebhookRequestDto = exports.PaymentRequestDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class PaymentRequestDto {
}
exports.PaymentRequestDto = PaymentRequestDto;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 50),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "firstName", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 50),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "lastName", void 0);
__decorate([
(0, class_validator_1.IsEmail)(),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "email", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(10, 20),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "contactNumber", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 100),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "addressLineOne", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(0, 100),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "addressLineTwo", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 50),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "city", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 50),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "state", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 20),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "postalCode", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 50),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "country", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsIn)(['LKR', 'USD', 'EUR', 'GBP', 'INR', 'AUD', 'CAD']),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "processCurrency", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "paymentGatewayId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "multiplePaymentGatewayIds", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(1),
(0, class_transformer_1.Transform)(({ value }) => parseFloat(value)),
__metadata("design:type", Number)
], PaymentRequestDto.prototype, "amount", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(0, 200),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], PaymentRequestDto.prototype, "orderId", void 0);
class WebhookRequestDto {
}
exports.WebhookRequestDto = WebhookRequestDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "orderId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "referenceNumber", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "timestamp", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "statusCode", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "statusMessage", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "gatewayId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "transactionAmount", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "requestedAmount", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "customFields", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], WebhookRequestDto.prototype, "payment", void 0);