nextemos 4.10.15 → 4.11.0

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.
@@ -35,8 +35,18 @@ const fetchRequest = () => {
35
35
  const request = (_a) => __awaiter(void 0, void 0, void 0, function* () {
36
36
  var { url, method, params } = _a, options = __rest(_a, ["url", "method", "params"]);
37
37
  const apiURL = new URL(url);
38
- if (params)
39
- Object.keys(params).forEach((key) => apiURL.searchParams.append(key, decodeURIComponent(params[key])));
38
+ if (params) {
39
+ Object.keys(params).forEach((key) => {
40
+ if (Array.isArray(params[key])) {
41
+ params[key].forEach((x) => {
42
+ apiURL.searchParams.append(key, x);
43
+ });
44
+ }
45
+ else {
46
+ apiURL.searchParams.append(key, params[key]);
47
+ }
48
+ });
49
+ }
40
50
  if ((method === __1.HTTPMethod.POST &&
41
51
  (!options.body || typeof options.body === "string")) ||
42
52
  method === __1.HTTPMethod.PUT ||
@@ -23,6 +23,8 @@ export interface IDoTransferTransactionResponse extends ITransactionResponse {
23
23
  }
24
24
  export interface IDoCreditCardTransactionResponse extends ITransactionResponse {
25
25
  }
26
+ export interface IDoIyzicoCreditCardTransactionResponse extends ITransactionResponse {
27
+ }
26
28
  export interface IGetInstallmentOptionsResponse extends IResponse {
27
29
  installmentOptions: IInstallmentOption[];
28
30
  }
@@ -73,4 +73,7 @@ exports.ShoppingCartService = {
73
73
  DoCreditCardTransaction: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
74
74
  return (0, __1.fetchRequest)().post(exports.ShoppingCartService.Url(urls_1.default.ShoppingCart.DoCreditCardTransaction, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
75
75
  }),
76
+ DoIyzicoCreditCardTransaction: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
77
+ return (0, __1.fetchRequest)().post(exports.ShoppingCartService.Url(urls_1.default.ShoppingCart.DoIyzicoCreditCardTransaction, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
78
+ }),
76
79
  };
@@ -1,4 +1,4 @@
1
- import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse, IGetInstallmentOptionsResponse, IDoTransferTransactionResponse, IDoCreditCardTransactionResponse } from "../..";
1
+ import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse, IGetInstallmentOptionsResponse, IDoTransferTransactionResponse, IDoCreditCardTransactionResponse, IDoIyzicoCreditCardTransactionResponse } from "../..";
2
2
  export interface IAddToCartRequest {
3
3
  flags?: string | number | string[];
4
4
  productId: number;
@@ -93,6 +93,8 @@ export interface IDoCreditCardTransactionRequest extends IGetCartRequest {
93
93
  isApprovedToSalesAggreementForm: boolean;
94
94
  isApprovedToPreInformationForm: boolean;
95
95
  }
96
+ export interface IDoIyzicoCreditCardTransactionRequest extends Omit<IDoCreditCardTransactionRequest, "supplier" | "saveCreditCardIntoSupplier" | "bankPoint"> {
97
+ }
96
98
  export interface IShoppingCartService extends IService {
97
99
  AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
98
100
  GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
@@ -103,4 +105,5 @@ export interface IShoppingCartService extends IService {
103
105
  GetInstallmentOptions: (data: IGetInstallmentOptionsRequest, options?: IRequestInit) => Promise<IApiResponse<IGetInstallmentOptionsResponse>>;
104
106
  DoTransferTransaction: (data: IDoTransferTransactionRequest, options?: IRequestInit) => Promise<IApiResponse<IDoTransferTransactionResponse>>;
105
107
  DoCreditCardTransaction: (data: IDoCreditCardTransactionRequest, options?: IRequestInit) => Promise<IApiResponse<IDoCreditCardTransactionResponse>>;
108
+ DoIyzicoCreditCardTransaction: (data: IDoIyzicoCreditCardTransactionRequest, options?: IRequestInit) => Promise<IApiResponse<IDoIyzicoCreditCardTransactionResponse>>;
106
109
  }
@@ -112,6 +112,7 @@ declare const _default: {
112
112
  GetInstallmentOptions: string;
113
113
  DoTransferTransaction: string;
114
114
  DoCreditCardTransaction: string;
115
+ DoIyzicoCreditCardTransaction: string;
115
116
  };
116
117
  OrderManagement: {
117
118
  GetOrderDetails: string;
@@ -118,6 +118,7 @@ exports.default = {
118
118
  GetInstallmentOptions: '/{language}/ShoppingCartGateway/v1/GetInstallmentOptions',
119
119
  DoTransferTransaction: '/{language}/ShoppingCartGateway/v1/DoTransferTransaction',
120
120
  DoCreditCardTransaction: '/{language}/ShoppingCartGateway/v1/DoCreditCardTransaction',
121
+ DoIyzicoCreditCardTransaction: '/{language}/ShoppingCartGateway/v1/DoIyzicoCreditCardTransaction',
121
122
  },
122
123
  OrderManagement: {
123
124
  GetOrderDetails: '/{language}/OrderManagement/v1/GetOrderDetails',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.10.15",
3
+ "version": "4.11.0",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",