@selfcommunity/api-services 0.6.7-payments.143 → 0.6.7-payments.147

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.
@@ -1603,6 +1603,10 @@ const Endpoints = {
1603
1603
  CheckoutSessionComplete: {
1604
1604
  url: (0, utils_1.urlReplacer)('/api/v2/payments/checkout_session/complete/'),
1605
1605
  method: 'POST'
1606
+ },
1607
+ GetPaymentOrders: {
1608
+ url: (0, utils_1.urlReplacer)('/api/v2/payments/order/'),
1609
+ method: 'GET'
1606
1610
  }
1607
1611
  };
1608
1612
  exports.default = Endpoints;
@@ -2,8 +2,7 @@ import { SCPaymentProduct, SCPaymentPrice } from '@selfcommunity/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
  import { BaseGetParams, SCPaginatedResponse } from '../../types';
4
4
  import { CheckoutCreateSessionParams, CheckoutSessionParams, ContentProductsParams } from '../../types/payment';
5
- import { SCCheckoutSession } from '@selfcommunity/types';
6
- import { SCCheckoutSessionDetail } from '@selfcommunity/types';
5
+ import { SCCheckoutSession, SCPaymentOrder, SCCheckoutSessionDetail } from '@selfcommunity/types';
7
6
  export interface PaymentApiClientInterface {
8
7
  /**
9
8
  * Get paywall products related to an object of type <content_type> and id <content_id>
@@ -36,6 +35,12 @@ export interface PaymentApiClientInterface {
36
35
  * @param config
37
36
  */
38
37
  checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
38
+ /**
39
+ * This endpoint retrive order history of authenticated user
40
+ * @param params
41
+ * @param config
42
+ */
43
+ getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
39
44
  }
40
45
  /**
41
46
  * Contains all the endpoints needed to manage payments.
@@ -72,6 +77,12 @@ export declare class PaymentApiClient {
72
77
  * @param config
73
78
  */
74
79
  static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
80
+ /**
81
+ * This endpoint retrive order history of authenticated user
82
+ * @param params
83
+ * @param config
84
+ */
85
+ static getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
75
86
  }
76
87
  /**
77
88
  *
@@ -114,4 +125,5 @@ export default class PaymentService {
114
125
  static checkoutCreateSession(data: CheckoutCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSession>;
115
126
  static getCheckoutSession(params?: CheckoutSessionParams, config?: AxiosRequestConfig): Promise<SCCheckoutSessionDetail>;
116
127
  static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
128
+ static getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
117
129
  }
@@ -53,6 +53,14 @@ class PaymentApiClient {
53
53
  static checkoutCompleteSession(data, config) {
54
54
  return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CheckoutSessionComplete.url({}), method: Endpoints_1.default.CheckoutSessionComplete.method, data }));
55
55
  }
56
+ /**
57
+ * This endpoint retrive order history of authenticated user
58
+ * @param params
59
+ * @param config
60
+ */
61
+ static getPaymentsOrder(params, config) {
62
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetPaymentOrders.url({}), method: Endpoints_1.default.GetPaymentOrders.method }));
63
+ }
56
64
  }
57
65
  exports.PaymentApiClient = PaymentApiClient;
58
66
  /**
@@ -116,5 +124,8 @@ class PaymentService {
116
124
  return PaymentApiClient.checkoutCompleteSession(data, config);
117
125
  });
118
126
  }
127
+ static getPaymentsOrder(params, config) {
128
+ return PaymentApiClient.getPaymentsOrder(params, config);
129
+ }
119
130
  }
120
131
  exports.default = PaymentService;
@@ -1,4 +1,4 @@
1
- import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
1
+ import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPaymentOrder, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
2
2
  import { BaseGetParams, SCPaginatedResponse, UserAutocompleteParams, UserGetParams, UserSearchParams } from '../../types';
3
3
  import { AxiosRequestConfig } from 'axios';
4
4
  import { DeleteProviderAssociation } from '../../types/user';
@@ -55,8 +55,8 @@ export interface UserApiClientInterface {
55
55
  createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
56
56
  deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
57
57
  getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
58
- getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any[]>;
59
- getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any>;
58
+ getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder[]>;
59
+ getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
60
60
  }
61
61
  /**
62
62
  * Contains all the endpoints needed to manage users.
@@ -397,10 +397,11 @@ export declare class UserApiClient {
397
397
  /**
398
398
  * This endpoint retrieve all order history of authenticated user
399
399
  *
400
+ * @param id
400
401
  * @param params
401
402
  * @param config
402
403
  */
