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.
- package/dist/enums/paymentProviders.d.ts +1 -1
- package/dist/enums/paymentProviders.js +1 -1
- package/dist/interfaces/payment.d.ts +7 -0
- package/dist/services/payment/index.js +12 -0
- package/dist/services/payment/payment.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
|
@@ -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["
|
|
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
|
}
|
package/dist/services/urls.d.ts
CHANGED
package/dist/services/urls.js
CHANGED
|
@@ -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 = '' }) => {
|