swell-js 3.11.0 → 3.12.2
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/api.js +11 -11
- package/dist/currency.js +3 -1
- package/dist/payment.js +673 -181
- package/dist/settings.js +51 -42
- package/dist/utils/index.js +21 -1
- package/dist/utils/paysafecard.js +58 -0
- package/dist/utils/quickpay.js +123 -0
- package/package.json +1 -1
- package/src/api.js +10 -11
- package/src/currency.js +2 -0
- package/src/currency.test.js +7 -0
- package/src/payment.js +221 -4
- package/src/settings.js +67 -41
- package/src/settings.test.js +4 -0
- package/src/utils/index.js +18 -0
- package/src/utils/paysafecard.js +23 -0
- package/src/utils/quickpay.js +35 -0
- package/test/page/components/sidebar/sidebar.js +2 -0
- package/test/page/containers/payment/payment.js +20 -0
- package/test/page/containers/payment/paysafecard.js +101 -0
- package/test/page/containers/payment/quickpay.js +101 -0
package/dist/api.js
CHANGED
|
@@ -121,19 +121,19 @@ function _request() {
|
|
|
121
121
|
var id,
|
|
122
122
|
data,
|
|
123
123
|
opt,
|
|
124
|
+
allOptions,
|
|
125
|
+
session,
|
|
126
|
+
locale,
|
|
127
|
+
currency,
|
|
128
|
+
baseUrl,
|
|
124
129
|
reqMethod,
|
|
125
130
|
reqUrl,
|
|
126
131
|
reqData,
|
|
127
|
-
allOptions,
|
|
128
|
-
baseUrl,
|
|
129
132
|
reqBody,
|
|
130
133
|
exQuery,
|
|
131
134
|
_reqUrl$split,
|
|
132
135
|
_reqUrl$split2,
|
|
133
136
|
fullQuery,
|
|
134
|
-
session,
|
|
135
|
-
locale,
|
|
136
|
-
currency,
|
|
137
137
|
reqHeaders,
|
|
138
138
|
response,
|
|
139
139
|
responseSession,
|
|
@@ -149,6 +149,11 @@ function _request() {
|
|
|
149
149
|
id = _args.length > 2 && _args[2] !== undefined ? _args[2] : undefined;
|
|
150
150
|
data = _args.length > 3 && _args[3] !== undefined ? _args[3] : undefined;
|
|
151
151
|
opt = _args.length > 4 && _args[4] !== undefined ? _args[4] : undefined;
|
|
152
|
+
allOptions = _objectSpread(_objectSpread({}, options), opt);
|
|
153
|
+
session = allOptions.session || getCookie('swell-session');
|
|
154
|
+
locale = allOptions.locale || getCookie('swell-locale');
|
|
155
|
+
currency = allOptions.currency || getCookie('swell-currency');
|
|
156
|
+
baseUrl = "".concat(allOptions.url).concat(allOptions.base || '', "/api");
|
|
152
157
|
reqMethod = String(method).toLowerCase();
|
|
153
158
|
reqUrl = url;
|
|
154
159
|
reqData = id;
|
|
@@ -158,8 +163,6 @@ function _request() {
|
|
|
158
163
|
reqData = data;
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
allOptions = _objectSpread(_objectSpread({}, options), opt);
|
|
162
|
-
baseUrl = "".concat(allOptions.url).concat(allOptions.base || '', "/api");
|
|
163
166
|
reqUrl = allOptions.fullUrl || "".concat(baseUrl, "/").concat(trimBoth(reqUrl));
|
|
164
167
|
reqData = allOptions.useCamelCase ? toSnake(reqData) : reqData;
|
|
165
168
|
|
|
@@ -174,9 +177,6 @@ function _request() {
|
|
|
174
177
|
reqBody = JSON.stringify(reqData);
|
|
175
178
|
}
|
|
176
179
|
|
|
177
|
-
session = allOptions.session || getCookie('swell-session');
|
|
178
|
-
locale = allOptions.locale || getCookie('swell-locale');
|
|
179
|
-
currency = allOptions.currency || getCookie('swell-currency');
|
|
180
180
|
reqHeaders = _objectSpread(_objectSpread(_objectSpread({
|
|
181
181
|
'Content-Type': 'application/json',
|
|
182
182
|
Authorization: "Basic ".concat(base64Encode(String(allOptions.key)))
|
|
@@ -246,7 +246,7 @@ function _request() {
|
|
|
246
246
|
|
|
247
247
|
if (typeof window !== 'undefined') {
|
|
248
248
|
window.swell = {
|
|
249
|
-
version: '3.
|
|
249
|
+
version: '3.12.2'
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
|
package/dist/currency.js
CHANGED
|
@@ -110,9 +110,11 @@ function methods(request, opt) {
|
|
|
110
110
|
var formatRate = params.rate || rate;
|
|
111
111
|
var formatLocale = params.locale || this.locale;
|
|
112
112
|
var formatDecimals = typeof params.decimals === 'number' ? params.decimals : decimals;
|
|
113
|
+
var _params$convert = params.convert,
|
|
114
|
+
convert = _params$convert === void 0 ? true : _params$convert;
|
|
113
115
|
var formatAmount = amount;
|
|
114
116
|
|
|
115
|
-
if ((type === 'display' || params.rate) && typeof formatAmount === 'number' && typeof formatRate === 'number') {
|
|
117
|
+
if (convert && (type === 'display' || params.rate) && typeof formatAmount === 'number' && typeof formatRate === 'number') {
|
|
116
118
|
// Convert the price currency into the display currency
|
|
117
119
|
formatAmount = this.applyRounding(amount * formatRate, state);
|
|
118
120
|
}
|