tradly 1.0.91 → 1.0.93

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.
@@ -105,3 +105,14 @@ export const ACTIVITIES = "/v1/activities";
105
105
  export const COMMISSIONS = "/v1/commissions";
106
106
 
107
107
  export const LOGOUT = "/v1/users/logout";
108
+
109
+ export const SUBSCRIPTION = "/v1/subscriptions/subscribe";
110
+ export const SUBSCRIPTION_CONFIRM = "/v1/subscriptions/subscribe/confirm";
111
+ export const SUBSCRIPTION_MANAGE = "/v1/subscriptions/manage";
112
+ export const SUBSCRIPTION_EMAIL_TRIGGER = "/v1/subscriptions/email_trigger";
113
+
114
+ export const MANGO_PAY = "/app/v1/payments/mangopay";
115
+
116
+ export const OPP_MERCHANT = "/v1/payments/opp/merchant";
117
+
118
+ export const TIME_SLOT = "v1/timeslots";
package/Roots/App.js CHANGED
@@ -62,6 +62,12 @@ import {
62
62
  ACTIVITIES,
63
63
  COMMISSIONS,
64
64
  LOGOUT,
65
+ SUBSCRIPTION,
66
+ SUBSCRIPTION_CONFIRM,
67
+ SUBSCRIPTION_MANAGE,
68
+ MANGO_PAY,
69
+ TIME_SLOT,
70
+ OPP_MERCHANT,
65
71
  } from "./../Constants/PathConstant.js";
66
72
  import serialization from "../Helper/Serialization.js";
67
73
  import { ImageConfig } from "../Helper/APIParam.js";
@@ -913,6 +919,46 @@ class App {
913
919
  return error;
914
920
  }
915
921
  }
922
+ async getListingVariants(param = { authKey, listingId }) {
923
+ try {
924
+ const [error, responseJson] = await network.networkCall({
925
+ path: LISTINGS + `/${param.listingId}` + VARIANTS,
926
+ method: Method.GET,
927
+ authKey: param.authKey,
928
+ currency: param.currency,
929
+ });
930
+ if (error) {
931
+ return error;
932
+ } else {
933
+ return responseJson;
934
+ }
935
+ } catch (error) {
936
+ return error;
937
+ }
938
+ }
939
+ async getListingVariantDetails(
940
+ param = { authKey, listingId, variant_id }
941
+ ) {
942
+ try {
943
+ const [error, responseJson] = await network.networkCall({
944
+ path:
945
+ LISTINGS +
946
+ `/${param.listingId}` +
947
+ VARIANTS +
948
+ `/${param.variant_id}`,
949
+ method: Method.GET,
950
+ authKey: param.authKey,
951
+ currency: param.currency,
952
+ });
953
+ if (error) {
954
+ return error;
955
+ } else {
956
+ return responseJson;
957
+ }
958
+ } catch (error) {
959
+ return error;
960
+ }
961
+ }
916
962
  async addEditVariants(param = { authKey, listingId, id, data }) {
917
963
  let method =
918
964
  param.id == undefined || param.id == ""
@@ -2325,6 +2371,211 @@ class App {
2325
2371
  return error;
2326
2372
  }
2327
2373
  }
