nextemos 4.9.20 → 4.10.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.
@@ -15,6 +15,7 @@ export * from './service';
15
15
  export * from './shoppingcart';
16
16
  export * from './ordermanagement';
17
17
  export * from './notification';
18
+ export * from './payment';
18
19
  export * from '../services/banner/banner.types';
19
20
  export * from '../services/blog/blog.types';
20
21
  export * from '../services/product/product.types';
@@ -27,3 +28,4 @@ export * from '../services/localization/localization.types';
27
28
  export * from '../services/shoppingcart/shoppingcart.types';
28
29
  export * from '../services/ordermanagement/ordermanagement.types';
29
30
  export * from '../services/notification/notification.types';
31
+ export * from '../services/payment/payment.types';
@@ -32,6 +32,7 @@ __exportStar(require("./service"), exports);
32
32
  __exportStar(require("./shoppingcart"), exports);
33
33
  __exportStar(require("./ordermanagement"), exports);
34
34
  __exportStar(require("./notification"), exports);
35
+ __exportStar(require("./payment"), exports);
35
36
  /// service types
36
37
  __exportStar(require("../services/banner/banner.types"), exports);
37
38
  __exportStar(require("../services/blog/blog.types"), exports);
@@ -45,3 +46,4 @@ __exportStar(require("../services/localization/localization.types"), exports);
45
46
  __exportStar(require("../services/shoppingcart/shoppingcart.types"), exports);
46
47
  __exportStar(require("../services/ordermanagement/ordermanagement.types"), exports);
47
48
  __exportStar(require("../services/notification/notification.types"), exports);
49
+ __exportStar(require("../services/payment/payment.types"), exports);
@@ -0,0 +1,22 @@
1
+ import { IResponse } from "./response";
2
+ export interface IGetBanksResponse extends IResponse {
3
+ data?: IBank[];
4
+ }
5
+ export interface IBank {
6
+ id: number;
7
+ name: string;
8
+ paymentProvider: string;
9
+ logoUrl: string;
10
+ explanation: string;
11
+ isDefault: boolean;
12
+ useDefaultBankForSingleInstallment: boolean;
13
+ isBankPointActive: boolean;
14
+ order: number;
15
+ accounts: IBankAccount[];
16
+ }
17
+ export interface IBankAccount {
18
+ id: number;
19
+ iban: string;
20
+ swiftCode: string;
21
+ currencyId: number;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,6 +14,11 @@ export interface IGetCartResponse extends IResponse {
14
14
  export interface IGetCartItemCountResponse extends IResponse {
15
15
  count: number;
16
16
  }
17
+ export interface IDoTransferTransactionResponse extends IResponse {
18
+ orderNo: string;
19
+ isCompleted: boolean;
20
+ requiredForCompletion: boolean;
21
+ }
17
22
  export interface IGetInstallmentOptionsResponse extends IResponse {
18
23
  installmentOptions: IInstallmentOption[];
19
24
  }
@@ -74,7 +79,7 @@ export interface ICartItem {
74
79
  lineInfo: string;
75
80
  stockBarcodeId: number;
76
81
  availableStock: number;
77
- flags: 'None' | 'ShipmentFee' | 'PaymentFee' | 'Customization';
82
+ flags: "None" | "ShipmentFee" | "PaymentFee" | "Customization";
78
83
  totals: ITotal[];
79
84
  itemDate: string;
80
85
  cartItemInfo: ICartItemInfo[];
@@ -13,4 +13,5 @@ export declare const Service: {
13
13
  Notification: import("..").INotificationService;
14
14
  ShoppingCart: import("..").IShoppingCartService;
15
15
  OrderManagement: import("..").IOrderManagementService;
16
+ Payment: import("..").IPaymentService;
16
17
  };
@@ -11,6 +11,7 @@ const localization_1 = require("./localization");
11
11
  const member_1 = require("./member");
12
12
  const notification_1 = require("./notification");
13
13
  const ordermanagement_1 = require("./ordermanagement");
14
+ const payment_1 = require("./payment");
14
15
  const prediction_1 = require("./prediction");
15
16
  const product_1 = require("./product");
16
17
  const route_1 = require("./route");
@@ -30,5 +31,6 @@ exports.Service = {
30
31
  Keycloak: keycloak_1.KeycloakService,
31
32
  Notification: notification_1.NotificationService,
32
33
  ShoppingCart: shoppingcart_1.ShoppingCartService,
33
- OrderManagement: ordermanagement_1.OrderManagementService
34
+ OrderManagement: ordermanagement_1.OrderManagementService,
35
+ Payment: payment_1.PaymentService
34
36
  };
@@ -0,0 +1,2 @@
1
+ import { IPaymentService } from "./payment.types";
2
+ export declare const PaymentService: IPaymentService;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.PaymentService = void 0;
36
+ const urls_1 = __importStar(require("../urls"));
37
+ const __1 = require("../../");
38
+ exports.PaymentService = {
39
+ Namespace: process.env.MS_NAMESPACE || "emosv2service",
40
+ ServiceUrl: function () {
41
+ return `http://payment.${this.Namespace}.svc.cluster.local`;
42
+ },
43
+ Prefix: "/api/payment",
44
+ GetBanks: function (data, options) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
47
+ serviceUrl: this.ServiceUrl(),
48
+ prefix: this.Prefix,
49
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
50
+ language: data === null || data === void 0 ? void 0 : data.language,
51
+ methodName: urls_1.default.Payment.GetBanks,
52
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
53
+ });
54
+ },
55
+ };
@@ -0,0 +1,6 @@
1
+ import { IApiResponse, IGetBanksResponse, IRequestBase, IRequestInit, IService } from "../..";
2
+ export interface IGetBanksRequest extends IRequestBase {
3
+ }
4
+ export interface IPaymentService extends IService {
5
+ GetBanks: (data: IGetBanksRequest, options?: IRequestInit) => Promise<IApiResponse<IGetBanksResponse>>;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -118,4 +118,15 @@ exports.ShoppingCartService = {
118
118
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
119
119
  });
