@smartsoft001/payu 2.127.0 → 2.128.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/index.js +6 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,8 +5,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
5
5
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
6
|
if (decorator = decorators[i])
|
|
7
7
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
9
|
return result;
|
|
11
10
|
};
|
|
12
11
|
|
|
@@ -33,6 +32,9 @@ var PayuService = class {
|
|
|
33
32
|
this.config = config;
|
|
34
33
|
this.moduleRef = moduleRef;
|
|
35
34
|
}
|
|
35
|
+
httpService;
|
|
36
|
+
config;
|
|
37
|
+
moduleRef;
|
|
36
38
|
async create(obj) {
|
|
37
39
|
const config = await this.getConfig(obj.data);
|
|
38
40
|
const token = await this.getToken(config);
|
|
@@ -99,8 +101,7 @@ var PayuService = class {
|
|
|
99
101
|
},
|
|
100
102
|
maxRedirects: 0
|
|
101
103
|
}).toPromise();
|
|
102
|
-
if (!response.data.orders)
|
|
103
|
-
return null;
|
|
104
|
+
if (!response.data.orders) return null;
|
|
104
105
|
const order = response.data.orders[0];
|
|
105
106
|
return {
|
|
106
107
|
status: this.getStatusFromExternal(order.status),
|
|
@@ -166,8 +167,7 @@ var PayuService = class {
|
|
|
166
167
|
return this.config;
|
|
167
168
|
}
|
|
168
169
|
getBaseUrl(config) {
|
|
169
|
-
if (config.test)
|
|
170
|
-
return "https://secure.snd.payu.com";
|
|
170
|
+
if (config.test) return "https://secure.snd.payu.com";
|
|
171
171
|
return "https://secure.payu.com";
|
|
172
172
|
}
|
|
173
173
|
getStatusFromExternal(status) {
|