tradly 1.1.58 → 1.1.59
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/Constants/PathConstant.js +1 -0
- package/Roots/App.js +47 -0
- package/package.json +1 -1
|
@@ -118,6 +118,7 @@ export const COMMISSIONS = "/v1/commissions";
|
|
|
118
118
|
export const LOGOUT = "/v1/users/logout";
|
|
119
119
|
|
|
120
120
|
export const SUBSCRIPTION = "/v1/subscriptions/subscribe";
|
|
121
|
+
export const SUBSCRIPTION_LISTINGS = "/v1/subscription_products";
|
|
121
122
|
export const SUBSCRIPTION_CONFIRM = "/v1/subscriptions/subscribe/confirm";
|
|
122
123
|
export const SUBSCRIPTION_MANAGE = "/v1/subscriptions/manage";
|
|
123
124
|
export const SUBSCRIPTION_EMAIL_TRIGGER = "/v1/subscriptions/email_trigger";
|
package/Roots/App.js
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
SAVED_CARD,
|
|
81
81
|
SHIPMENTS,
|
|
82
82
|
STATES,
|
|
83
|
+
SUBSCRIPTION_LISTINGS,
|
|
83
84
|
} from "./../Constants/PathConstant.js";
|
|
84
85
|
import serialization from "../Helper/Serialization.js";
|
|
85
86
|
import { ImageConfig } from "../Helper/APIParam.js";
|
|
@@ -3611,6 +3612,52 @@ class App {
|
|
|
3611
3612
|
return error;
|
|
3612
3613
|
}
|
|
3613
3614
|
}
|
|
3615
|
+
|
|
3616
|
+
// get subscription
|
|
3617
|
+
async getSubscriptionList(param = { authKey, bodyParam }) {
|
|
3618
|
+
let url =
|
|
3619
|
+
param.bodyParam == undefined || param.bodyParam == ""
|
|
3620
|
+
? ""
|
|
3621
|
+
: `?${serialization(param.bodyParam)}`;
|
|
3622
|
+
try {
|
|
3623
|
+
const [error, responseJson] = await network.networkCall({
|
|
3624
|
+
path: `${SUBSCRIPTION_LISTINGS}${url}`,
|
|
3625
|
+
method: Method.GET,
|
|
3626
|
+
authKey: param.authKey,
|
|
3627
|
+
currency: param.currency,
|
|
3628
|
+
language: param.language,
|
|
3629
|
+
});
|
|
3630
|
+
if (error) {
|
|
3631
|
+
return error;
|
|
3632
|
+
} else {
|
|
3633
|
+
return responseJson;
|
|
3634
|
+
}
|
|
3635
|
+
} catch (error) {
|
|
3636
|
+
return error;
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
// get subscription details
|
|
3641
|
+
async getSubscriptionDetails(param = { listing_id, authKey }) {
|
|
3642
|
+
try {
|
|
3643
|
+
const [error, responseJson] = await network.networkCall({
|
|
3644
|
+
path: `${SUBSCRIPTION_LISTINGS}/${param.listing_id}`,
|
|
3645
|
+
method: Method.GET,
|
|
3646
|
+
authKey: param.authKey,
|
|
3647
|
+
currency: param.currency,
|
|
3648
|
+
language: param.language,
|
|
3649
|
+
});
|
|
3650
|
+
if (error) {
|
|
3651
|
+
return error;
|
|
3652
|
+
} else {
|
|
3653
|
+
return responseJson;
|
|
3654
|
+
}
|
|
3655
|
+
} catch (error) {
|
|
3656
|
+
return error;
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
// post subscription
|
|
3614
3661
|
}
|
|
3615
3662
|
const app = new App();
|
|
3616
3663
|
export default app;
|