-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.js
More file actions
40 lines (34 loc) · 1.19 KB
/
payment.js
File metadata and controls
40 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const DEFAULT_MESSAGES = require('./constants/defaultMessages');
const HTTP_STATUS_CODES = require('./constants/httpStatusCodes');
const { SERVER_ERROR } = require('./server');
class CONEKTA_ERROR extends SERVER_ERROR {
constructor(message = DEFAULT_MESSAGES.SERVER_ERROR, ...args) {
super(HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR, message, ...args);
Error.captureStackTrace(this, CONEKTA_ERROR);
}
}
class OPENPAY_ERROR extends SERVER_ERROR {
constructor(message = DEFAULT_MESSAGES.SERVER_ERROR, ...args) {
super(HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR, message, ...args);
Error.captureStackTrace(this, OPENPAY_ERROR);
}
}
class PAYPAL_ERROR extends SERVER_ERROR {
constructor(message = DEFAULT_MESSAGES.SERVER_ERROR, ...args) {
super(HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR, message, ...args);
Error.captureStackTrace(this, PAYPAL_ERROR);
}
}
class STRIPE_ERROR extends SERVER_ERROR {
constructor(message = DEFAULT_MESSAGES.SERVER_ERROR, ...args) {
super(HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR, message, ...args);
Error.captureStackTrace(this, STRIPE_ERROR);
}
}
module.exports = {
CONEKTA_ERROR,
OPENPAY_ERROR,
PAYPAL_ERROR,
STRIPE_ERROR
};