2374
+
2375
+ //MARK:-  SUBSCRIPTIONS API 
2376
+ async subscribe(param = { authKey, bodyParam }) {
2377
+ let url =
2378
+ param.bodyParam == undefined || param.bodyParam == ""
2379
+ ? ""
2380
+ : `?${serialization(param.bodyParam)}`;
2381
+ try {
2382
+ const [error, responseJson] = await network.networkCall({
2383
+ path: SUBSCRIPTION + url,
2384
+ method: Method.GET,
2385
+ authKey: param.authKey,
2386
+ currency: param.currency,
2387
+ });
2388
+ if (error) {
2389
+ return error;
2390
+ } else {
2391
+ return responseJson;
2392
+ }
2393
+ } catch (error) {
2394
+ return error;
2395
+ }
2396
+ }
2397
+ async productSubscription(param = { authKey, bodyParam }) {
2398
+ let url =
2399
+ param.bodyParam == undefined || param.bodyParam == ""
2400
+ ? ""
2401
+ : `?${serialization(param.bodyParam)}`;
2402
+ try {
2403
+ const [error, responseJson] = await network.networkCall({
2404
+ path: SUBSCRIPTION + `/products` + url,
2405
+ method: Method.GET,
2406
+ authKey: param.authKey,
2407
+ currency: param.currency,
2408
+ });
2409
+ if (error) {
2410
+ return error;
2411
+ } else {
2412
+ return responseJson;
2413
+ }
2414
+ } catch (error) {
2415
+ return error;
2416
+ }
2417
+ }
2418
+ async subscriptionConfirm(param = { authKey, data }) {
2419
+ try {
2420
+ const [error, responseJson] = await network.networkCall({
2421
+ path: SUBSCRIPTION_CONFIRM,
2422
+ method: Method.POST,
2423
+ authKey: param.authKey,
2424
+ currency: param.currency,
2425
+ param: param.data,
2426
+ });
2427
+ if (error) {
2428
+ return error;
2429
+ } else {
2430
+ return responseJson;
2431
+ }
2432
+ } catch (error) {
2433
+ return error;
2434
+ }
2435
+ }
2436
+ async manageSubscriptionLink(param = { authKey, data }) {
2437
+ try {
2438
+ const [error, responseJson] = await network.networkCall({
2439
+ path: SUBSCRIPTION_MANAGE,
2440
+ method: Method.POST,
2441
+ authKey: param.authKey,
2442
+ currency: param.currency,
2443
+ param: param.data,
2444
+ });
2445
+ if (error) {
2446
+ return error;
2447
+ } else {
2448
+ return responseJson;
2449
+ }
2450
+ } catch (error) {
2451
+ return error;
2452
+ }
2453
+ }
2454
+
2455
+ //MARK:-  Mango Pay API 
2456
+ async getKycDetails(param = { authKey, bodyParam }) {
2457
+ let url =
2458
+ param.bodyParam == undefined || param.bodyParam == ""
2459
+ ? ""
2460
+ : `?${serialization(param.bodyParam)}`;
2461
+ try {
2462
+ const [error, responseJson] = await network.networkCall({
2463
+ path: MANGO_PAY + `/kyc_details` + url,
2464
+ method: Method.GET,
2465
+ authKey: param.authKey,
2466
+ currency: param.currency,
2467
+ });
2468
+ if (error) {
2469
+ return error;
2470
+ } else {
2471
+ return responseJson;
2472
+ }
2473
+ } catch (error) {
2474
+ return error;
2475
+ }
2476
+ }
2477
+
2478
+ async storeBankDetails(param = { authKey, data, id }) {
2479
+ try {
2480
+ const [error, responseJson] = await network.networkCall({
2481
+ path: MANGO_PAY + `/bank_details/${param.id}`,
2482
+ method: Method.POST,
2483
+ authKey: param.authKey,
2484
+ currency: param.currency,
2485
+ param: param.data,
2486
+ });
2487
+ if (error) {
2488
+ return error;
2489
+ } else {
2490
+ return responseJson;
2491
+ }
2492
+ } catch (error) {
2493
+ return error;
2494
+ }
2495
+ }
2496
+ async submitKYCDocument(param = { authKey, data }) {
2497
+ try {
2498
+ const [error, responseJson] = await network.networkCall({
2499
+ path: MANGO_PAY + `/kyc_document`,
2500
+ method: Method.POST,
2501
+ authKey: param.authKey,
2502
+ currency: param.currency,
2503
+ param: param.data,
2504
+ });
2505
+ if (error) {
2506
+ return error;
2507
+ } else {
2508
+ return responseJson;
2509
+ }
2510
+ } catch (error) {
2511
+ return error;
2512
+ }
2513
+ }
2514
+
2515
+ // TIMESLOT
2516
+ async getTimeSlots(param = { authKey, bodyParam }) {
2517
+ let url =
2518
+ param.bodyParam == undefined || param.bodyParam == ""
2519
+ ? ""
2520
+ : `?${serialization(param.bodyParam)}`;
2521
+ try {
2522
+ const [error, responseJson] = await network.networkCall({
2523
+ path: TIME_SLOT + url,
2524
+ method: Method.GET,
2525
+ authKey: param.authKey,
2526
+ currency: param.currency,
2527
+ });
2528
+ if (error) {
2529
+ return error;
2530
+ } else {
2531
+ return responseJson;
2532
+ }
2533
+ } catch (error) {
2534
+ return error;
2535
+ }
2536
+ }
2537
+
2538
+ //MARK:-  OPP MERCHANT API 
2539
+ async getMerchantDetails(param = { authKey, bodyParam }) {
2540
+ let url =
2541
+ param.bodyParam == undefined || param.bodyParam == ""
2542
+ ? ""
2543
+ : `?${serialization(param.bodyParam)}`;
2544
+ try {
2545
+ const [error, responseJson] = await network.networkCall({
2546
+ path: OPP_MERCHANT + `/account` + url,
2547
+ method: Method.GET,
2548
+ authKey: param.authKey,
2549
+ currency: param.currency,
2550
+ });
2551
+ if (error) {
2552
+ return error;
2553
+ } else {
2554
+ return responseJson;
2555
+ }
2556
+ } catch (error) {
2557
+ return error;
2558
+ }
2559
+ }
2560
+
2561
+ async createNewMerchant(param = { authKey, data }) {
2562
+ try {
2563
+ const [error, responseJson] = await network.networkCall({
2564
+ path: OPP_MERCHANT + `/bank_account`,
2565
+ method: Method.POST,
2566
+ authKey: param.authKey,
2567
+ currency: param.currency,
2568
+ param: param.data,
2569
+ });
2570
+ if (error) {
2571
+ return error;
2572
+ } else {
2573
+ return responseJson;
2574
+ }
2575
+ } catch (error) {
2576
+ return error;
2577
+ }
2578
+ }
2328
2579
  }
2329
2580
  const app = new App();
2330
2581
  export default app;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tradly",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
4
4
  "description": "Tradly JS SDK",
5
5
  "main": "index.js",
6
6
  "type": "module",