120
120
  },
121
+ DoTransferTransaction: function (data, options) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
124
+ serviceUrl: this.ServiceUrl(),
125
+ prefix: this.Prefix,
126
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
127
+ language: data === null || data === void 0 ? void 0 : data.language,
128
+ methodName: urls_1.default.ShoppingCart.DoTransferTransaction,
129
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
130
+ });
131
+ },
121
132
  };
@@ -1,4 +1,4 @@
1
- import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse, IGetInstallmentOptionsResponse } from '../..';
1
+ import { IApiResponse, IRequestInit, IService, IGiftCardInfo, IRequestInfo, IGetCartItemCountResponse, IGetCartResponse, IGetInstallmentOptionsResponse, IDoTransferTransactionResponse } from "../..";
2
2
  export interface IAddToCartRequest {
3
3
  flags?: string | number | string[];
4
4
  productId: number;
@@ -71,6 +71,12 @@ export interface IGetInstallmentOptionsRequest extends IGetCartRequest {
71
71
  }[];
72
72
  cardBin?: string;
73
73
  }
74
+ export interface IDoTransferTransactionRequest extends IGetCartRequest {
75
+ paymentTypeId: number;
76
+ bankAccountId: number;
77
+ isApprovedToSalesAggreementForm: boolean;
78
+ isApprovedToPreInformationForm: boolean;
79
+ }
74
80
  export interface IShoppingCartService extends IService {
75
81
  AddToCart: (data: IAddToCartRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
76
82
  GetCartItemCount: (data: IGetCartItemCountRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartItemCountResponse>>;
@@ -79,4 +85,5 @@ export interface IShoppingCartService extends IService {
79
85
  ChangeQuantity: (data: IChangeQuantityRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
80
86
  ChangeCartDetail: (data: IChangeCartDetailRequest, options?: IRequestInit) => Promise<IApiResponse<IGetCartResponse>>;
81
87
  GetInstallmentOptions: (data: IGetInstallmentOptionsRequest, options?: IRequestInit) => Promise<IApiResponse<IGetInstallmentOptionsResponse>>;
88
+ DoTransferTransaction: (data: IDoTransferTransactionRequest, options?: IRequestInit) => Promise<IApiResponse<IDoTransferTransactionResponse>>;
82
89
  }
@@ -106,10 +106,14 @@ declare const _default: {
106
106
  ChangeQuantity: string;
107
107
  ChangeCartDetail: string;
108
108
  GetInstallmentOptions: string;
109
+ DoTransferTransaction: string;
109
110
  };
110
111
  OrderManagement: {
111
112
  GetOrderDetails: string;
112
113
  };
114
+ Payment: {
115
+ GetBanks: string;
116
+ };
113
117
  };
114
118
  export default _default;
115
119
  export declare const getUrl: ({ isClient, language, methodName, serviceUrl, prefix, id }: {
@@ -112,9 +112,13 @@ exports.default = {
112
112
  ChangeQuantity: '/{language}/ShoppingCartGateway/v1/ChangeQuantity',
113
113
  ChangeCartDetail: '/{language}/ShoppingCartGateway/v1/ChangeCartDetail',
114
114
  GetInstallmentOptions: '/{language}/ShoppingCartGateway/v1/GetInstallmentOptions',
115
+ DoTransferTransaction: '/{language}/ShoppingCartGateway/v1/DoTransferTransaction',
115
116
  },
116
117
  OrderManagement: {
117
118
  GetOrderDetails: '/{language}/OrderManagement/v1/GetOrderDetails',
119
+ },
120
+ Payment: {
121
+ GetBanks: '/{language}/Bank/v1/GetBanks',
118
122
  }
119
123
  };
120
124
  const getUrl = ({ isClient = false, language = process.env.DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = '' }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.9.20",
3
+ "version": "4.10.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",