x25 3.0.0 → 17.0.0
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/Account/Load.js +75 -0
- package/Account/actions.js +15 -0
- package/Account/index.js +20 -0
- package/Account/reducer.js +122 -0
- package/Account/request.js +44 -0
- package/Async/InitModule.js +190 -0
- package/Async/RouteLoading.js +64 -0
- package/Async/SimulatedException.js +44 -0
- package/Async/index.js +95 -0
- package/Async/types.js +1 -0
- package/Company/Load.js +82 -0
- package/Company/actions.js +15 -0
- package/Company/index.js +20 -0
- package/Company/reducer.js +165 -0
- package/Company/request.js +36 -0
- package/Company/util.js +10 -0
- package/Header/AccountOptionsContainer.js +144 -0
- package/Header/AdminSelectCompany.js +109 -0
- package/Header/ClientSelectCompany.js +104 -0
- package/Header/Header.js +127 -0
- package/Header/HeaderContainer.js +39 -0
- package/Header/Logo.js +30 -0
- package/Header/LogoutButton.js +39 -0
- package/Header/index.js +19 -0
- package/Header/request.js +26 -0
- package/Header/types.js +1 -0
- package/Header/util.js +58 -0
- package/Inputs/Business/BankAccount.js +48 -0
- package/Inputs/Business/BankName.js +49 -0
- package/Inputs/Business/CifField.js +112 -0
- package/Inputs/Business/CifFieldContainer.js +157 -0
- package/Inputs/Business/Email.js +37 -0
- package/Inputs/Business/NidField.js +91 -0
- package/Inputs/Business/Phone.js +37 -0
- package/Inputs/Business/index.js +34 -0
- package/Inputs/Business/request.js +39 -0
- package/Inputs/CaptchaBox.js +151 -0
- package/Inputs/DateInput.js +172 -0
- package/Inputs/DateTemplate.js +200 -0
- package/Inputs/DelayInputChange.js +135 -0
- package/Inputs/FocusTemplate.js +47 -0
- package/Inputs/InputTemplate.js +78 -0
- package/Inputs/LabelTemplate.js +59 -0
- package/Inputs/NumericInput.js +139 -0
- package/Inputs/NumericTemplate.js +148 -0
- package/Inputs/Selects/County.js +29 -0
- package/Inputs/Selects/Custom.js +56 -0
- package/Inputs/Selects/Simple.js +75 -0
- package/Inputs/Selects/index.js +52 -0
- package/Inputs/SimpleInput.js +42 -0
- package/Inputs/SimpleTextarea.js +47 -0
- package/Inputs/TextareaTemplate.js +55 -0
- package/Inputs/Tooltip.js +82 -0
- package/Inputs/index.js +185 -0
- package/Messages/Error.js +106 -0
- package/Messages/Loading.js +68 -0
- package/Messages/index.js +29 -0
- package/Modal/Delete.js +240 -0
- package/Modal/Root.js +81 -0
- package/Modal/SimpleModal.js +57 -0
- package/Modal/actions.js +10 -0
- package/Modal/getComponent.js +42 -0
- package/Modal/index.js +22 -0
- package/Modal/reducer.js +53 -0
- package/Modal/types.js +7 -0
- package/Modal/util.js +17 -0
- package/Payment/EstimatePrice/Description.js +92 -0
- package/Payment/EstimatePrice/PayBox.js +220 -0
- package/Payment/EstimatePrice/index.js +92 -0
- package/Payment/EstimatePrice/util.js +21 -0
- package/Payment/MobilpayForm.js +86 -0
- package/Payment/Modal/BankTransfer.js +233 -0
- package/Payment/Modal/CompanyValability.js +28 -0
- package/Payment/Modal/DoneForm.js +222 -0
- package/Payment/Modal/PaymentDone.js +53 -0
- package/Payment/Modal/index.js +27 -0
- package/Payment/actions.js +23 -0
- package/{src/Payment → Payment}/codes.js +19 -16
- package/Payment/index.js +141 -0
- package/Payment/request.js +49 -0
- package/Payment/types.js +1 -0
- package/Payment/util.js +50 -0
- package/Payment/validate.js +23 -0
- package/Sidebar.js +156 -0
- package/Things.js +53 -0
- package/actions.js +73 -0
- package/config.js +10 -0
- package/dev/ErrorBoundary.js +109 -0
- package/dev/TheError.js +113 -0
- package/dev/index.js +132 -0
- package/dev/types.js +1 -0
- package/package.json +13 -13
- package/prod/SentryErrorBoundary.js +150 -0
- package/reducer/captchas.js +51 -0
- package/reducer/counties.js +57 -0
- package/reducer/index.js +38 -0
- package/reducer/module.js +48 -0
- package/style/index.css +1 -0
- package/style/sidebar.css +1 -0
- package/types.js +1 -0
- package/utility/calendar.js +45 -0
- package/utility/date.js +111 -0
- package/utility/index.js +125 -0
- package/utility/language.js +20 -0
- package/utility/mql.js +6 -0
- package/utility/normalize-test.js +54 -0
- package/utility/normalize.js +108 -0
- package/utility/numbers.js +93 -0
- package/utility/numeric.js +103 -0
- package/utility/others.js +142 -0
- package/utility/strings-test.js +216 -0
- package/utility/strings.js +85 -0
- package/utility/validation/common.js +278 -0
- package/utility/validation/index.js +110 -0
- package/utility/validation/specific.js +14 -0
- package/utility/validation/validate/bank-test.js +41 -0
- package/utility/validation/validate/bank.js +176 -0
- package/utility/validation/validate/cif-test.js +37 -0
- package/utility/validation/validate/cif.js +44 -0
- package/utility/validation/validate/cnp-test.js +68 -0
- package/utility/validation/validate/cnp.js +193 -0
- package/{src/utility → utility}/validation/validate/date.js +61 -73
- package/utility/validation/validate/email-test.js +30 -0
- package/utility/validation/validate/email.js +11 -0
- package/utility/validation/validate/index.js +65 -0
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -275
- package/.flowconfig +0 -23
- package/conf/dev.js +0 -19
- package/conf/dist.js +0 -19
- package/conf/polyfills/tempPolyfills.js +0 -7
- package/src/Account/Load.jsx +0 -79
- package/src/Account/actions.js +0 -10
- package/src/Account/index.js +0 -11
- package/src/Account/reducer.js +0 -139
- package/src/Account/request.js +0 -36
- package/src/Async/InitModule.jsx +0 -114
- package/src/Async/RouteLoading.jsx +0 -52
- package/src/Async/SimulatedException.jsx +0 -19
- package/src/Async/index.jsx +0 -75
- package/src/Async/types.js +0 -39
- package/src/Company/Load.jsx +0 -84
- package/src/Company/actions.js +0 -10
- package/src/Company/index.js +0 -11
- package/src/Company/reducer.js +0 -201
- package/src/Company/request.js +0 -30
- package/src/Company/util.js +0 -7
- package/src/Header/AccountOptionsContainer.jsx +0 -124
- package/src/Header/AdminSelectCompany.jsx +0 -101
- package/src/Header/ClientSelectCompany.jsx +0 -90
- package/src/Header/Header.jsx +0 -120
- package/src/Header/HeaderContainer.jsx +0 -30
- package/src/Header/Logo.jsx +0 -16
- package/src/Header/LogoutButton.jsx +0 -34
- package/src/Header/index.jsx +0 -9
- package/src/Header/request.js +0 -28
- package/src/Header/types.js +0 -6
- package/src/Header/util.jsx +0 -61
- package/src/Inputs/Business/BankAccount.jsx +0 -39
- package/src/Inputs/Business/BankName.jsx +0 -40
- package/src/Inputs/Business/CifField.jsx +0 -93
- package/src/Inputs/Business/CifFieldContainer.jsx +0 -142
- package/src/Inputs/Business/Email.jsx +0 -23
- package/src/Inputs/Business/NidField.jsx +0 -77
- package/src/Inputs/Business/Phone.jsx +0 -23
- package/src/Inputs/Business/index.js +0 -16
- package/src/Inputs/Business/request.js +0 -39
- package/src/Inputs/CaptchaBox.jsx +0 -131
- package/src/Inputs/DateInput.jsx +0 -188
- package/src/Inputs/DateTemplate.jsx +0 -213
- package/src/Inputs/DelayInputChange.jsx +0 -130
- package/src/Inputs/FocusTemplate.jsx +0 -41
- package/src/Inputs/InputTemplate.jsx +0 -79
- package/src/Inputs/LabelTemplate.jsx +0 -47
- package/src/Inputs/NumericInput.jsx +0 -142
- package/src/Inputs/NumericTemplate.jsx +0 -155
- package/src/Inputs/Selects/County.jsx +0 -19
- package/src/Inputs/Selects/Custom.jsx +0 -55
- package/src/Inputs/Selects/Simple.jsx +0 -73
- package/src/Inputs/Selects/index.jsx +0 -37
- package/src/Inputs/SimpleInput.jsx +0 -40
- package/src/Inputs/SimpleTextarea.jsx +0 -55
- package/src/Inputs/TextareaTemplate.jsx +0 -57
- package/src/Inputs/Tooltip.jsx +0 -61
- package/src/Inputs/index.js +0 -22
- package/src/Messages/Error.jsx +0 -83
- package/src/Messages/Loading.jsx +0 -43
- package/src/Messages/index.jsx +0 -4
- package/src/Modal/Delete.jsx +0 -237
- package/src/Modal/Root.jsx +0 -57
- package/src/Modal/SimpleModal.jsx +0 -47
- package/src/Modal/actions.js +0 -7
- package/src/Modal/getComponent.jsx +0 -32
- package/src/Modal/index.jsx +0 -12
- package/src/Modal/reducer.js +0 -40
- package/src/Modal/types.js +0 -6
- package/src/Modal/util.js +0 -15
- package/src/Payment/EstimatePrice/Description.jsx +0 -101
- package/src/Payment/EstimatePrice/PayBox.jsx +0 -173
- package/src/Payment/EstimatePrice/index.jsx +0 -63
- package/src/Payment/EstimatePrice/util.js +0 -15
- package/src/Payment/MobilpayForm.jsx +0 -77
- package/src/Payment/Modal/BankTransfer.jsx +0 -129
- package/src/Payment/Modal/CompanyValability.jsx +0 -14
- package/src/Payment/Modal/DoneForm.jsx +0 -209
- package/src/Payment/Modal/PaymentDone.jsx +0 -27
- package/src/Payment/Modal/index.js +0 -13
- package/src/Payment/actions.jsx +0 -22
- package/src/Payment/index.jsx +0 -124
- package/src/Payment/request.js +0 -50
- package/src/Payment/types.js +0 -14
- package/src/Payment/util.jsx +0 -52
- package/src/Payment/validate.js +0 -25
- package/src/Sidebar.jsx +0 -158
- package/src/Things.jsx +0 -35
- package/src/actions.js +0 -36
- package/src/config.js +0 -7
- package/src/dev/ErrorBoundary.jsx +0 -98
- package/src/dev/TheError.jsx +0 -87
- package/src/dev/index.js +0 -127
- package/src/dev/types.js +0 -10
- package/src/prod/SentryErrorBoundary.jsx +0 -98
- package/src/reducer/captchas.js +0 -44
- package/src/reducer/counties.js +0 -46
- package/src/reducer/index.js +0 -25
- package/src/reducer/module.jsx +0 -43
- package/src/style/.sass-lint.yml +0 -84
- package/src/style/.stylelintrc.json +0 -161
- package/src/style/_fancy-text.scss +0 -37
- package/src/style/_fix_bootstrap_placeholder_color.scss +0 -14
- package/src/style/_header-company.scss +0 -69
- package/src/style/_inputs.scss +0 -12
- package/src/style/_minimal.scss +0 -31
- package/src/style/_navigation.scss +0 -24
- package/src/style/_others.scss +0 -79
- package/src/style/index.scss +0 -7
- package/src/style/sidebar/_animations.scss +0 -21
- package/src/style/sidebar/_dark-theme.scss +0 -77
- package/src/style/sidebar/_scroll.scss +0 -37
- package/src/style/sidebar/_structure.scss +0 -299
- package/src/style/sidebar.scss +0 -4
- package/src/types.js +0 -31
- package/src/utility/calendar.js +0 -39
- package/src/utility/date.js +0 -100
- package/src/utility/index.js +0 -12
- package/src/utility/language.js +0 -17
- package/src/utility/mql.js +0 -3
- package/src/utility/normalize-test.js +0 -58
- package/src/utility/normalize.js +0 -119
- package/src/utility/numbers.js +0 -87
- package/src/utility/numeric.js +0 -114
- package/src/utility/others.jsx +0 -160
- package/src/utility/strings-test.js +0 -136
- package/src/utility/strings.js +0 -80
- package/src/utility/validation/common.js +0 -360
- package/src/utility/validation/index.js +0 -70
- package/src/utility/validation/specific.js +0 -9
- package/src/utility/validation/validate/bank-test.js +0 -129
- package/src/utility/validation/validate/bank.js +0 -176
- package/src/utility/validation/validate/cif-test.js +0 -105
- package/src/utility/validation/validate/cif.js +0 -44
- package/src/utility/validation/validate/cnp-test.js +0 -216
- package/src/utility/validation/validate/cnp.js +0 -261
- package/src/utility/validation/validate/email-test.js +0 -36
- package/src/utility/validation/validate/email.js +0 -6
- package/src/utility/validation/validate/index.js +0 -7
- package/webpack.config.js +0 -90
- package/x25.wiki/Account.md +0 -41
- package/x25.wiki/Company.md +0 -39
- package/x25.wiki/Header.md +0 -21
- package/x25.wiki/Home.md +0 -1
- package/x25.wiki/Inputs.md +0 -33
- package/x25.wiki/Messages.md +0 -27
- package/x25.wiki/Payment.md +0 -42
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
|
+
|
|
9
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
var _reactRedux = require("react-redux");
|
|
12
|
+
|
|
13
|
+
var _immutable = require("redux-form/immutable");
|
|
14
|
+
|
|
15
|
+
var _react = require("react");
|
|
16
|
+
|
|
17
|
+
var _react2 = _interopRequireDefault(_react);
|
|
18
|
+
|
|
19
|
+
var _actions = require("../actions");
|
|
20
|
+
|
|
21
|
+
var _request = require("../request");
|
|
22
|
+
|
|
23
|
+
var _utility = require("../../utility");
|
|
24
|
+
|
|
25
|
+
var _actions2 = require("../../actions");
|
|
26
|
+
|
|
27
|
+
var _Messages = require("../../Messages");
|
|
28
|
+
|
|
29
|
+
var _Inputs = require("../../Inputs");
|
|
30
|
+
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
+
|
|
33
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
34
|
+
|
|
35
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
36
|
+
|
|
37
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
38
|
+
/* eslint-disable no-magic-numbers, max-classes-per-file */
|
|
39
|
+
|
|
40
|
+
var TransferNumber = (0, _utility.validateString)({
|
|
41
|
+
min: 4
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
var validate = (0, _utility.extractErrorsFromCheckers)({
|
|
45
|
+
TransferNumber: TransferNumber
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var selector = (0, _immutable.formValueSelector)("ADD_CAR_FORM");
|
|
49
|
+
|
|
50
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
51
|
+
return {
|
|
52
|
+
ExpiryDate: selector(state, "ExpiryDate")
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
56
|
+
return {
|
|
57
|
+
showUserResponse: function showUserResponse() {
|
|
58
|
+
(0, _utility.delay)().then(function () {
|
|
59
|
+
dispatch((0, _actions2.hideModal)());
|
|
60
|
+
}).then(function () {
|
|
61
|
+
dispatch((0, _actions2.hideModal)());
|
|
62
|
+
}).
|
|
63
|
+
// then(() => {
|
|
64
|
+
// dispatch(notify("Operațiune îndeplinită cu succes"));
|
|
65
|
+
// }).
|
|
66
|
+
then(function () {
|
|
67
|
+
dispatch((0, _actions.showTransferWasDone)());
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var TheForm = function (_React$Component) {
|
|
74
|
+
_inherits(TheForm, _React$Component);
|
|
75
|
+
|
|
76
|
+
function TheForm(props) {
|
|
77
|
+
_classCallCheck(this, TheForm);
|
|
78
|
+
|
|
79
|
+
var _this = _possibleConstructorReturn(this, (TheForm.__proto__ || Object.getPrototypeOf(TheForm)).call(this, props));
|
|
80
|
+
|
|
81
|
+
_this.handleSubmitForm = function (data) {
|
|
82
|
+
var handleSubmit = _this.props.handleSubmit;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
var result = handleSubmit(data);
|
|
86
|
+
|
|
87
|
+
if (typeof result.then !== "undefined") {
|
|
88
|
+
result.then(function () {
|
|
89
|
+
_this.focusNameInput();
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
_this.focusNameInput = function () {
|
|
95
|
+
setTimeout(function () {
|
|
96
|
+
var field = _this.field;
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if (field && field !== null) {
|
|
100
|
+
field.focus();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
_this.handleRegisterRef = function (node) {
|
|
106
|
+
_this.field = node;
|
|
107
|
+
};
|
|
108
|
+
return _this;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
_createClass(TheForm, [{
|
|
112
|
+
key: "componentDidMount",
|
|
113
|
+
value: function componentDidMount() {
|
|
114
|
+
this.focusNameInput();
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "render",
|
|
118
|
+
value: function render() {
|
|
119
|
+
var _props = this.props,
|
|
120
|
+
error = _props.error,
|
|
121
|
+
pristine = _props.pristine,
|
|
122
|
+
submitting = _props.submitting;
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
return _react2.default.createElement(
|
|
126
|
+
"form",
|
|
127
|
+
{ autoComplete: "off", className: "mt-4", onSubmit: this.handleSubmitForm },
|
|
128
|
+
error ? _react2.default.createElement(
|
|
129
|
+
"div",
|
|
130
|
+
{ className: "alert alert-danger" },
|
|
131
|
+
error
|
|
132
|
+
) : null,
|
|
133
|
+
_react2.default.createElement(
|
|
134
|
+
"div",
|
|
135
|
+
{ className: "alert alert-primary" },
|
|
136
|
+
"Te rugăm să completezi numărul tranzacției bancare:"
|
|
137
|
+
),
|
|
138
|
+
_react2.default.createElement(
|
|
139
|
+
"div",
|
|
140
|
+
{ className: "container" },
|
|
141
|
+
_react2.default.createElement(
|
|
142
|
+
"div",
|
|
143
|
+
{ className: "row" },
|
|
144
|
+
_react2.default.createElement(
|
|
145
|
+
"div",
|
|
146
|
+
{ className: "col-md" },
|
|
147
|
+
_react2.default.createElement(_immutable.Field, {
|
|
148
|
+
autoFocus: true,
|
|
149
|
+
component: _Inputs.FocusTemplate,
|
|
150
|
+
forwardRef: true,
|
|
151
|
+
label: "Num\u0103r tranzac\u021Bie",
|
|
152
|
+
name: "TransferNumber",
|
|
153
|
+
onRegisterRef: this.handleRegisterRef,
|
|
154
|
+
placeholder: "ex. 238747324"
|
|
155
|
+
})
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
),
|
|
159
|
+
_react2.default.createElement(
|
|
160
|
+
"div",
|
|
161
|
+
{ className: "text-center mb-4" },
|
|
162
|
+
submitting ? _react2.default.createElement(_Messages.LoadingMessage, { sm: true }) : _react2.default.createElement(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
"aria-label": "Trimite",
|
|
166
|
+
className: "btn btn-primary",
|
|
167
|
+
disabled: pristine || submitting,
|
|
168
|
+
type: "submit" },
|
|
169
|
+
"Trimite"
|
|
170
|
+
)
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}]);
|
|
175
|
+
|
|
176
|
+
return TheForm;
|
|
177
|
+
}(_react2.default.Component);
|
|
178
|
+
|
|
179
|
+
var Form = (0, _immutable.reduxForm)({
|
|
180
|
+
form: "PAYMENT_BANK_TRANSFER_NUMBER",
|
|
181
|
+
validate: validate
|
|
182
|
+
})(TheForm);
|
|
183
|
+
|
|
184
|
+
var DoneForm = function (_React$Component2) {
|
|
185
|
+
_inherits(DoneForm, _React$Component2);
|
|
186
|
+
|
|
187
|
+
function DoneForm() {
|
|
188
|
+
_classCallCheck(this, DoneForm);
|
|
189
|
+
|
|
190
|
+
var _this2 = _possibleConstructorReturn(this, (DoneForm.__proto__ || Object.getPrototypeOf(DoneForm)).call(this));
|
|
191
|
+
|
|
192
|
+
_this2.handleSubmit = function (formData) {
|
|
193
|
+
var showUserResponse = _this2.props.showUserResponse,
|
|
194
|
+
data = _extends({}, formData.toJS(), {
|
|
195
|
+
Details: _this2.props.details
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
return (0, _request.confirmBankTransfer)(data).then(function (response) {
|
|
200
|
+
if (response.Error === "") {
|
|
201
|
+
showUserResponse();
|
|
202
|
+
} else {
|
|
203
|
+
throw new _immutable.SubmissionError({
|
|
204
|
+
_error: response.Error
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}).catch(_utility.ReduxFormSubmissionError);
|
|
208
|
+
};
|
|
209
|
+
return _this2;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
_createClass(DoneForm, [{
|
|
213
|
+
key: "render",
|
|
214
|
+
value: function render() {
|
|
215
|
+
return _react2.default.createElement(Form, { onSubmit: this.handleSubmit });
|
|
216
|
+
}
|
|
217
|
+
}]);
|
|
218
|
+
|
|
219
|
+
return DoneForm;
|
|
220
|
+
}(_react2.default.Component);
|
|
221
|
+
|
|
222
|
+
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(DoneForm);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _Modal = require("../../Modal");
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
var ModalBankTransfer = function ModalBankTransfer() {
|
|
16
|
+
return _react2.default.createElement(
|
|
17
|
+
_Modal.SimpleModal,
|
|
18
|
+
{ title: "Confirmare" },
|
|
19
|
+
_react2.default.createElement(
|
|
20
|
+
"div",
|
|
21
|
+
{ className: "mt-2" },
|
|
22
|
+
_react2.default.createElement(
|
|
23
|
+
"h3",
|
|
24
|
+
{ className: "text-success" },
|
|
25
|
+
_react2.default.createElement("i", { className: "fa fa-check text-success" }),
|
|
26
|
+
" ",
|
|
27
|
+
"Am înregistrat cererea ta"
|
|
28
|
+
),
|
|
29
|
+
_react2.default.createElement(
|
|
30
|
+
"div",
|
|
31
|
+
{ className: "mt-4" },
|
|
32
|
+
_react2.default.createElement(
|
|
33
|
+
"h5",
|
|
34
|
+
{ className: "mt-2" },
|
|
35
|
+
"Ce se întâmplă acum?"
|
|
36
|
+
),
|
|
37
|
+
"Rămâne să primim confirmarea din partea băncii tale și vom efectua operațiunile"
|
|
38
|
+
),
|
|
39
|
+
_react2.default.createElement(
|
|
40
|
+
"h5",
|
|
41
|
+
{ className: "mt-3" },
|
|
42
|
+
"Cât timp va dura?"
|
|
43
|
+
),
|
|
44
|
+
_react2.default.createElement(
|
|
45
|
+
"div",
|
|
46
|
+
null,
|
|
47
|
+
"Dureaz\u0103 \xEEntre 1 \u0219i 3 zile lucr\u0103toare pentru opera\u021Biunea bancar\u0103 s\u0103\n se desf\u0103\u0219oare. \xCEn momentul \xEEn care am primit banii \xEEn cont, te rug\u0103m s\u0103 acorzi\n 1-2 zile lucr\u0103toare s\u0103 oper\u0103m modific\u0103rile pe platforma Sidework \u0219i s\u0103\n te bucuri de beneficii."
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.default = ModalBankTransfer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _BankTransfer = require("./BankTransfer");
|
|
8
|
+
|
|
9
|
+
var _BankTransfer2 = _interopRequireDefault(_BankTransfer);
|
|
10
|
+
|
|
11
|
+
var _PaymentDone = require("./PaymentDone");
|
|
12
|
+
|
|
13
|
+
var _PaymentDone2 = _interopRequireDefault(_PaymentDone);
|
|
14
|
+
|
|
15
|
+
var _CompanyValability = require("./CompanyValability");
|
|
16
|
+
|
|
17
|
+
var _CompanyValability2 = _interopRequireDefault(_CompanyValability);
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
var modals = {
|
|
22
|
+
"PAYMENT_BANK_TRANSFER": _BankTransfer2.default,
|
|
23
|
+
"PAYMENT_WAS_DONE": _PaymentDone2.default,
|
|
24
|
+
"ESTIMATE_COMPANY_PRICE": _CompanyValability2.default
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.default = modals;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.estimateCompanyPriceModal = exports.showTransferWasDone = exports.payUsingBankTransferModal = undefined;
|
|
7
|
+
|
|
8
|
+
var _utility = require("../utility");
|
|
9
|
+
|
|
10
|
+
var payUsingBankTransferModal = exports.payUsingBankTransferModal = function payUsingBankTransferModal(application, options) {
|
|
11
|
+
return (0, _utility.createModal)("PAYMENT_BANK_TRANSFER", {
|
|
12
|
+
application: application,
|
|
13
|
+
options: options
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var showTransferWasDone = exports.showTransferWasDone = function showTransferWasDone() {
|
|
18
|
+
return (0, _utility.createModal)("PAYMENT_WAS_DONE");
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var estimateCompanyPriceModal = exports.estimateCompanyPriceModal = function estimateCompanyPriceModal(id) {
|
|
22
|
+
return (0, _utility.createModal)("ESTIMATE_COMPANY_PRICE", { id: id });
|
|
23
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
/*
|
|
4
9
|
// // ApplicationCodeSMSAlert ---
|
|
5
10
|
// ApplicationCodeSMSAlert = "smsalert"
|
|
@@ -12,9 +17,9 @@
|
|
|
12
17
|
// <b>smsalert</b><br>
|
|
13
18
|
// arg1: <b>credits</b><br>
|
|
14
19
|
// arg2: <b>companyID</b><br><br>
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
*/
|
|
21
|
+
var ApplicationCodeSMSAlert = "smsalert";
|
|
22
|
+
|
|
18
23
|
/*
|
|
19
24
|
// // ApplicationCodeInvoiceService ---
|
|
20
25
|
// ApplicationCodeInvoiceService = "facturare"
|
|
@@ -26,9 +31,9 @@ const ApplicationCodeSMSAlert = "smsalert";
|
|
|
26
31
|
// <b>facturare</b><br>
|
|
27
32
|
// arg1: <b>months</b><br>
|
|
28
33
|
// arg2: <b>companyID</b><br><br>
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
*/
|
|
35
|
+
var ApplicationCodeInvoiceService = "facturare";
|
|
36
|
+
|
|
32
37
|
/*
|
|
33
38
|
// // ApplicationCodeAutoService ---
|
|
34
39
|
// ApplicationCodeAutoService = "auto"
|
|
@@ -40,11 +45,9 @@ const ApplicationCodeInvoiceService = "facturare";
|
|
|
40
45
|
// <b>auto</b><br>
|
|
41
46
|
// arg1: <b>months</b><br>
|
|
42
47
|
// arg2: <b>companyID</b><br><br>
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ApplicationCodeAutoService,
|
|
50
|
-
};
|
|
48
|
+
*/
|
|
49
|
+
var ApplicationCodeAutoService = "auto";
|
|
50
|
+
|
|
51
|
+
exports.ApplicationCodeSMSAlert = ApplicationCodeSMSAlert;
|
|
52
|
+
exports.ApplicationCodeInvoiceService = ApplicationCodeInvoiceService;
|
|
53
|
+
exports.ApplicationCodeAutoService = ApplicationCodeAutoService;
|
package/Payment/index.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
8
|
+
|
|
9
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
var _codes = require("./codes");
|
|
12
|
+
|
|
13
|
+
Object.keys(_codes).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
Object.defineProperty(exports, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _codes[key];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
var _immutable = require("redux-form/immutable");
|
|
24
|
+
|
|
25
|
+
var _react = require("react");
|
|
26
|
+
|
|
27
|
+
var _react2 = _interopRequireDefault(_react);
|
|
28
|
+
|
|
29
|
+
var _request = require("./request");
|
|
30
|
+
|
|
31
|
+
var _utility = require("../utility");
|
|
32
|
+
|
|
33
|
+
var _MobilpayForm = require("./MobilpayForm");
|
|
34
|
+
|
|
35
|
+
var _MobilpayForm2 = _interopRequireDefault(_MobilpayForm);
|
|
36
|
+
|
|
37
|
+
var _reactRedux = require("react-redux");
|
|
38
|
+
|
|
39
|
+
var _actions = require("./actions");
|
|
40
|
+
|
|
41
|
+
var _util = require("./util");
|
|
42
|
+
|
|
43
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
|
+
|
|
45
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
46
|
+
|
|
47
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
48
|
+
|
|
49
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
50
|
+
/* eslint-disable no-magic-numbers */
|
|
51
|
+
|
|
52
|
+
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
53
|
+
return {
|
|
54
|
+
payUsingBankTransfer: function payUsingBankTransfer(application, options) {
|
|
55
|
+
return function () {
|
|
56
|
+
dispatch((0, _actions.payUsingBankTransferModal)(application, options));
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
Injects a createPayment method ready for dealing with adding the payment.
|
|
64
|
+
After that, it submits the payment
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
var PaymentWrap = function (_React$Component) {
|
|
68
|
+
_inherits(PaymentWrap, _React$Component);
|
|
69
|
+
|
|
70
|
+
function PaymentWrap(props) {
|
|
71
|
+
_classCallCheck(this, PaymentWrap);
|
|
72
|
+
|
|
73
|
+
var _this = _possibleConstructorReturn(this, (PaymentWrap.__proto__ || Object.getPrototypeOf(PaymentWrap)).call(this, props));
|
|
74
|
+
|
|
75
|
+
_this.state = {
|
|
76
|
+
envKey: "",
|
|
77
|
+
data: "",
|
|
78
|
+
show3rdServiceForm: false
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
_this.createPayment = function (formData) {
|
|
82
|
+
var companyID = _this.props.companyID,
|
|
83
|
+
data = formData.toJS(),
|
|
84
|
+
Details = (0, _util.getDetails)(_this.props.application, _extends({}, data, {
|
|
85
|
+
companyID: companyID
|
|
86
|
+
})),
|
|
87
|
+
toSend = {
|
|
88
|
+
CompanyID: companyID,
|
|
89
|
+
Details: Details
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return (0, _request.addPayment)(toSend).then(function (response) {
|
|
94
|
+
if (response.Error === "") {
|
|
95
|
+
_this.setState({
|
|
96
|
+
envKey: response.EnvKey,
|
|
97
|
+
data: response.Data,
|
|
98
|
+
show3rdServiceForm: true
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
throw new _immutable.SubmissionError({
|
|
102
|
+
_error: response.Error
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}).catch(_utility.ReduxFormSubmissionError);
|
|
106
|
+
};
|
|
107
|
+
return _this;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_createClass(PaymentWrap, [{
|
|
111
|
+
key: "render",
|
|
112
|
+
value: function render() {
|
|
113
|
+
var _props = this.props,
|
|
114
|
+
children = _props.children,
|
|
115
|
+
companyID = _props.companyID;
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
if (this.state.show3rdServiceForm) {
|
|
119
|
+
return _react2.default.createElement(_MobilpayForm2.default, {
|
|
120
|
+
data: this.state.data,
|
|
121
|
+
envKey: this.state.envKey,
|
|
122
|
+
url: this.props.url
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (children === null) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return _react2.default.cloneElement(children, {
|
|
131
|
+
companyID: companyID,
|
|
132
|
+
createPayment: this.createPayment,
|
|
133
|
+
payUsingBankTransfer: this.props.payUsingBankTransfer
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}]);
|
|
137
|
+
|
|
138
|
+
return PaymentWrap;
|
|
139
|
+
}(_react2.default.Component);
|
|
140
|
+
|
|
141
|
+
exports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(PaymentWrap);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.confirmBankTransfer = exports.addPayment = undefined;
|
|
7
|
+
|
|
8
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
9
|
+
|
|
10
|
+
var _superagent = require("superagent");
|
|
11
|
+
|
|
12
|
+
var _superagent2 = _interopRequireDefault(_superagent);
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var normalizePayment = function normalizePayment(resolve, reject) {
|
|
17
|
+
return function (error, response) {
|
|
18
|
+
|
|
19
|
+
if (error) {
|
|
20
|
+
reject({ error: error });
|
|
21
|
+
} else {
|
|
22
|
+
var body = response.body,
|
|
23
|
+
_Error = body.Error;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if (typeof _Error !== "undefined" && _Error !== "") {
|
|
27
|
+
reject({
|
|
28
|
+
error: _Error
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
resolve(_extends({}, body, {
|
|
32
|
+
Error: _Error
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var addPayment = exports.addPayment = function addPayment(data) {
|
|
40
|
+
return new Promise(function (resolve, reject) {
|
|
41
|
+
return _superagent2.default.put("/api/settings/payments").set("Accept", "application/json").send(data).end(normalizePayment(resolve, reject));
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var confirmBankTransfer = exports.confirmBankTransfer = function confirmBankTransfer(data) {
|
|
46
|
+
return new Promise(function (resolve, reject) {
|
|
47
|
+
return _superagent2.default.put("/api/settings/payments/confirm-bank-transfer").set("Accept", "application/json").send(data).end(normalizePayment(resolve, reject));
|
|
48
|
+
});
|
|
49
|
+
};
|
package/Payment/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/Payment/util.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDetails = exports.info = undefined;
|
|
7
|
+
|
|
8
|
+
var _codes = require("./codes");
|
|
9
|
+
|
|
10
|
+
var codes = _interopRequireWildcard(_codes);
|
|
11
|
+
|
|
12
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
13
|
+
|
|
14
|
+
var getDetails = function getDetails(application, data) {
|
|
15
|
+
|
|
16
|
+
var getParams = function getParams() {
|
|
17
|
+
var Credits = data.Credits,
|
|
18
|
+
Months = data.Months,
|
|
19
|
+
companyID = data.companyID;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
switch (application) {
|
|
23
|
+
case codes.ApplicationCodeSMSAlert:
|
|
24
|
+
|
|
25
|
+
return [Credits, companyID];
|
|
26
|
+
|
|
27
|
+
case codes.ApplicationCodeAutoService:
|
|
28
|
+
case codes.ApplicationCodeInvoiceService:
|
|
29
|
+
return [Months, companyID];
|
|
30
|
+
|
|
31
|
+
default:
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return application + "-" + getParams().join("-");
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var info = {
|
|
40
|
+
to: "S.C. SIDEWORK S.R.L.",
|
|
41
|
+
cif: "40375263",
|
|
42
|
+
regCom: "J52/21/2019",
|
|
43
|
+
address: "B-dul Republicii, Bl. B3, Ap. 19, Et. 2, Camera 1 & Camera 2, Bolintin Vale, Giurgiu",
|
|
44
|
+
|
|
45
|
+
bankName: "Banca Transilvania S.A.",
|
|
46
|
+
bankAccount: "RO27 BTRL RONC RT04 8269 9301"
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.info = info;
|
|
50
|
+
exports.getDetails = getDetails;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validate = undefined;
|
|
7
|
+
|
|
8
|
+
var _utility = require("../utility");
|
|
9
|
+
|
|
10
|
+
var validateTrue = function validateTrue(value) {
|
|
11
|
+
var notValid = typeof value !== "boolean" || value !== true;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
notValid: notValid,
|
|
15
|
+
error: "Trebuie să fii de acord"
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var checkers = {
|
|
20
|
+
AcceptPolicy: validateTrue
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var validate = exports.validate = (0, _utility.extractErrorsFromCheckers)(checkers);
|