@ahomevilla-hotel/node-sdk 1.1.7 → 1.1.9
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/api.ts +649 -2
- package/package.json +1 -1
package/api.ts
CHANGED
|
@@ -791,6 +791,25 @@ export interface BranchesPaginationResultDto {
|
|
|
791
791
|
*/
|
|
792
792
|
'meta': UsersPaginationResultDtoMeta;
|
|
793
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
*
|
|
796
|
+
* @export
|
|
797
|
+
* @interface CancelPaymentRequestDto
|
|
798
|
+
*/
|
|
799
|
+
export interface CancelPaymentRequestDto {
|
|
800
|
+
/**
|
|
801
|
+
*
|
|
802
|
+
* @type {string}
|
|
803
|
+
* @memberof CancelPaymentRequestDto
|
|
804
|
+
*/
|
|
805
|
+
'paymentLinkId': string;
|
|
806
|
+
/**
|
|
807
|
+
*
|
|
808
|
+
* @type {string}
|
|
809
|
+
* @memberof CancelPaymentRequestDto
|
|
810
|
+
*/
|
|
811
|
+
'cancelReason': string;
|
|
812
|
+
}
|
|
794
813
|
/**
|
|
795
814
|
*
|
|
796
815
|
* @export
|
|
@@ -816,6 +835,37 @@ export interface ChangePasswordDto {
|
|
|
816
835
|
*/
|
|
817
836
|
'confirmPassword': string;
|
|
818
837
|
}
|
|
838
|
+
/**
|
|
839
|
+
*
|
|
840
|
+
* @export
|
|
841
|
+
* @interface ConfirmPaymentWebhookDto
|
|
842
|
+
*/
|
|
843
|
+
export interface ConfirmPaymentWebhookDto {
|
|
844
|
+
/**
|
|
845
|
+
*
|
|
846
|
+
* @type {string}
|
|
847
|
+
* @memberof ConfirmPaymentWebhookDto
|
|
848
|
+
*/
|
|
849
|
+
'code': string;
|
|
850
|
+
/**
|
|
851
|
+
*
|
|
852
|
+
* @type {string}
|
|
853
|
+
* @memberof ConfirmPaymentWebhookDto
|
|
854
|
+
*/
|
|
855
|
+
'desc': string;
|
|
856
|
+
/**
|
|
857
|
+
*
|
|
858
|
+
* @type {object}
|
|
859
|
+
* @memberof ConfirmPaymentWebhookDto
|
|
860
|
+
*/
|
|
861
|
+
'data': object;
|
|
862
|
+
/**
|
|
863
|
+
*
|
|
864
|
+
* @type {string}
|
|
865
|
+
* @memberof ConfirmPaymentWebhookDto
|
|
866
|
+
*/
|
|
867
|
+
'signature': string;
|
|
868
|
+
}
|
|
819
869
|
/**
|
|
820
870
|
*
|
|
821
871
|
* @export
|
|
@@ -892,6 +942,18 @@ export interface CreateBookingAtHotelDto {
|
|
|
892
942
|
* @memberof CreateBookingAtHotelDto
|
|
893
943
|
*/
|
|
894
944
|
'end_time': string;
|
|
945
|
+
/**
|
|
946
|
+
* Name of the guest
|
|
947
|
+
* @type {string}
|
|
948
|
+
* @memberof CreateBookingAtHotelDto
|
|
949
|
+
*/
|
|
950
|
+
'name'?: string;
|
|
951
|
+
/**
|
|
952
|
+
* Phone number of the guest
|
|
953
|
+
* @type {string}
|
|
954
|
+
* @memberof CreateBookingAtHotelDto
|
|
955
|
+
*/
|
|
956
|
+
'phone'?: string;
|
|
895
957
|
/**
|
|
896
958
|
* Number of guests
|
|
897
959
|
* @type {number}
|
|
@@ -986,6 +1048,18 @@ export interface CreateBookingOnlineDto {
|
|
|
986
1048
|
* @memberof CreateBookingOnlineDto
|
|
987
1049
|
*/
|
|
988
1050
|
'end_time': string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Name of the guest
|
|
1053
|
+
* @type {string}
|
|
1054
|
+
* @memberof CreateBookingOnlineDto
|
|
1055
|
+
*/
|
|
1056
|
+
'name'?: string;
|
|
1057
|
+
/**
|
|
1058
|
+
* Phone number of the guest
|
|
1059
|
+
* @type {string}
|
|
1060
|
+
* @memberof CreateBookingOnlineDto
|
|
1061
|
+
*/
|
|
1062
|
+
'phone'?: string;
|
|
989
1063
|
/**
|
|
990
1064
|
* Number of guests
|
|
991
1065
|
* @type {number}
|
|
@@ -1174,6 +1248,73 @@ export const CreateHotelRoomDtoStatusEnum = {
|
|
|
1174
1248
|
|
|
1175
1249
|
export type CreateHotelRoomDtoStatusEnum = typeof CreateHotelRoomDtoStatusEnum[keyof typeof CreateHotelRoomDtoStatusEnum];
|
|
1176
1250
|
|
|
1251
|
+
/**
|
|
1252
|
+
*
|
|
1253
|
+
* @export
|
|
1254
|
+
* @interface CreatePaymentRequestDto
|
|
1255
|
+
*/
|
|
1256
|
+
export interface CreatePaymentRequestDto {
|
|
1257
|
+
/**
|
|
1258
|
+
*
|
|
1259
|
+
* @type {string}
|
|
1260
|
+
* @memberof CreatePaymentRequestDto
|
|
1261
|
+
*/
|
|
1262
|
+
'orderCode': string;
|
|
1263
|
+
/**
|
|
1264
|
+
*
|
|
1265
|
+
* @type {number}
|
|
1266
|
+
* @memberof CreatePaymentRequestDto
|
|
1267
|
+
*/
|
|
1268
|
+
'amount': number;
|
|
1269
|
+
/**
|
|
1270
|
+
*
|
|
1271
|
+
* @type {string}
|
|
1272
|
+
* @memberof CreatePaymentRequestDto
|
|
1273
|
+
*/
|
|
1274
|
+
'description': string;
|
|
1275
|
+
/**
|
|
1276
|
+
*
|
|
1277
|
+
* @type {string}
|
|
1278
|
+
* @memberof CreatePaymentRequestDto
|
|
1279
|
+
*/
|
|
1280
|
+
'cancelUrl': string;
|
|
1281
|
+
/**
|
|
1282
|
+
*
|
|
1283
|
+
* @type {string}
|
|
1284
|
+
* @memberof CreatePaymentRequestDto
|
|
1285
|
+
*/
|
|
1286
|
+
'returnUrl': string;
|
|
1287
|
+
/**
|
|
1288
|
+
*
|
|
1289
|
+
* @type {string}
|
|
1290
|
+
* @memberof CreatePaymentRequestDto
|
|
1291
|
+
*/
|
|
1292
|
+
'buyerName'?: string;
|
|
1293
|
+
/**
|
|
1294
|
+
*
|
|
1295
|
+
* @type {string}
|
|
1296
|
+
* @memberof CreatePaymentRequestDto
|
|
1297
|
+
*/
|
|
1298
|
+
'buyerEmail'?: string;
|
|
1299
|
+
/**
|
|
1300
|
+
*
|
|
1301
|
+
* @type {string}
|
|
1302
|
+
* @memberof CreatePaymentRequestDto
|
|
1303
|
+
*/
|
|
1304
|
+
'buyerPhone'?: string;
|
|
1305
|
+
/**
|
|
1306
|
+
*
|
|
1307
|
+
* @type {string}
|
|
1308
|
+
* @memberof CreatePaymentRequestDto
|
|
1309
|
+
*/
|
|
1310
|
+
'buyerAddress'?: string;
|
|
1311
|
+
/**
|
|
1312
|
+
*
|
|
1313
|
+
* @type {Array<RoomDetail>}
|
|
1314
|
+
* @memberof CreatePaymentRequestDto
|
|
1315
|
+
*/
|
|
1316
|
+
'items'?: Array<RoomDetail>;
|
|
1317
|
+
}
|
|
1177
1318
|
/**
|
|
1178
1319
|
*
|
|
1179
1320
|
* @export
|
|
@@ -1784,13 +1925,13 @@ export interface FilterRoomDetailDto {
|
|
|
1784
1925
|
*/
|
|
1785
1926
|
'maxPrice'?: object;
|
|
1786
1927
|
/**
|
|
1787
|
-
* Filter by start date
|
|
1928
|
+
* Filter by start date (DD-MM-YYYY)
|
|
1788
1929
|
* @type {string}
|
|
1789
1930
|
* @memberof FilterRoomDetailDto
|
|
1790
1931
|
*/
|
|
1791
1932
|
'startDate'?: string;
|
|
1792
1933
|
/**
|
|
1793
|
-
* Filter by end date
|
|
1934
|
+
* Filter by end date (DD-MM-YYYY)
|
|
1794
1935
|
* @type {string}
|
|
1795
1936
|
* @memberof FilterRoomDetailDto
|
|
1796
1937
|
*/
|
|
@@ -1813,6 +1954,18 @@ export interface FilterRoomDetailDto {
|
|
|
1813
1954
|
* @memberof FilterRoomDetailDto
|
|
1814
1955
|
*/
|
|
1815
1956
|
'bookingType'?: FilterRoomDetailDtoBookingTypeEnum;
|
|
1957
|
+
/**
|
|
1958
|
+
* Filter by number of adults
|
|
1959
|
+
* @type {number}
|
|
1960
|
+
* @memberof FilterRoomDetailDto
|
|
1961
|
+
*/
|
|
1962
|
+
'adults'?: number;
|
|
1963
|
+
/**
|
|
1964
|
+
* Filter by number of children
|
|
1965
|
+
* @type {number}
|
|
1966
|
+
* @memberof FilterRoomDetailDto
|
|
1967
|
+
*/
|
|
1968
|
+
'children'?: number;
|
|
1816
1969
|
}
|
|
1817
1970
|
|
|
1818
1971
|
export const FilterRoomDetailDtoRoomTypeEnum = {
|
|
@@ -2217,6 +2370,110 @@ export interface NearBy {
|
|
|
2217
2370
|
*/
|
|
2218
2371
|
'distance': string;
|
|
2219
2372
|
}
|
|
2373
|
+
/**
|
|
2374
|
+
*
|
|
2375
|
+
* @export
|
|
2376
|
+
* @interface PaymentResponseData
|
|
2377
|
+
*/
|
|
2378
|
+
export interface PaymentResponseData {
|
|
2379
|
+
/**
|
|
2380
|
+
*
|
|
2381
|
+
* @type {string}
|
|
2382
|
+
* @memberof PaymentResponseData
|
|
2383
|
+
*/
|
|
2384
|
+
'bin': string;
|
|
2385
|
+
/**
|
|
2386
|
+
*
|
|
2387
|
+
* @type {string}
|
|
2388
|
+
* @memberof PaymentResponseData
|
|
2389
|
+
*/
|
|
2390
|
+
'accountNumber': string;
|
|
2391
|
+
/**
|
|
2392
|
+
*
|
|
2393
|
+
* @type {string}
|
|
2394
|
+
* @memberof PaymentResponseData
|
|
2395
|
+
*/
|
|
2396
|
+
'accountName': string;
|
|
2397
|
+
/**
|
|
2398
|
+
*
|
|
2399
|
+
* @type {number}
|
|
2400
|
+
* @memberof PaymentResponseData
|
|
2401
|
+
*/
|
|
2402
|
+
'amount': number;
|
|
2403
|
+
/**
|
|
2404
|
+
*
|
|
2405
|
+
* @type {string}
|
|
2406
|
+
* @memberof PaymentResponseData
|
|
2407
|
+
*/
|
|
2408
|
+
'description': string;
|
|
2409
|
+
/**
|
|
2410
|
+
*
|
|
2411
|
+
* @type {object}
|
|
2412
|
+
* @memberof PaymentResponseData
|
|
2413
|
+
*/
|
|
2414
|
+
'orderCode': object;
|
|
2415
|
+
/**
|
|
2416
|
+
*
|
|
2417
|
+
* @type {string}
|
|
2418
|
+
* @memberof PaymentResponseData
|
|
2419
|
+
*/
|
|
2420
|
+
'curency': string;
|
|
2421
|
+
/**
|
|
2422
|
+
*
|
|
2423
|
+
* @type {string}
|
|
2424
|
+
* @memberof PaymentResponseData
|
|
2425
|
+
*/
|
|
2426
|
+
'paymentLinkId': string;
|
|
2427
|
+
/**
|
|
2428
|
+
*
|
|
2429
|
+
* @type {string}
|
|
2430
|
+
* @memberof PaymentResponseData
|
|
2431
|
+
*/
|
|
2432
|
+
'status': string;
|
|
2433
|
+
/**
|
|
2434
|
+
*
|
|
2435
|
+
* @type {string}
|
|
2436
|
+
* @memberof PaymentResponseData
|
|
2437
|
+
*/
|
|
2438
|
+
'checkoutUrl': string;
|
|
2439
|
+
/**
|
|
2440
|
+
*
|
|
2441
|
+
* @type {string}
|
|
2442
|
+
* @memberof PaymentResponseData
|
|
2443
|
+
*/
|
|
2444
|
+
'qrCode': string;
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
*
|
|
2448
|
+
* @export
|
|
2449
|
+
* @interface PaymentResponseDto
|
|
2450
|
+
*/
|
|
2451
|
+
export interface PaymentResponseDto {
|
|
2452
|
+
/**
|
|
2453
|
+
*
|
|
2454
|
+
* @type {string}
|
|
2455
|
+
* @memberof PaymentResponseDto
|
|
2456
|
+
*/
|
|
2457
|
+
'code': string;
|
|
2458
|
+
/**
|
|
2459
|
+
*
|
|
2460
|
+
* @type {string}
|
|
2461
|
+
* @memberof PaymentResponseDto
|
|
2462
|
+
*/
|
|
2463
|
+
'desc': string;
|
|
2464
|
+
/**
|
|
2465
|
+
*
|
|
2466
|
+
* @type {PaymentResponseData}
|
|
2467
|
+
* @memberof PaymentResponseDto
|
|
2468
|
+
*/
|
|
2469
|
+
'data': PaymentResponseData;
|
|
2470
|
+
/**
|
|
2471
|
+
*
|
|
2472
|
+
* @type {string}
|
|
2473
|
+
* @memberof PaymentResponseDto
|
|
2474
|
+
*/
|
|
2475
|
+
'signature': string;
|
|
2476
|
+
}
|
|
2220
2477
|
/**
|
|
2221
2478
|
*
|
|
2222
2479
|
* @export
|
|
@@ -5802,6 +6059,40 @@ export class AuthApi extends BaseAPI {
|
|
|
5802
6059
|
*/
|
|
5803
6060
|
export const BookingApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
5804
6061
|
return {
|
|
6062
|
+
/**
|
|
6063
|
+
*
|
|
6064
|
+
* @summary Cancel a booking
|
|
6065
|
+
* @param {string} bookingId
|
|
6066
|
+
* @param {*} [options] Override http request option.
|
|
6067
|
+
* @throws {RequiredError}
|
|
6068
|
+
*/
|
|
6069
|
+
bookingControllerCancelBooking: async (bookingId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
6070
|
+
// verify required parameter 'bookingId' is not null or undefined
|
|
6071
|
+
assertParamExists('bookingControllerCancelBooking', 'bookingId', bookingId)
|
|
6072
|
+
const localVarPath = `/api/booking/cancel/{bookingId}`
|
|
6073
|
+
.replace(`{${"bookingId"}}`, encodeURIComponent(String(bookingId)));
|
|
6074
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
6075
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6076
|
+
let baseOptions;
|
|
6077
|
+
if (configuration) {
|
|
6078
|
+
baseOptions = configuration.baseOptions;
|
|
6079
|
+
}
|
|
6080
|
+
|
|
6081
|
+
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
|
|
6082
|
+
const localVarHeaderParameter = {} as any;
|
|
6083
|
+
const localVarQueryParameter = {} as any;
|
|
6084
|
+
|
|
6085
|
+
|
|
6086
|
+
|
|
6087
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6088
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6089
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
6090
|
+
|
|
6091
|
+
return {
|
|
6092
|
+
url: toPathString(localVarUrlObj),
|
|
6093
|
+
options: localVarRequestOptions,
|
|
6094
|
+
};
|
|
6095
|
+
},
|
|
5805
6096
|
/**
|
|
5806
6097
|
*
|
|
5807
6098
|
* @summary Create a new booking directly at the hotel
|
|
@@ -6049,6 +6340,19 @@ export const BookingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
6049
6340
|
export const BookingApiFp = function(configuration?: Configuration) {
|
|
6050
6341
|
const localVarAxiosParamCreator = BookingApiAxiosParamCreator(configuration)
|
|
6051
6342
|
return {
|
|
6343
|
+
/**
|
|
6344
|
+
*
|
|
6345
|
+
* @summary Cancel a booking
|
|
6346
|
+
* @param {string} bookingId
|
|
6347
|
+
* @param {*} [options] Override http request option.
|
|
6348
|
+
* @throws {RequiredError}
|
|
6349
|
+
*/
|
|
6350
|
+
async bookingControllerCancelBooking(bookingId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Booking>> {
|
|
6351
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.bookingControllerCancelBooking(bookingId, options);
|
|
6352
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
6353
|
+
const localVarOperationServerBasePath = operationServerMap['BookingApi.bookingControllerCancelBooking']?.[localVarOperationServerIndex]?.url;
|
|
6354
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
6355
|
+
},
|
|
6052
6356
|
/**
|
|
6053
6357
|
*
|
|
6054
6358
|
* @summary Create a new booking directly at the hotel
|
|
@@ -6142,6 +6446,16 @@ export const BookingApiFp = function(configuration?: Configuration) {
|
|
|
6142
6446
|
export const BookingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
6143
6447
|
const localVarFp = BookingApiFp(configuration)
|
|
6144
6448
|
return {
|
|
6449
|
+
/**
|
|
6450
|
+
*
|
|
6451
|
+
* @summary Cancel a booking
|
|
6452
|
+
* @param {string} bookingId
|
|
6453
|
+
* @param {*} [options] Override http request option.
|
|
6454
|
+
* @throws {RequiredError}
|
|
6455
|
+
*/
|
|
6456
|
+
bookingControllerCancelBooking(bookingId: string, options?: RawAxiosRequestConfig): AxiosPromise<Booking> {
|
|
6457
|
+
return localVarFp.bookingControllerCancelBooking(bookingId, options).then((request) => request(axios, basePath));
|
|
6458
|
+
},
|
|
6145
6459
|
/**
|
|
6146
6460
|
*
|
|
6147
6461
|
* @summary Create a new booking directly at the hotel
|
|
@@ -6217,6 +6531,18 @@ export const BookingApiFactory = function (configuration?: Configuration, basePa
|
|
|
6217
6531
|
* @extends {BaseAPI}
|
|
6218
6532
|
*/
|
|
6219
6533
|
export class BookingApi extends BaseAPI {
|
|
6534
|
+
/**
|
|
6535
|
+
*
|
|
6536
|
+
* @summary Cancel a booking
|
|
6537
|
+
* @param {string} bookingId
|
|
6538
|
+
* @param {*} [options] Override http request option.
|
|
6539
|
+
* @throws {RequiredError}
|
|
6540
|
+
* @memberof BookingApi
|
|
6541
|
+
*/
|
|
6542
|
+
public bookingControllerCancelBooking(bookingId: string, options?: RawAxiosRequestConfig) {
|
|
6543
|
+
return BookingApiFp(this.configuration).bookingControllerCancelBooking(bookingId, options).then((request) => request(this.axios, this.basePath));
|
|
6544
|
+
}
|
|
6545
|
+
|
|
6220
6546
|
/**
|
|
6221
6547
|
*
|
|
6222
6548
|
* @summary Create a new booking directly at the hotel
|
|
@@ -7535,6 +7861,327 @@ export class POEditorApi extends BaseAPI {
|
|
|
7535
7861
|
|
|
7536
7862
|
|
|
7537
7863
|
|
|
7864
|
+
/**
|
|
7865
|
+
* PayOSApi - axios parameter creator
|
|
7866
|
+
* @export
|
|
7867
|
+
*/
|
|
7868
|
+
export const PayOSApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
7869
|
+
return {
|
|
7870
|
+
/**
|
|
7871
|
+
*
|
|
7872
|
+
* @summary Cancel a payment link
|
|
7873
|
+
* @param {CancelPaymentRequestDto} cancelPaymentRequestDto
|
|
7874
|
+
* @param {*} [options] Override http request option.
|
|
7875
|
+
* @throws {RequiredError}
|
|
7876
|
+
*/
|
|
7877
|
+
payosControllerCancelPayment: async (cancelPaymentRequestDto: CancelPaymentRequestDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
7878
|
+
// verify required parameter 'cancelPaymentRequestDto' is not null or undefined
|
|
7879
|
+
assertParamExists('payosControllerCancelPayment', 'cancelPaymentRequestDto', cancelPaymentRequestDto)
|
|
7880
|
+
const localVarPath = `/api/payos/cancel-payment`;
|
|
7881
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7882
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
7883
|
+
let baseOptions;
|
|
7884
|
+
if (configuration) {
|
|
7885
|
+
baseOptions = configuration.baseOptions;
|
|
7886
|
+
}
|
|
7887
|
+
|
|
7888
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
7889
|
+
const localVarHeaderParameter = {} as any;
|
|
7890
|
+
const localVarQueryParameter = {} as any;
|
|
7891
|
+
|
|
7892
|
+
|
|
7893
|
+
|
|
7894
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
7895
|
+
|
|
7896
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
7897
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7898
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
7899
|
+
localVarRequestOptions.data = serializeDataIfNeeded(cancelPaymentRequestDto, localVarRequestOptions, configuration)
|
|
7900
|
+
|
|
7901
|
+
return {
|
|
7902
|
+
url: toPathString(localVarUrlObj),
|
|
7903
|
+
options: localVarRequestOptions,
|
|
7904
|
+
};
|
|
7905
|
+
},
|
|
7906
|
+
/**
|
|
7907
|
+
*
|
|
7908
|
+
* @summary Create a new payment request
|
|
7909
|
+
* @param {CreatePaymentRequestDto} createPaymentRequestDto
|
|
7910
|
+
* @param {*} [options] Override http request option.
|
|
7911
|
+
* @throws {RequiredError}
|
|
7912
|
+
*/
|
|
7913
|
+
payosControllerCreatePaymentRequest: async (createPaymentRequestDto: CreatePaymentRequestDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
7914
|
+
// verify required parameter 'createPaymentRequestDto' is not null or undefined
|
|
7915
|
+
assertParamExists('payosControllerCreatePaymentRequest', 'createPaymentRequestDto', createPaymentRequestDto)
|
|
7916
|
+
const localVarPath = `/api/payos/payment-request`;
|
|
7917
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7918
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
7919
|
+
let baseOptions;
|
|
7920
|
+
if (configuration) {
|
|
7921
|
+
baseOptions = configuration.baseOptions;
|
|
7922
|
+
}
|
|
7923
|
+
|
|
7924
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
7925
|
+
const localVarHeaderParameter = {} as any;
|
|
7926
|
+
const localVarQueryParameter = {} as any;
|
|
7927
|
+
|
|
7928
|
+
|
|
7929
|
+
|
|
7930
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
7931
|
+
|
|
7932
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
7933
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7934
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
7935
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createPaymentRequestDto, localVarRequestOptions, configuration)
|
|
7936
|
+
|
|
7937
|
+
return {
|
|
7938
|
+
url: toPathString(localVarUrlObj),
|
|
7939
|
+
options: localVarRequestOptions,
|
|
7940
|
+
};
|
|
7941
|
+
},
|
|
7942
|
+
/**
|
|
7943
|
+
*
|
|
7944
|
+
* @summary Get payment status
|
|
7945
|
+
* @param {string} paymentLinkId
|
|
7946
|
+
* @param {*} [options] Override http request option.
|
|
7947
|
+
* @throws {RequiredError}
|
|
7948
|
+
*/
|
|
7949
|
+
payosControllerGetPaymentStatus: async (paymentLinkId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
7950
|
+
// verify required parameter 'paymentLinkId' is not null or undefined
|
|
7951
|
+
assertParamExists('payosControllerGetPaymentStatus', 'paymentLinkId', paymentLinkId)
|
|
7952
|
+
const localVarPath = `/api/payos/payment-status/{paymentLinkId}`
|
|
7953
|
+
.replace(`{${"paymentLinkId"}}`, encodeURIComponent(String(paymentLinkId)));
|
|
7954
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7955
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
7956
|
+
let baseOptions;
|
|
7957
|
+
if (configuration) {
|
|
7958
|
+
baseOptions = configuration.baseOptions;
|
|
7959
|
+
}
|
|
7960
|
+
|
|
7961
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
7962
|
+
const localVarHeaderParameter = {} as any;
|
|
7963
|
+
const localVarQueryParameter = {} as any;
|
|
7964
|
+
|
|
7965
|
+
|
|
7966
|
+
|
|
7967
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
7968
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7969
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
7970
|
+
|
|
7971
|
+
return {
|
|
7972
|
+
url: toPathString(localVarUrlObj),
|
|
7973
|
+
options: localVarRequestOptions,
|
|
7974
|
+
};
|
|
7975
|
+
},
|
|
7976
|
+
/**
|
|
7977
|
+
*
|
|
7978
|
+
* @summary Handle payment confirmation webhook
|
|
7979
|
+
* @param {ConfirmPaymentWebhookDto} confirmPaymentWebhookDto
|
|
7980
|
+
* @param {*} [options] Override http request option.
|
|
7981
|
+
* @throws {RequiredError}
|
|
7982
|
+
*/
|
|
7983
|
+
payosControllerHandleWebhook: async (confirmPaymentWebhookDto: ConfirmPaymentWebhookDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
7984
|
+
// verify required parameter 'confirmPaymentWebhookDto' is not null or undefined
|
|
7985
|
+
assertParamExists('payosControllerHandleWebhook', 'confirmPaymentWebhookDto', confirmPaymentWebhookDto)
|
|
7986
|
+
const localVarPath = `/api/payos/webhook`;
|
|
7987
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7988
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
7989
|
+
let baseOptions;
|
|
7990
|
+
if (configuration) {
|
|
7991
|
+
baseOptions = configuration.baseOptions;
|
|
7992
|
+
}
|
|
7993
|
+
|
|
7994
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
7995
|
+
const localVarHeaderParameter = {} as any;
|
|
7996
|
+
const localVarQueryParameter = {} as any;
|
|
7997
|
+
|
|
7998
|
+
|
|
7999
|
+
|
|
8000
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8001
|
+
|
|
8002
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8003
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8004
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
8005
|
+
localVarRequestOptions.data = serializeDataIfNeeded(confirmPaymentWebhookDto, localVarRequestOptions, configuration)
|
|
8006
|
+
|
|
8007
|
+
return {
|
|
8008
|
+
url: toPathString(localVarUrlObj),
|
|
8009
|
+
options: localVarRequestOptions,
|
|
8010
|
+
};
|
|
8011
|
+
},
|
|
8012
|
+
}
|
|
8013
|
+
};
|
|
8014
|
+
|
|
8015
|
+
/**
|
|
8016
|
+
* PayOSApi - functional programming interface
|
|
8017
|
+
* @export
|
|
8018
|
+
*/
|
|
8019
|
+
export const PayOSApiFp = function(configuration?: Configuration) {
|
|
8020
|
+
const localVarAxiosParamCreator = PayOSApiAxiosParamCreator(configuration)
|
|
8021
|
+
return {
|
|
8022
|
+
/**
|
|
8023
|
+
*
|
|
8024
|
+
* @summary Cancel a payment link
|
|
8025
|
+
* @param {CancelPaymentRequestDto} cancelPaymentRequestDto
|
|
8026
|
+
* @param {*} [options] Override http request option.
|
|
8027
|
+
* @throws {RequiredError}
|
|
8028
|
+
*/
|
|
8029
|
+
async payosControllerCancelPayment(cancelPaymentRequestDto: CancelPaymentRequestDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentResponseDto>> {
|
|
8030
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.payosControllerCancelPayment(cancelPaymentRequestDto, options);
|
|
8031
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
8032
|
+
const localVarOperationServerBasePath = operationServerMap['PayOSApi.payosControllerCancelPayment']?.[localVarOperationServerIndex]?.url;
|
|
8033
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
8034
|
+
},
|
|
8035
|
+
/**
|
|
8036
|
+
*
|
|
8037
|
+
* @summary Create a new payment request
|
|
8038
|
+
* @param {CreatePaymentRequestDto} createPaymentRequestDto
|
|
8039
|
+
* @param {*} [options] Override http request option.
|
|
8040
|
+
* @throws {RequiredError}
|
|
8041
|
+
*/
|
|
8042
|
+
async payosControllerCreatePaymentRequest(createPaymentRequestDto: CreatePaymentRequestDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentResponseDto>> {
|
|
8043
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.payosControllerCreatePaymentRequest(createPaymentRequestDto, options);
|
|
8044
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
8045
|
+
const localVarOperationServerBasePath = operationServerMap['PayOSApi.payosControllerCreatePaymentRequest']?.[localVarOperationServerIndex]?.url;
|
|
8046
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
8047
|
+
},
|
|
8048
|
+
/**
|
|
8049
|
+
*
|
|
8050
|
+
* @summary Get payment status
|
|
8051
|
+
* @param {string} paymentLinkId
|
|
8052
|
+
* @param {*} [options] Override http request option.
|
|
8053
|
+
* @throws {RequiredError}
|
|
8054
|
+
*/
|
|
8055
|
+
async payosControllerGetPaymentStatus(paymentLinkId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaymentResponseDto>> {
|
|
8056
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.payosControllerGetPaymentStatus(paymentLinkId, options);
|
|
8057
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
8058
|
+
const localVarOperationServerBasePath = operationServerMap['PayOSApi.payosControllerGetPaymentStatus']?.[localVarOperationServerIndex]?.url;
|
|
8059
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
8060
|
+
},
|
|
8061
|
+
/**
|
|
8062
|
+
*
|
|
8063
|
+
* @summary Handle payment confirmation webhook
|
|
8064
|
+
* @param {ConfirmPaymentWebhookDto} confirmPaymentWebhookDto
|
|
8065
|
+
* @param {*} [options] Override http request option.
|
|
8066
|
+
* @throws {RequiredError}
|
|
8067
|
+
*/
|
|
8068
|
+
async payosControllerHandleWebhook(confirmPaymentWebhookDto: ConfirmPaymentWebhookDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<boolean>> {
|
|
8069
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.payosControllerHandleWebhook(confirmPaymentWebhookDto, options);
|
|
8070
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
8071
|
+
const localVarOperationServerBasePath = operationServerMap['PayOSApi.payosControllerHandleWebhook']?.[localVarOperationServerIndex]?.url;
|
|
8072
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
8073
|
+
},
|
|
8074
|
+
}
|
|
8075
|
+
};
|
|
8076
|
+
|
|
8077
|
+
/**
|
|
8078
|
+
* PayOSApi - factory interface
|
|
8079
|
+
* @export
|
|
8080
|
+
*/
|
|
8081
|
+
export const PayOSApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
8082
|
+
const localVarFp = PayOSApiFp(configuration)
|
|
8083
|
+
return {
|
|
8084
|
+
/**
|
|
8085
|
+
*
|
|
8086
|
+
* @summary Cancel a payment link
|
|
8087
|
+
* @param {CancelPaymentRequestDto} cancelPaymentRequestDto
|
|
8088
|
+
* @param {*} [options] Override http request option.
|
|
8089
|
+
* @throws {RequiredError}
|
|
8090
|
+
*/
|
|
8091
|
+
payosControllerCancelPayment(cancelPaymentRequestDto: CancelPaymentRequestDto, options?: RawAxiosRequestConfig): AxiosPromise<PaymentResponseDto> {
|
|
8092
|
+
return localVarFp.payosControllerCancelPayment(cancelPaymentRequestDto, options).then((request) => request(axios, basePath));
|
|
8093
|
+
},
|
|
8094
|
+
/**
|
|
8095
|
+
*
|
|
8096
|
+
* @summary Create a new payment request
|
|
8097
|
+
* @param {CreatePaymentRequestDto} createPaymentRequestDto
|
|
8098
|
+
* @param {*} [options] Override http request option.
|
|
8099
|
+
* @throws {RequiredError}
|
|
8100
|
+
*/
|
|
8101
|
+
payosControllerCreatePaymentRequest(createPaymentRequestDto: CreatePaymentRequestDto, options?: RawAxiosRequestConfig): AxiosPromise<PaymentResponseDto> {
|
|
8102
|
+
return localVarFp.payosControllerCreatePaymentRequest(createPaymentRequestDto, options).then((request) => request(axios, basePath));
|
|
8103
|
+
},
|
|
8104
|
+
/**
|
|
8105
|
+
*
|
|
8106
|
+
* @summary Get payment status
|
|
8107
|
+
* @param {string} paymentLinkId
|
|
8108
|
+
* @param {*} [options] Override http request option.
|
|
8109
|
+
* @throws {RequiredError}
|
|
8110
|
+
*/
|
|
8111
|
+
payosControllerGetPaymentStatus(paymentLinkId: string, options?: RawAxiosRequestConfig): AxiosPromise<PaymentResponseDto> {
|
|
8112
|
+
return localVarFp.payosControllerGetPaymentStatus(paymentLinkId, options).then((request) => request(axios, basePath));
|
|
8113
|
+
},
|
|
8114
|
+
/**
|
|
8115
|
+
*
|
|
8116
|
+
* @summary Handle payment confirmation webhook
|
|
8117
|
+
* @param {ConfirmPaymentWebhookDto} confirmPaymentWebhookDto
|
|
8118
|
+
* @param {*} [options] Override http request option.
|
|
8119
|
+
* @throws {RequiredError}
|
|
8120
|
+
*/
|
|
8121
|
+
payosControllerHandleWebhook(confirmPaymentWebhookDto: ConfirmPaymentWebhookDto, options?: RawAxiosRequestConfig): AxiosPromise<boolean> {
|
|
8122
|
+
return localVarFp.payosControllerHandleWebhook(confirmPaymentWebhookDto, options).then((request) => request(axios, basePath));
|
|
8123
|
+
},
|
|
8124
|
+
};
|
|
8125
|
+
};
|
|
8126
|
+
|
|
8127
|
+
/**
|
|
8128
|
+
* PayOSApi - object-oriented interface
|
|
8129
|
+
* @export
|
|
8130
|
+
* @class PayOSApi
|
|
8131
|
+
* @extends {BaseAPI}
|
|
8132
|
+
*/
|
|
8133
|
+
export class PayOSApi extends BaseAPI {
|
|
8134
|
+
/**
|
|
8135
|
+
*
|
|
8136
|
+
* @summary Cancel a payment link
|
|
8137
|
+
* @param {CancelPaymentRequestDto} cancelPaymentRequestDto
|
|
8138
|
+
* @param {*} [options] Override http request option.
|
|
8139
|
+
* @throws {RequiredError}
|
|
8140
|
+
* @memberof PayOSApi
|
|
8141
|
+
*/
|
|
8142
|
+
public payosControllerCancelPayment(cancelPaymentRequestDto: CancelPaymentRequestDto, options?: RawAxiosRequestConfig) {
|
|
8143
|
+
return PayOSApiFp(this.configuration).payosControllerCancelPayment(cancelPaymentRequestDto, options).then((request) => request(this.axios, this.basePath));
|
|
8144
|
+
}
|
|
8145
|
+
|
|
8146
|
+
/**
|
|
8147
|
+
*
|
|
8148
|
+
* @summary Create a new payment request
|
|
8149
|
+
* @param {CreatePaymentRequestDto} createPaymentRequestDto
|
|
8150
|
+
* @param {*} [options] Override http request option.
|
|
8151
|
+
* @throws {RequiredError}
|
|
8152
|
+
* @memberof PayOSApi
|
|
8153
|
+
*/
|
|
8154
|
+
public payosControllerCreatePaymentRequest(createPaymentRequestDto: CreatePaymentRequestDto, options?: RawAxiosRequestConfig) {
|
|
8155
|
+
return PayOSApiFp(this.configuration).payosControllerCreatePaymentRequest(createPaymentRequestDto, options).then((request) => request(this.axios, this.basePath));
|
|
8156
|
+
}
|
|
8157
|
+
|
|
8158
|
+
/**
|
|
8159
|
+
*
|
|
8160
|
+
* @summary Get payment status
|
|
8161
|
+
* @param {string} paymentLinkId
|
|
8162
|
+
* @param {*} [options] Override http request option.
|
|
8163
|
+
* @throws {RequiredError}
|
|
8164
|
+
* @memberof PayOSApi
|
|
8165
|
+
*/
|
|
8166
|
+
public payosControllerGetPaymentStatus(paymentLinkId: string, options?: RawAxiosRequestConfig) {
|
|
8167
|
+
return PayOSApiFp(this.configuration).payosControllerGetPaymentStatus(paymentLinkId, options).then((request) => request(this.axios, this.basePath));
|
|
8168
|
+
}
|
|
8169
|
+
|
|
8170
|
+
/**
|
|
8171
|
+
*
|
|
8172
|
+
* @summary Handle payment confirmation webhook
|
|
8173
|
+
* @param {ConfirmPaymentWebhookDto} confirmPaymentWebhookDto
|
|
8174
|
+
* @param {*} [options] Override http request option.
|
|
8175
|
+
* @throws {RequiredError}
|
|
8176
|
+
* @memberof PayOSApi
|
|
8177
|
+
*/
|
|
8178
|
+
public payosControllerHandleWebhook(confirmPaymentWebhookDto: ConfirmPaymentWebhookDto, options?: RawAxiosRequestConfig) {
|
|
8179
|
+
return PayOSApiFp(this.configuration).payosControllerHandleWebhook(confirmPaymentWebhookDto, options).then((request) => request(this.axios, this.basePath));
|
|
8180
|
+
}
|
|
8181
|
+
}
|
|
8182
|
+
|
|
8183
|
+
|
|
8184
|
+
|
|
7538
8185
|
/**
|
|
7539
8186
|
* ProvincesApi - axios parameter creator
|
|
7540
8187
|
* @export
|