@ikonintegration/mod-license-client 2.0.24 → 2.0.26
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/lib/operations/Order.js
CHANGED
|
@@ -6,97 +6,100 @@ export default class Order {
|
|
|
6
6
|
return product.allowedProviders[0].toLowerCase();
|
|
7
7
|
}
|
|
8
8
|
isMonerisEnabledForProduct(product) {
|
|
9
|
-
return
|
|
9
|
+
return this.getProviderFromProduct(product).indexOf("moneris") != -1;
|
|
10
10
|
}
|
|
11
11
|
isBraintreeEnabledForProduct(product) {
|
|
12
|
-
return
|
|
12
|
+
return this.getProviderFromProduct(product).indexOf("braintree") != -1;
|
|
13
|
+
}
|
|
14
|
+
isStripeEnabledForProduct(product) {
|
|
15
|
+
return this.getProviderFromProduct(product).indexOf("stripe") != -1;
|
|
13
16
|
}
|
|
14
17
|
//CC/Skip order
|
|
15
18
|
async preOrder(orderObj) {
|
|
16
|
-
const req = await this.api.newBaseRequest(
|
|
19
|
+
const req = await this.api.newBaseRequest("POST");
|
|
17
20
|
req.path = `/order/pre/common`;
|
|
18
21
|
req.body = orderObj;
|
|
19
22
|
return await req.exec();
|
|
20
23
|
}
|
|
21
24
|
async beginOrder(orderObj, provider) {
|
|
22
|
-
const req = await this.api.newBaseRequest(
|
|
25
|
+
const req = await this.api.newBaseRequest("POST");
|
|
23
26
|
req.path = `/order/begin/${provider}`;
|
|
24
27
|
req.body = orderObj;
|
|
25
28
|
return await req.exec();
|
|
26
29
|
}
|
|
27
30
|
async completeOrder(orderObj, provider) {
|
|
28
|
-
const req = await this.api.newBaseRequest(
|
|
31
|
+
const req = await this.api.newBaseRequest("POST");
|
|
29
32
|
req.path = `/order/complete/${provider}`;
|
|
30
33
|
req.body = orderObj;
|
|
31
34
|
return await req.exec();
|
|
32
35
|
}
|
|
33
36
|
async refundOrder(orderObj, provider) {
|
|
34
|
-
const req = await this.api.newBaseRequest(
|
|
37
|
+
const req = await this.api.newBaseRequest("POST");
|
|
35
38
|
req.path = `/order/refund/${provider}`;
|
|
36
39
|
req.body = orderObj;
|
|
37
40
|
return await req.exec();
|
|
38
41
|
}
|
|
39
42
|
async cancelOrder(orderObj, provider) {
|
|
40
|
-
const req = await this.api.newBaseRequest(
|
|
43
|
+
const req = await this.api.newBaseRequest("POST");
|
|
41
44
|
req.path = `/order/cancel/${provider}`;
|
|
42
45
|
req.body = orderObj;
|
|
43
46
|
return await req.exec();
|
|
44
47
|
}
|
|
45
48
|
//Invoice
|
|
46
49
|
async submitInvoiceOrder(orderObj) {
|
|
47
|
-
const req = await this.api.newBaseRequest(
|
|
48
|
-
req.path =
|
|
50
|
+
const req = await this.api.newBaseRequest("POST");
|
|
51
|
+
req.path = "/order/invoice";
|
|
49
52
|
req.body = orderObj;
|
|
50
53
|
return await req.exec();
|
|
51
54
|
}
|
|
52
55
|
async approveInvoiceOrder(orderObj) {
|
|
53
|
-
const req = await this.api.newBaseRequest(
|
|
54
|
-
req.path =
|
|
56
|
+
const req = await this.api.newBaseRequest("POST");
|
|
57
|
+
req.path = "/order/invoice/approve";
|
|
55
58
|
req.body = orderObj;
|
|
56
59
|
return await req.exec();
|
|
57
60
|
}
|
|
58
61
|
async rejectInvoiceOrder(orderObj) {
|
|
59
|
-
const req = await this.api.newBaseRequest(
|
|
60
|
-
req.path =
|
|
62
|
+
const req = await this.api.newBaseRequest("POST");
|
|
63
|
+
req.path = "/order/invoice/reject";
|
|
61
64
|
req.body = orderObj;
|
|
62
65
|
return await req.exec();
|
|
63
66
|
}
|
|
64
67
|
//Get order(s)
|
|
65
68
|
async getOrder(externalID, orderID) {
|
|
66
|
-
const req = await this.api.newBaseRequest(
|
|
69
|
+
const req = await this.api.newBaseRequest("GET");
|
|
67
70
|
req.path = `/order/${externalID}/${orderID}`;
|
|
68
71
|
return await req.exec();
|
|
69
72
|
}
|
|
70
73
|
async getOrdersByExternalID(externalID) {
|
|
71
|
-
const req = await this.api.newBaseRequest(
|
|
72
|
-
req.path =
|
|
74
|
+
const req = await this.api.newBaseRequest("GET");
|
|
75
|
+
req.path = "/orders/" + externalID;
|
|
73
76
|
return await req.exec();
|
|
74
77
|
}
|
|
75
78
|
async getOrdersFromToTimestamp(from, to) {
|
|
76
|
-
const req = await this.api.newBaseRequest(
|
|
77
|
-
req.path =
|
|
78
|
-
req.appendQueryParam(
|
|
79
|
-
req.appendQueryParam(
|
|
79
|
+
const req = await this.api.newBaseRequest("GET");
|
|
80
|
+
req.path = "/orders/report";
|
|
81
|
+
req.appendQueryParam("from", from);
|
|
82
|
+
req.appendQueryParam("to", to);
|
|
80
83
|
return await req.exec();
|
|
81
84
|
}
|
|
82
85
|
async getOrdersByExternalID(externalID) {
|
|
83
|
-
const req = await this.api.newBaseRequest(
|
|
84
|
-
req.path =
|
|
86
|
+
const req = await this.api.newBaseRequest("GET");
|
|
87
|
+
req.path = "/orders/" + externalID;
|
|
85
88
|
return await req.exec();
|
|
86
89
|
}
|
|
87
90
|
async getPendingOrders() {
|
|
88
|
-
const req = await this.api.newBaseRequest(
|
|
89
|
-
req.path =
|
|
91
|
+
const req = await this.api.newBaseRequest("GET");
|
|
92
|
+
req.path = "/orders/invoices";
|
|
90
93
|
return await req.exec();
|
|
91
94
|
}
|
|
92
95
|
async getOrderReceipt(externalID, orderID) {
|
|
93
|
-
const req = await this.api.newBaseRequest(
|
|
96
|
+
const req = await this.api.newBaseRequest("GET");
|
|
94
97
|
req.path = `/order/${externalID}/${orderID}/receipt`;
|
|
95
|
-
req.bodyType =
|
|
98
|
+
req.bodyType = "BINARY";
|
|
96
99
|
return await req.exec();
|
|
97
100
|
}
|
|
98
101
|
async getOrderByID(orderID) {
|
|
99
|
-
const req = await this.api.newBaseRequest(
|
|
102
|
+
const req = await this.api.newBaseRequest("GET");
|
|
100
103
|
req.path = `/order/${orderID}`;
|
|
101
104
|
return await req.exec();
|
|
102
105
|
}
|
|
@@ -11,6 +11,9 @@ export default class Order {
|
|
|
11
11
|
isBraintreeEnabledForProduct(product) {
|
|
12
12
|
return this.getProviderFromProduct(product).indexOf("braintree") != -1;
|
|
13
13
|
}
|
|
14
|
+
isStripeEnabledForProduct(product) {
|
|
15
|
+
return this.getProviderFromProduct(product).indexOf("stripe") != -1;
|
|
16
|
+
}
|
|
14
17
|
//CC/Skip order
|
|
15
18
|
async preOrder(productOrderObj) {
|
|
16
19
|
const req = await this.api.newBaseRequest("POST");
|
|
@@ -41,6 +44,12 @@ export default class Order {
|
|
|
41
44
|
req.body = productOrderObj;
|
|
42
45
|
return await req.exec();
|
|
43
46
|
}
|
|
47
|
+
async refundOrder(productOrderObj, provider) {
|
|
48
|
+
const req = await this.api.newBaseRequest("POST");
|
|
49
|
+
req.path = `/productOrder/refund/${provider}`;
|
|
50
|
+
req.body = productOrderObj;
|
|
51
|
+
return await req.exec();
|
|
52
|
+
}
|
|
44
53
|
//Get order(s)
|
|
45
54
|
async getProductOrder(externalID, orderID) {
|
|
46
55
|
const req = await this.api.newBaseRequest("GET");
|