eservices-core 1.0.563 → 1.0.565
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.
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UtcDate } from "./main";
|
|
2
|
+
export interface IOnlinePayment {
|
|
3
|
+
onlinePayment: {
|
|
4
|
+
amount: number;
|
|
5
|
+
bankName: string;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
id: number;
|
|
8
|
+
number: string;
|
|
9
|
+
payerId: number;
|
|
10
|
+
paymentId: number;
|
|
11
|
+
statusCode: string;
|
|
12
|
+
token: string;
|
|
13
|
+
utcCreated: UtcDate | null;
|
|
14
|
+
utcDeleted: UtcDate | null;
|
|
15
|
+
utcModified: UtcDate | null;
|
|
16
|
+
utcRestored: UtcDate | null;
|
|
17
|
+
version: number;
|
|
18
|
+
};
|
|
19
|
+
redirectUrl: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IApplyResultOnlinePayment {
|
|
22
|
+
a: 1;
|
|
23
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IOnlinePayment, IApplyResultOnlinePayment } from "./../../../backend/src/types/billing";
|
|
1
2
|
export default class billingService {
|
|
2
3
|
private static url;
|
|
3
4
|
static getBillingMetadata(entityName: string): Promise<Response>;
|
|
@@ -11,7 +12,12 @@ export default class billingService {
|
|
|
11
12
|
/**
|
|
12
13
|
* @description Метод для создания онлайн платежа.
|
|
13
14
|
* */
|
|
14
|
-
static createOnlinePayment(paymentId: number): Promise<
|
|
15
|
+
static createOnlinePayment(paymentId: number, returnURL: string): Promise<IOnlinePayment>;
|
|
16
|
+
/**
|
|
17
|
+
* @description Подтверждение online платежа. После получение ответа от банка(в момент редирект), мы должны отправить
|
|
18
|
+
* все полученные данные(в нашем случае весь URL) на аппсервер.
|
|
19
|
+
* */
|
|
20
|
+
static applyOnlinePayment(response: any): Promise<IApplyResultOnlinePayment>;
|
|
15
21
|
}
|
|
16
22
|
interface IBillingField {
|
|
17
23
|
"name": string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.565
|
|
3
3
|
* (c) 2023 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -5740,14 +5740,30 @@ class billingService {
|
|
|
5740
5740
|
/**
|
|
5741
5741
|
* @description Метод для создания онлайн платежа.
|
|
5742
5742
|
* */
|
|
5743
|
-
static createOnlinePayment(paymentId) {
|
|
5743
|
+
static createOnlinePayment(paymentId, returnURL) {
|
|
5744
5744
|
return Request(`/${billingService.url()}/online-payment`, {
|
|
5745
5745
|
method: "POST",
|
|
5746
5746
|
headers: {
|
|
5747
5747
|
'Content-Type': 'application/json'
|
|
5748
5748
|
},
|
|
5749
5749
|
body: JSON.stringify({
|
|
5750
|
-
paymentId
|
|
5750
|
+
paymentId,
|
|
5751
|
+
returnURL
|
|
5752
|
+
})
|
|
5753
|
+
});
|
|
5754
|
+
}
|
|
5755
|
+
/**
|
|
5756
|
+
* @description Подтверждение online платежа. После получение ответа от банка(в момент редирект), мы должны отправить
|
|
5757
|
+
* все полученные данные(в нашем случае весь URL) на аппсервер.
|
|
5758
|
+
* */
|
|
5759
|
+
static applyOnlinePayment(response) {
|
|
5760
|
+
return Request(`/${billingService.url()}/online-payment`, {
|
|
5761
|
+
method: "PUT",
|
|
5762
|
+
headers: {
|
|
5763
|
+
'Content-Type': 'application/json'
|
|
5764
|
+
},
|
|
5765
|
+
body: JSON.stringify({
|
|
5766
|
+
response
|
|
5751
5767
|
})
|
|
5752
5768
|
});
|
|
5753
5769
|
}
|