403
- static getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
404
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
404
405
  /**
405
406
  * This endpoint retrieve detail of an order
406
407
  * @param id
@@ -408,7 +409,7 @@ export declare class UserApiClient {
408
409
  * @param params
409
410
  * @param config
410
411
  */
411
- static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any>;
412
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
412
413
  }
413
414
  /**
414
415
  *
@@ -500,6 +501,6 @@ export default class UserService {
500
501
  static createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
501
502
  static deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
502
503
  static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
503
- static getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
504
- static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
504
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
505
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
505
506
  }
@@ -463,11 +463,12 @@ class UserApiClient {
463
463
  /**
464
464
  * This endpoint retrieve all order history of authenticated user
465
465
  *
466
+ * @param id
466
467
  * @param params
467
468
  * @param config
468
469
  */
469
- static getOrderHistory(params, config) {
470
- return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetOrderHistory.url({}), method: Endpoints_1.default.GetOrderHistory.method, params }));
470
+ static getOrderHistory(id, params, config) {
471
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetOrderHistory.url({ id }), method: Endpoints_1.default.GetOrderHistory.method, params }));
471
472
  }
472
473
  /**
473
474
  * This endpoint retrieve detail of an order
@@ -779,9 +780,9 @@ class UserService {
779
780
  return UserApiClient.getUserLiveStream(id, params, config);
780
781
  });
781
782
  }
782
- static getOrderHistory(params, config) {
783
+ static getOrderHistory(id, params, config) {
783
784
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
784
- return UserApiClient.getOrderHistory(params, config);
785
+ return UserApiClient.getOrderHistory(id, params, config);
785
786
  });
786
787
  }
787
788
  static getOrderDetail(id, order, params, config) {
@@ -1601,6 +1601,10 @@ const Endpoints = {
1601
1601
  CheckoutSessionComplete: {
1602
1602
  url: urlReplacer('/api/v2/payments/checkout_session/complete/'),
1603
1603
  method: 'POST'
1604
+ },
1605
+ GetPaymentOrders: {
1606
+ url: urlReplacer('/api/v2/payments/order/'),
1607
+ method: 'GET'
1604
1608
  }
1605
1609
  };
1606
1610
  export default Endpoints;
@@ -2,8 +2,7 @@ import { SCPaymentProduct, SCPaymentPrice } from '@selfcommunity/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
  import { BaseGetParams, SCPaginatedResponse } from '../../types';
4
4
  import { CheckoutCreateSessionParams, CheckoutSessionParams, ContentProductsParams } from '../../types/payment';
5
- import { SCCheckoutSession } from '@selfcommunity/types';
6
- import { SCCheckoutSessionDetail } from '@selfcommunity/types';
5
+ import { SCCheckoutSession, SCPaymentOrder, SCCheckoutSessionDetail } from '@selfcommunity/types';
7
6
  export interface PaymentApiClientInterface {
8
7
  /**
9
8
  * Get paywall products related to an object of type <content_type> and id <content_id>
@@ -36,6 +35,12 @@ export interface PaymentApiClientInterface {
36
35
  * @param config
37
36
  */
38
37
  checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
38
+ /**
39
+ * This endpoint retrive order history of authenticated user
40
+ * @param params
41
+ * @param config
42
+ */
43
+ getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
39
44
  }
40
45
  /**
41
46
  * Contains all the endpoints needed to manage payments.
@@ -72,6 +77,12 @@ export declare class PaymentApiClient {
72
77
  * @param config
73
78
  */
74
79
  static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
80
+ /**
81
+ * This endpoint retrive order history of authenticated user
82
+ * @param params
83
+ * @param config
84
+ */
85
+ static getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
75
86
  }
76
87
  /**
77
88
  *
@@ -114,4 +125,5 @@ export default class PaymentService {
114
125
  static checkoutCreateSession(data: CheckoutCreateSessionParams | FormData, config?: AxiosRequestConfig): Promise<SCCheckoutSession>;
115
126
  static getCheckoutSession(params?: CheckoutSessionParams, config?: AxiosRequestConfig): Promise<SCCheckoutSessionDetail>;
116
127
  static checkoutCompleteSession(data: CheckoutSessionParams | FormData, config?: AxiosRequestConfig): Promise<any>;
128
+ static getPaymentsOrder(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
117
129
  }
@@ -50,6 +50,14 @@ export class PaymentApiClient {
50
50
  static checkoutCompleteSession(data, config) {
51
51
  return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CheckoutSessionComplete.url({}), method: Endpoints.CheckoutSessionComplete.method, data }));
52
52
  }
53
+ /**
54
+ * This endpoint retrive order history of authenticated user
55
+ * @param params
56
+ * @param config
57
+ */
58
+ static getPaymentsOrder(params, config) {
59
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetPaymentOrders.url({}), method: Endpoints.GetPaymentOrders.method }));
60
+ }
53
61
  }
