@felloh-org/lambda-wrapper 1.11.59 → 1.11.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -375,6 +375,12 @@ Object.defineProperty(exports, "RefundStatusEntity", {
|
|
|
375
375
|
return _refundStatus.default;
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
|
+
Object.defineProperty(exports, "RefundWebhookModel", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () {
|
|
381
|
+
return _refund2.default;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
378
384
|
Object.defineProperty(exports, "RequestService", {
|
|
379
385
|
enumerable: true,
|
|
380
386
|
get: function () {
|
|
@@ -878,6 +884,8 @@ var _status = _interopRequireWildcard(require("./model/status"));
|
|
|
878
884
|
|
|
879
885
|
var _transaction7 = _interopRequireDefault(require("./model/webhook/transaction"));
|
|
880
886
|
|
|
887
|
+
var _refund2 = _interopRequireDefault(require("./model/webhook/refund"));
|
|
888
|
+
|
|
881
889
|
var _http = _interopRequireDefault(require("./service/http"));
|
|
882
890
|
|
|
883
891
|
var _logger = _interopRequireDefault(require("./service/logger"));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
class RefundWebhook {
|
|
9
|
+
constructor(refund) {
|
|
10
|
+
this.refund = refund;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get() {
|
|
14
|
+
var _this$refund, _this$refund2, _this$refund$transact, _this$refund3, _this$refund3$status;
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
authorisation_code: (_this$refund = this.refund) === null || _this$refund === void 0 ? void 0 : _this$refund.authorisation_code,
|
|
18
|
+
actioned_at: (_this$refund2 = this.refund) === null || _this$refund2 === void 0 ? void 0 : _this$refund2.updated_at,
|
|
19
|
+
transaction: {
|
|
20
|
+
id: (_this$refund$transact = this.refund.transaction) === null || _this$refund$transact === void 0 ? void 0 : _this$refund$transact.id
|
|
21
|
+
},
|
|
22
|
+
status: {
|
|
23
|
+
id: (_this$refund3 = this.refund) === null || _this$refund3 === void 0 ? void 0 : (_this$refund3$status = _this$refund3.status) === null || _this$refund3$status === void 0 ? void 0 : _this$refund3$status.id
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.default = RefundWebhook;
|
package/dist/service/request.js
CHANGED
|
@@ -56,9 +56,6 @@ class Request extends _dependencyAware.default {
|
|
|
56
56
|
*/
|
|
57
57
|
get(parameter, ifNull = null, requestType = null) {
|
|
58
58
|
const queryParameters = this.getAll(requestType);
|
|
59
|
-
console.log('queryParameters', queryParameters);
|
|
60
|
-
console.log('typeof queryParameters', typeof queryParameters);
|
|
61
|
-
console.log(parameter, typeof queryParameters[parameter]);
|
|
62
59
|
|
|
63
60
|
if (queryParameters === null) {
|
|
64
61
|
return ifNull;
|
|
@@ -157,7 +154,6 @@ class Request extends _dependencyAware.default {
|
|
|
157
154
|
|
|
158
155
|
getAll(requestType = null) {
|
|
159
156
|
const event = this.getContainer().getEvent();
|
|
160
|
-
console.log('raw event', event);
|
|
161
157
|
|
|
162
158
|
if (HTTP_METHODS_WITHOUT_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITHOUT_PAYLOADS.includes(requestType)) {
|
|
163
159
|
// get simple parameters
|
|
@@ -173,14 +169,11 @@ class Request extends _dependencyAware.default {
|
|
|
173
169
|
if (HTTP_METHODS_WITH_PAYLOADS.includes(event.httpMethod) || HTTP_METHODS_WITH_PAYLOADS.includes(requestType)) {
|
|
174
170
|
const contentType = this.getHeader('Content-Type', this.getHeader('content-type'));
|
|
175
171
|
let queryParameters = {};
|
|
176
|
-
console.log('content-type', contentType);
|
|
177
172
|
|
|
178
173
|
if (contentType.includes('application/x-www-form-urlencoded')) {
|
|
179
174
|
queryParameters = _querystring.default.parse(event.body);
|
|
180
175
|
}
|
|
181
176
|
|
|
182
|
-
console.log('event body', typeof event.body);
|
|
183
|
-
|
|
184
177
|
if (contentType.includes('application/json')) {
|
|
185
178
|
try {
|
|
186
179
|
if (typeof event.body === 'object') {
|
|
@@ -204,7 +197,6 @@ class Request extends _dependencyAware.default {
|
|
|
204
197
|
queryParameters = this.parseForm(true);
|
|
205
198
|
}
|
|
206
199
|
|
|
207
|
-
console.log(queryParameters);
|
|
208
200
|
return queryParameters;
|
|
209
201
|
}
|
|
210
202
|
|
|
@@ -272,7 +264,6 @@ class Request extends _dependencyAware.default {
|
|
|
272
264
|
if (typeof validation === 'undefined') {
|
|
273
265
|
resolve();
|
|
274
266
|
} else {
|
|
275
|
-
console.log(this.getAll(), validation);
|
|
276
267
|
Logger.label('request-validation-failed');
|
|
277
268
|
const validationErrorResponse = new _response.default({}, 422);
|
|
278
269
|
Object.keys(validation).forEach(validationKey => {
|