nextemos 4.10.0 → 4.10.2

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.
@@ -1,6 +1,6 @@
1
1
  export declare enum PAYMENT_PROVIDERS {
2
2
  CREDIT_CARD = "CreditCard",
3
- EFT = "Transfer",
3
+ TRANSFER = "Transfer",
4
4
  FREE_OF_CHARGE = "FreeOfCharge",
5
5
  GARANTI_PAY = "GarantiPay",
6
6
  BORDRO = "Bordro",
@@ -4,7 +4,7 @@ exports.PAYMENT_PROVIDERS = void 0;
4
4
  var PAYMENT_PROVIDERS;
5
5
  (function (PAYMENT_PROVIDERS) {
6
6
  PAYMENT_PROVIDERS["CREDIT_CARD"] = "CreditCard";
7
- PAYMENT_PROVIDERS["EFT"] = "Transfer";
7
+ PAYMENT_PROVIDERS["TRANSFER"] = "Transfer";
8
8
  PAYMENT_PROVIDERS["FREE_OF_CHARGE"] = "FreeOfCharge";
9
9
  PAYMENT_PROVIDERS["GARANTI_PAY"] = "GarantiPay";
10
10
  PAYMENT_PROVIDERS["BORDRO"] = "Bordro";
@@ -2,6 +2,13 @@ import { IResponse } from "./response";
2
2
  export interface IGetBanksResponse extends IResponse {
3
3
  data?: IBank[];
4
4
  }
5
+ export interface IGetTokenResponse extends IResponse {
6
+ clientId: string;
7
+ msisdn: string;
8
+ token: string;
9
+ clientServiceUrl: string;
10
+ force3DSecure: boolean;
11
+ }
5
12
  export interface IBank {
6
13
  id: number;
7
14
  name: string;
@@ -52,4 +52,16 @@ exports.PaymentService = {
52
52
  }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
53
53
  });
54
54
  },
55
+ // masterpass
56
+ GetToken: function (data, options) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return yield (0, __1.fetchRequest)().post((0, urls_1.getUrl)({
59
+ serviceUrl: this.ServiceUrl(),
60
+ prefix: this.Prefix,
61
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
62
+ language: data === null || data === void 0 ? void 0 : data.language,
63
+ methodName: urls_1.default.Payment.GetToken,
64
+ }), Object.assign(Object.assign({}, options), { body: JSON.stringify(data) }));
65
+ });
66
+ },
55
67
  };
@@ -1,6 +1,9 @@
1
- import { IApiResponse, IGetBanksResponse, IRequestBase, IRequestInit, IService } from "../..";
1
+ import { IApiResponse, IGetBanksResponse, IGetTokenResponse, IRequestBase, IRequestInit, IService } from "../..";
2
2
  export interface IGetBanksRequest extends IRequestBase {
3
3
  }
4
+ export interface IGetTokenRequest extends IRequestBase {
5
+ }
4
6
  export interface IPaymentService extends IService {
5
7
  GetBanks: (data: IGetBanksRequest, options?: IRequestInit) => Promise<IApiResponse<IGetBanksResponse>>;
8
+ GetToken: (data: IGetTokenRequest, options?: IRequestInit) => Promise<IApiResponse<IGetTokenResponse>>;
6
9
  }
@@ -113,6 +113,7 @@ declare const _default: {
113
113
  };
114
114
  Payment: {
115
115
  GetBanks: string;
116
+ GetToken: string;
116
117
  };
117
118
  };
118
119
  export default _default;
@@ -119,6 +119,7 @@ exports.default = {
119
119
  },
120
120
  Payment: {
121
121
  GetBanks: '/{language}/Bank/v1/GetBanks',
122
+ GetToken: '/{language}/Masterpass/v1/GetToken',
122
123
  }
123
124
  };
124
125
  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.10.0",
3
+ "version": "4.10.2",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",