54
62
  /**
55
63
  *
@@ -112,4 +120,7 @@ export default class PaymentService {
112
120
  return PaymentApiClient.checkoutCompleteSession(data, config);
113
121
  });
114
122
  }
123
+ static getPaymentsOrder(params, config) {
124
+ return PaymentApiClient.getPaymentsOrder(params, config);
125
+ }
115
126
  }
@@ -1,4 +1,4 @@
1
- import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
1
+ import { SCAvatarType, SCCategoryType, SCFeedUnitType, SCLiveStreamType, SCPaymentOrder, SCPlatformType, SCTagType, SCUserAutocompleteType, SCUserAvatarType, SCUserChangeEmailType, SCUserConnectionRequestType, SCUserConnectionStatusType, SCUserCounterType, SCUserEmailTokenType, SCUserFollowedStatusType, SCUserFollowerStatusType, SCUserHiddenByStatusType, SCUserHiddenStatusType, SCUserLoyaltyPointsType, SCUserPermissionType, SCUserProviderAssociationType, SCUserSettingsType, SCUserType } from '@selfcommunity/types';
2
2
  import { BaseGetParams, SCPaginatedResponse, UserAutocompleteParams, UserGetParams, UserSearchParams } from '../../types';
3
3
  import { AxiosRequestConfig } from 'axios';
4
4
  import { DeleteProviderAssociation } from '../../types/user';
@@ -55,8 +55,8 @@ export interface UserApiClientInterface {
55
55
  createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
56
56
  deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
57
57
  getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
58
- getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any[]>;
59
- getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any>;
58
+ getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder[]>;
59
+ getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
60
60
  }
61
61
  /**
62
62
  * Contains all the endpoints needed to manage users.
@@ -397,10 +397,11 @@ export declare class UserApiClient {
397
397
  /**
398
398
  * This endpoint retrieve all order history of authenticated user
399
399
  *
400
+ * @param id
400
401
  * @param params
401
402
  * @param config
402
403
  */
403
- static getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
404
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
404
405
  /**
405
406
  * This endpoint retrieve detail of an order
406
407
  * @param id
@@ -408,7 +409,7 @@ export declare class UserApiClient {
408
409
  * @param params
409
410
  * @param config
410
411
  */
411
- static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<any>;
412
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
412
413
  }
413
414
  /**
414
415
  *
@@ -500,6 +501,6 @@ export default class UserService {
500
501
  static createProviderAssociation(data: SCUserProviderAssociationType, config?: AxiosRequestConfig): Promise<SCUserProviderAssociationType>;
501
502
  static deleteProviderAssociation(data: DeleteProviderAssociation, config?: AxiosRequestConfig): Promise<any>;
502
503
  static getUserLiveStream(id: number | string, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCLiveStreamType>>;
503
- static getOrderHistory(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
504
- static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<any>>;
504
+ static getOrderHistory(id: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPaymentOrder>>;
505
+ static getOrderDetail(id: number, order: number, params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaymentOrder>;
505
506
  }
@@ -460,11 +460,12 @@ export class UserApiClient {
460
460
  /**
461
461
  * This endpoint retrieve all order history of authenticated user
462
462
  *
463
+ * @param id
463
464
  * @param params
464
465
  * @param config
465
466
  */
466
- static getOrderHistory(params, config) {
467
- return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetOrderHistory.url({}), method: Endpoints.GetOrderHistory.method, params }));
467
+ static getOrderHistory(id, params, config) {
468
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetOrderHistory.url({ id }), method: Endpoints.GetOrderHistory.method, params }));
468
469
  }
469
470
  /**
470
471
  * This endpoint retrieve detail of an order
@@ -775,9 +776,9 @@ export default class UserService {
775
776
  return UserApiClient.getUserLiveStream(id, params, config);
776
777
  });
777
778
  }
778
- static getOrderHistory(params, config) {
779
+ static getOrderHistory(id, params, config) {
779
780
  return __awaiter(this, void 0, void 0, function* () {
780
- return UserApiClient.getOrderHistory(params, config);
781
+ return UserApiClient.getOrderHistory(id, params, config);
781
782
  });
782
783
  }
783
784
  static getOrderDetail(id, order, params, config) {