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.
- package/dist/helpers/fetchRequest.js +12 -2
- package/dist/interfaces/shoppingcart.d.ts +2 -0
- package/dist/services/shoppingcart/index.js +3 -0
- package/dist/services/shoppingcart/shoppingcart.types.d.ts +4 -1
- package/dist/services/urls.d.ts +1 -0
- package/dist/services/urls.js +1 -0
- package/package.json +1 -1
|
@@ -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) =>
|
|
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
|
}
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -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',
|