@ikonintegration/mod-license-client 0.4.4 → 0.4.7
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/README.md +3 -0
- package/lib/operations/License.js +11 -0
- package/lib/operations/Order.js +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ The following header must be specified in every request!
|
|
|
47
47
|
**Order:**
|
|
48
48
|
- API.order.getProviderFromProduct(productObject) - Return provider from product
|
|
49
49
|
- API.order.isMonerisEnabledForProduct(productObject) - Return of Moneris is enabled for this provider.
|
|
50
|
+
- API.order.preOrder(orderObj) - Admin and users
|
|
50
51
|
- API.order.beginOrder(orderObj, provider) - Admin and users
|
|
51
52
|
- API.order.completeOrder(orderObj, provider) - Admin and users
|
|
52
53
|
- API.order.refundOrder(orderObj, provider) - Admin and users
|
|
@@ -61,8 +62,10 @@ The following header must be specified in every request!
|
|
|
61
62
|
|
|
62
63
|
**License:**
|
|
63
64
|
- API.license.redeemLicense(activationCode, productID) - Service only
|
|
65
|
+
- API.license.redeemLicenseByProduct(productID, externalID) - Service only
|
|
64
66
|
- API.license.revokeLicense(licenseID) - Admin only
|
|
65
67
|
- API.license.revokeLicenses(licenseIDs) - Admin only
|
|
68
|
+
- API.license.getLicenseByID(licenseID) - Admin, users and services
|
|
66
69
|
- API.license.getLicense(licenseID, externalID) - Admin, users and services
|
|
67
70
|
- API.license.getLicensesByExternalID(externalID) - Admin, users and services
|
|
68
71
|
- API.license.getLicensesByExternalIDs(externalIDs) - Admin and services
|
|
@@ -2,6 +2,12 @@ export default class License {
|
|
|
2
2
|
constructor(API) {
|
|
3
3
|
this.api = API;
|
|
4
4
|
}
|
|
5
|
+
async redeemLicenseByProduct(productID, externalID) {
|
|
6
|
+
const req = await this.api.newBaseRequest('POST');
|
|
7
|
+
req.path = '/license/redeem/available';
|
|
8
|
+
req.body = { productID, externalID };
|
|
9
|
+
return await req.exec();
|
|
10
|
+
}
|
|
5
11
|
async redeemLicense(activationCode, productID, externalID) {
|
|
6
12
|
const req = await this.api.newBaseRequest('POST');
|
|
7
13
|
req.path = '/license/redeem';
|
|
@@ -19,6 +25,11 @@ export default class License {
|
|
|
19
25
|
req.body = { licenseIDs };
|
|
20
26
|
return await req.exec();
|
|
21
27
|
}
|
|
28
|
+
async getLicenseByID(licenseID) {
|
|
29
|
+
const req = await this.api.newBaseRequest('GET');
|
|
30
|
+
req.path = `/license/${licenseID}`;
|
|
31
|
+
return await req.exec();
|
|
32
|
+
}
|
|
22
33
|
async getLicense(licenseID, externalID) {
|
|
23
34
|
const req = await this.api.newBaseRequest('GET');
|
|
24
35
|
req.path = '/license/' + licenseID + '/' + externalID;
|
package/lib/operations/Order.js
CHANGED
|
@@ -9,6 +9,12 @@ export default class Order {
|
|
|
9
9
|
return (this.getProviderFromProduct(product).indexOf('moneris') != -1);
|
|
10
10
|
}
|
|
11
11
|
//CC/Skip order
|
|
12
|
+
async preOrder(orderObj) {
|
|
13
|
+
const req = await this.api.newBaseRequest('POST');
|
|
14
|
+
req.path = `/order/pre/common`;
|
|
15
|
+
req.body = orderObj;
|
|
16
|
+
return await req.exec();
|
|
17
|
+
}
|
|
12
18
|
async beginOrder(orderObj, provider) {
|
|
13
19
|
const req = await this.api.newBaseRequest('POST');
|
|
14
20
|
req.path = `/order/begin/${provider}`;
|
|
@@ -53,11 +59,6 @@ export default class Order {
|
|
|
53
59
|
return await req.exec();
|
|
54
60
|
}
|
|
55
61
|
//Get order(s)
|
|
56
|
-
async getOrderByID(orderID) {
|
|
57
|
-
const req = await this.api.newBaseRequest('GET');
|
|
58
|
-
req.path = `/order/${orderID}`;
|
|
59
|
-
return await req.exec();
|
|
60
|
-
}
|
|
61
62
|
async getOrder(externalID, orderID) {
|
|
62
63
|
const req = await this.api.newBaseRequest('GET');
|
|
63
64
|
req.path = `/order/${externalID}/${orderID}`;
|