wallet 1.1.3 → 1.1.4
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/.openapi-generator/FILES +309 -309
- package/.openapi-generator-ignore +23 -23
- package/api/advertisementCreditsApi.ts +589 -589
- package/api/analyticsApi.ts +5953 -5953
- package/api/apis.ts +86 -86
- package/api/appleWalletSubscribersApi.ts +235 -235
- package/api/billingApi.ts +680 -680
- package/api/clubMembersPointsApi.ts +798 -798
- package/api/configurationApi.ts +225 -225
- package/api/countriesApi.ts +155 -155
- package/api/customerApi.ts +737 -737
- package/api/dashboardApi.ts +1553 -1553
- package/api/dynamicVouchersApi.ts +603 -603
- package/api/employeeAccessApi.ts +165 -165
- package/api/employeesApi.ts +2933 -2933
- package/api/industriesApi.ts +155 -155
- package/api/infoGenesisReportsApi.ts +2023 -2023
- package/api/integratedTerminalsApi.ts +447 -447
- package/api/interactionsApi.ts +678 -678
- package/api/linkBookApi.ts +447 -447
- package/api/linkBookSectionApi.ts +447 -447
- package/api/loginAndLogoutApi.ts +296 -296
- package/api/membershipTiersApi.ts +729 -729
- package/api/merchantApi.ts +1534 -1534
- package/api/merchantCreditsApi.ts +798 -798
- package/api/merchantURLsApi.ts +586 -586
- package/api/mobileTerminalApi.ts +323 -323
- package/api/newsApi.ts +447 -447
- package/api/paymentDesignsApi.ts +519 -519
- package/api/performancesApi.ts +447 -447
- package/api/promoCodesApi.ts +447 -447
- package/api/sMSApi.ts +1999 -1999
- package/api/settingsApi.ts +220 -220
- package/api/staticVoucherCampaignGroupsApi.ts +165 -165
- package/api/staticVoucherCampaignsApi.ts +1484 -1484
- package/api/staticVouchersApi.ts +535 -535
- package/api/systemApi.ts +604 -604
- package/api/transactionLedgerApi.ts +203 -203
- package/api/utilitiesApi.ts +157 -157
- package/api/webTerminalApi.ts +309 -309
- package/api.ts +2 -2
- package/examples/advertisementcredits.example.ts +50 -50
- package/examples/clubmembers.example.ts +50 -50
- package/examples/linkbook.example.ts +50 -50
- package/examples/membershiptiers.example.ts +49 -49
- package/examples/merchanturls.example.ts +47 -47
- package/examples/news.example.ts +51 -51
- package/examples/paymentdesigns.example.ts +56 -56
- package/git_push.sh +57 -57
- package/model/advertisementCredit.ts +103 -103
- package/model/advertisementCreditBroadcast.ts +154 -154
- package/model/advertisementCreditScan.ts +170 -170
- package/model/agreement.ts +133 -133
- package/model/alert.ts +79 -79
- package/model/announcement.ts +67 -67
- package/model/applicableTerminals.ts +30 -30
- package/model/applicableTerminalsAnyOf.ts +17 -17
- package/model/applicableTerminalsAnyOf1.ts +17 -17
- package/model/applicableTerminalsAnyOf2.ts +17 -17
- package/model/applicableTerminalsAnyOf3.ts +17 -17
- package/model/authError.ts +55 -55
- package/model/availablePhoneNumbersRequest.ts +43 -43
- package/model/clickFunnelAmount.ts +37 -37
- package/model/clickFunnelContact.ts +248 -248
- package/model/clickFunnelContactProfile.ts +235 -235
- package/model/clickFunnelEvent.ts +38 -38
- package/model/clickFunnelOriginalAmount.ts +37 -37
- package/model/clickFunnelProduct.ts +194 -194
- package/model/clickFunnelPurchase.ts +178 -178
- package/model/createStaticVoucherCampaign.ts +109 -109
- package/model/createStaticVoucherCampaignWithVoucher.ts +109 -109
- package/model/createStaticVoucherCampaignWithVoucherWithCSV.ts +109 -109
- package/model/dashboardWidget.ts +115 -115
- package/model/duplicateRowFound.ts +55 -55
- package/model/dynamicVoucher.ts +224 -224
- package/model/dynamicVoucherBroadcast.ts +154 -154
- package/model/employee.ts +109 -109
- package/model/employeeActivityLog.ts +67 -67
- package/model/employeeAlert.ts +79 -79
- package/model/exportDataFile.ts +85 -85
- package/model/falsumError.ts +41 -41
- package/model/falsumField.ts +55 -55
- package/model/feature.ts +79 -79
- package/model/forbiddenRequest.ts +55 -55
- package/model/foreignKeyDoesNotExist.ts +55 -55
- package/model/helpDeskRequest.ts +85 -85
- package/model/importedList.ts +73 -73
- package/model/importedListRecipient.ts +73 -73
- package/model/inlineObject.ts +31 -31
- package/model/inlineObject1.ts +31 -31
- package/model/inlineObject10.ts +37 -37
- package/model/inlineObject11.ts +37 -37
- package/model/inlineObject12.ts +37 -37
- package/model/inlineObject13.ts +37 -37
- package/model/inlineObject14.ts +37 -37
- package/model/inlineObject15.ts +67 -67
- package/model/inlineObject16.ts +61 -61
- package/model/inlineObject17.ts +55 -55
- package/model/inlineObject18.ts +61 -61
- package/model/inlineObject19.ts +55 -55
- package/model/inlineObject2.ts +31 -31
- package/model/inlineObject20.ts +61 -61
- package/model/inlineObject21.ts +73 -73
- package/model/inlineObject22.ts +31 -31
- package/model/inlineObject23.ts +31 -31
- package/model/inlineObject24.ts +43 -43
- package/model/inlineObject25.ts +55 -55
- package/model/inlineObject26.ts +31 -31
- package/model/inlineObject27.ts +31 -31
- package/model/inlineObject28.ts +43 -43
- package/model/inlineObject29.ts +49 -49
- package/model/inlineObject3.ts +31 -31
- package/model/inlineObject30.ts +43 -43
- package/model/inlineObject31.ts +31 -31
- package/model/inlineObject32.ts +31 -31
- package/model/inlineObject33.ts +31 -31
- package/model/inlineObject34.ts +43 -43
- package/model/inlineObject35.ts +43 -43
- package/model/inlineObject36.ts +43 -43
- package/model/inlineObject37.ts +43 -43
- package/model/inlineObject38.ts +43 -43
- package/model/inlineObject39.ts +43 -43
- package/model/inlineObject4.ts +37 -37
- package/model/inlineObject40.ts +43 -43
- package/model/inlineObject41.ts +43 -43
- package/model/inlineObject42.ts +43 -43
- package/model/inlineObject43.ts +43 -43
- package/model/inlineObject44.ts +43 -43
- package/model/inlineObject45.ts +43 -43
- package/model/inlineObject46.ts +43 -43
- package/model/inlineObject47.ts +43 -43
- package/model/inlineObject48.ts +43 -43
- package/model/inlineObject49.ts +43 -43
- package/model/inlineObject5.ts +31 -31
- package/model/inlineObject50.ts +43 -43
- package/model/inlineObject51.ts +97 -97
- package/model/inlineObject52.ts +31 -31
- package/model/inlineObject53.ts +97 -97
- package/model/inlineObject54.ts +97 -97
- package/model/inlineObject55.ts +91 -91
- package/model/inlineObject56.ts +37 -37
- package/model/inlineObject57.ts +37 -37
- package/model/inlineObject58.ts +37 -37
- package/model/inlineObject59.ts +43 -43
- package/model/inlineObject6.ts +31 -31
- package/model/inlineObject60.ts +43 -43
- package/model/inlineObject61.ts +43 -43
- package/model/inlineObject62.ts +37 -37
- package/model/inlineObject63.ts +37 -37
- package/model/inlineObject64.ts +37 -37
- package/model/inlineObject65.ts +205 -205
- package/model/inlineObject66.ts +49 -49
- package/model/inlineObject67.ts +49 -49
- package/model/inlineObject68.ts +37 -37
- package/model/inlineObject69.ts +121 -121
- package/model/inlineObject7.ts +31 -31
- package/model/inlineObject8.ts +43 -43
- package/model/inlineObject9.ts +37 -37
- package/model/inlineResponse200.ts +37 -37
- package/model/inlineResponse2001.ts +56 -56
- package/model/inlineResponse20010.ts +109 -109
- package/model/inlineResponse20011.ts +43 -43
- package/model/inlineResponse2002.ts +31 -31
- package/model/inlineResponse2003.ts +31 -31
- package/model/inlineResponse2004.ts +43 -43
- package/model/inlineResponse2005.ts +38 -38
- package/model/inlineResponse2006.ts +97 -97
- package/model/inlineResponse2007.ts +44 -44
- package/model/inlineResponse2008.ts +31 -31
- package/model/inlineResponse2009.ts +98 -98
- package/model/internalServerError.ts +55 -55
- package/model/ledgerEntry.ts +176 -176
- package/model/linkBook.ts +85 -85
- package/model/linkBookSection.ts +61 -61
- package/model/mSMemberHistory.ts +112 -112
- package/model/mSMemberHistoryPagination.ts +53 -53
- package/model/mSMemberRedemption.ts +109 -109
- package/model/mSMemberRedemptionPagination.ts +53 -53
- package/model/mSMembershipTierHistory.ts +106 -106
- package/model/mSMembershipTierHistoryPagination.ts +53 -53
- package/model/mSMembershipTierRedemption.ts +121 -121
- package/model/mSMembershipTierRedemptionPagination.ts +53 -53
- package/model/mSMerchantCreditHistory.ts +88 -88
- package/model/mSMerchantCreditHistoryPagination.ts +53 -53
- package/model/mSMerchantCreditRedemption.ts +109 -109
- package/model/mSMerchantCreditRedemptionPagination.ts +53 -53
- package/model/mediaFile.ts +85 -85
- package/model/member.ts +118 -118
- package/model/memberSearch.ts +61 -61
- package/model/merchant.ts +133 -133
- package/model/merchantCreditSearch.ts +61 -61
- package/model/merchantNotInitialized.ts +55 -55
- package/model/merchantURL.ts +67 -67
- package/model/message.ts +74 -74
- package/model/models.ts +1015 -1015
- package/model/moduleError.ts +157 -157
- package/model/newsArticle.ts +85 -85
- package/model/optInList.ts +121 -121
- package/model/optInListSource.ts +73 -73
- package/model/optInListSubscriber.ts +104 -104
- package/model/outboundSMS.ts +157 -157
- package/model/paginatedWTMembers.ts +53 -53
- package/model/paginatedWTMerchantCredits.ts +53 -53
- package/model/paginationRequestWithSortOptions.ts +75 -75
- package/model/paymentDesign.ts +139 -139
- package/model/performance.ts +100 -100
- package/model/phoneNumber.ts +157 -157
- package/model/pickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.ts +106 -106
- package/model/pickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.ts +67 -67
- package/model/pickMSMemberExcludeKeyofMSMemberMemberIdentifier.ts +106 -106
- package/model/pickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.ts +43 -43
- package/model/pickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.ts +82 -82
- package/model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.ts +46 -46
- package/model/pickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.ts +52 -52
- package/model/pickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.ts +100 -100
- package/model/pickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeID.ts +94 -94
- package/model/pickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.ts +100 -100
- package/model/pickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.ts +46 -46
- package/model/pickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.ts +154 -154
- package/model/pickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.ts +137 -137
- package/model/pickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.ts +58 -58
- package/model/pickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.ts +106 -106
- package/model/pickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.ts +142 -142
- package/model/pickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsBackgroundImageURLOrCompanyLogoURLOrEmployeeID.ts +94 -94
- package/model/pickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.ts +106 -106
- package/model/pickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.ts +167 -167
- package/model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID.ts +58 -58
- package/model/pickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.ts +58 -58
- package/model/pickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.ts +76 -76
- package/model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.ts +52 -52
- package/model/pickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.ts +40 -40
- package/model/pickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.ts +58 -58
- package/model/pickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.ts +138 -138
- package/model/pickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.ts +112 -112
- package/model/pickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.ts +46 -46
- package/model/plan.ts +62 -62
- package/model/portalPage.ts +67 -67
- package/model/presignedPost.ts +41 -41
- package/model/presignedPostFields.ts +43 -43
- package/model/product.ts +74 -74
- package/model/promoCode.ts +97 -97
- package/model/reachPerformanceStats.ts +70 -70
- package/model/request.ts +349 -349
- package/model/response.ts +67 -67
- package/model/role.ts +117 -117
- package/model/roleAuditLog.ts +97 -97
- package/model/sSOptInSource.ts +73 -73
- package/model/simpleSMSBroadcast.ts +147 -147
- package/model/staticVoucher.ts +224 -224
- package/model/staticVoucherCampaign.ts +175 -175
- package/model/staticVoucherCampaignBroadcast.ts +142 -142
- package/model/staticVoucherCampaignGroup.ts +85 -85
- package/model/staticVoucherCampaignUpdate.ts +85 -85
- package/model/status.ts +30 -30
- package/model/statusAnyOf.ts +17 -17
- package/model/statusAnyOf1.ts +17 -17
- package/model/statusAnyOf2.ts +17 -17
- package/model/statusAnyOf3.ts +17 -17
- package/model/subscriptionFeature.ts +79 -79
- package/model/subscriptionPlan.ts +69 -69
- package/model/subscriptionProduct.ts +81 -81
- package/model/tcpa.ts +67 -67
- package/model/updateStaticVoucherCampaignWithVoucher.ts +109 -109
- package/model/vSCampaignGeneratedMessage.ts +43 -43
- package/model/vSCampaignGeneratedMessagePagination.ts +53 -53
- package/model/vSDynamicVoucherStatus.ts +28 -28
- package/model/wTAdvertisementCredit.ts +103 -103
- package/model/wTAdvertisementCreditScan.ts +170 -170
- package/model/wTAdvertisementCreditUpdateParams.ts +55 -55
- package/model/wTDynamicVoucher.ts +224 -224
- package/model/wTDynamicVoucherCreateParams.ts +103 -103
- package/model/wTDynamicVoucherRedemption.ts +164 -164
- package/model/wTDynamicVoucherSummary.ts +169 -169
- package/model/wTDynamicVoucherUpdateParams.ts +103 -103
- package/model/wTEmployee.ts +109 -109
- package/model/wTEmployeeCreate.ts +61 -61
- package/model/wTEmployeeUpdate.ts +55 -55
- package/model/wTImportedList.ts +73 -73
- package/model/wTLinkBookCreateParams.ts +55 -55
- package/model/wTLinkBookSectionCreateParams.ts +31 -31
- package/model/wTLinkBookSectionUpdateParams.ts +31 -31
- package/model/wTLinkBookUpdateParams.ts +55 -55
- package/model/wTMember.ts +118 -118
- package/model/wTMemberCreationParams.ts +73 -73
- package/model/wTMembershipTier.ts +106 -106
- package/model/wTMembershipTierCreationParams.ts +64 -64
- package/model/wTMembershipTierUpdateParams.ts +64 -64
- package/model/wTMembershipTierWithMemberCount.ts +115 -115
- package/model/wTMerchantCredit.ts +106 -106
- package/model/wTMerchantCreditCreationParams.ts +49 -49
- package/model/wTMerchantURLCreate.ts +37 -37
- package/model/wTMerchantURLUpdate.ts +37 -37
- package/model/wTNewsArticleCreateParams.ts +55 -55
- package/model/wTNewsArticleUpdateParams.ts +55 -55
- package/model/wTOptInList.ts +121 -121
- package/model/wTOptInListCreationParams.ts +91 -91
- package/model/wTPaymentDesign.ts +139 -139
- package/model/wTPaymentDesignCreateParams.ts +115 -115
- package/model/wTPaymentDesignUpdateParams.ts +115 -115
- package/model/wTPerformanceCreateParams.ts +70 -70
- package/model/wTPerformanceUpdateParams.ts +70 -70
- package/model/wTPosMachine.ts +88 -88
- package/model/wTPosMachineCreateParams.ts +58 -58
- package/model/wTPosMachineUpdateParams.ts +58 -58
- package/model/wTPromoCodeCreateParams.ts +67 -67
- package/model/wTPromoCodeUpdateParams.ts +67 -67
- package/model/wTRole.ts +116 -116
- package/model/wTStaticVoucher.ts +224 -224
- package/model/wTStaticVoucherCampaign.ts +175 -175
- package/model/wTStaticVoucherCreateParams.ts +49 -49
- package/model/wTStaticVoucherUpdateParams.ts +43 -43
- package/model/wTWalletPageView.ts +251 -251
- package/model/wTWalletPageViewGeoPoint.ts +37 -37
- package/model/walletPageView.ts +251 -251
- package/model/webpage.ts +85 -85
- package/package.json +28 -25
- package/readme-generator.py +42 -42
- package/tsconfig.json +25 -25
|
@@ -1,798 +1,798 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* wallet-api
|
|
3
|
-
* API
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.1.3
|
|
6
|
-
* Contact: development@wallet.inc
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import localVarRequest from 'request';
|
|
15
|
-
import http from 'http';
|
|
16
|
-
|
|
17
|
-
/* tslint:disable:no-unused-locals */
|
|
18
|
-
import { AuthError } from '../model/authError';
|
|
19
|
-
import { DuplicateRowFound } from '../model/duplicateRowFound';
|
|
20
|
-
import { FalsumError } from '../model/falsumError';
|
|
21
|
-
import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
|
|
22
|
-
import { InlineResponse2003 } from '../model/inlineResponse2003';
|
|
23
|
-
import { InternalServerError } from '../model/internalServerError';
|
|
24
|
-
import { MSMerchantCreditHistoryPagination } from '../model/mSMerchantCreditHistoryPagination';
|
|
25
|
-
import { MSMerchantCreditRedemptionPagination } from '../model/mSMerchantCreditRedemptionPagination';
|
|
26
|
-
import { MerchantCreditSearch } from '../model/merchantCreditSearch';
|
|
27
|
-
import { MerchantNotInitialized } from '../model/merchantNotInitialized';
|
|
28
|
-
import { PaginatedWTMerchantCredits } from '../model/paginatedWTMerchantCredits';
|
|
29
|
-
import { PaginationRequestWithSortOptions } from '../model/paginationRequestWithSortOptions';
|
|
30
|
-
import { PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded } from '../model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded';
|
|
31
|
-
import { PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber } from '../model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber';
|
|
32
|
-
import { UNKNOWN_BASE_TYPE } from '../model/uNKNOWNBASETYPE';
|
|
33
|
-
import { WTMerchantCredit } from '../model/wTMerchantCredit';
|
|
34
|
-
import { WTMerchantCreditCreationParams } from '../model/wTMerchantCreditCreationParams';
|
|
35
|
-
|
|
36
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
37
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
38
|
-
|
|
39
|
-
import { HttpError, RequestFile } from './apis';
|
|
40
|
-
|
|
41
|
-
let defaultBasePath = 'https://api.wall.et';
|
|
42
|
-
|
|
43
|
-
// ===============================================
|
|
44
|
-
// This file is autogenerated - Please do not edit
|
|
45
|
-
// ===============================================
|
|
46
|
-
|
|
47
|
-
export enum MerchantCreditsApiApiKeys {
|
|
48
|
-
api_key,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class MerchantCreditsApi {
|
|
52
|
-
protected _basePath = defaultBasePath;
|
|
53
|
-
protected _defaultHeaders : any = {};
|
|
54
|
-
protected _useQuerystring : boolean = false;
|
|
55
|
-
|
|
56
|
-
protected authentications = {
|
|
57
|
-
'default': <Authentication>new VoidAuth(),
|
|
58
|
-
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
protected interceptors: Interceptor[] = [];
|
|
62
|
-
|
|
63
|
-
constructor(basePath?: string);
|
|
64
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
65
|
-
if (password) {
|
|
66
|
-
if (basePath) {
|
|
67
|
-
this.basePath = basePath;
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
if (basePathOrUsername) {
|
|
71
|
-
this.basePath = basePathOrUsername
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
set useQuerystring(value: boolean) {
|
|
77
|
-
this._useQuerystring = value;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
set basePath(basePath: string) {
|
|
81
|
-
this._basePath = basePath;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
85
|
-
this._defaultHeaders = defaultHeaders;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
get defaultHeaders() {
|
|
89
|
-
return this._defaultHeaders;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get basePath() {
|
|
93
|
-
return this._basePath;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
97
|
-
this.authentications.default = auth;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public setApiKey(key: MerchantCreditsApiApiKeys, value: string) {
|
|
101
|
-
(this.authentications as any)[MerchantCreditsApiApiKeys[key]].apiKey = value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
105
|
-
this.interceptors.push(interceptor);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
*
|
|
110
|
-
* @summary Archive merchant credit
|
|
111
|
-
* @param id
|
|
112
|
-
*/
|
|
113
|
-
public async archiveMerchantCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
114
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
115
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
116
|
-
let localVarQueryParameters: any = {};
|
|
117
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
118
|
-
const produces = ['application/json'];
|
|
119
|
-
// give precedence to 'application/json'
|
|
120
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
121
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
122
|
-
} else {
|
|
123
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
124
|
-
}
|
|
125
|
-
let localVarFormParams: any = {};
|
|
126
|
-
|
|
127
|
-
// verify required parameter 'id' is not null or undefined
|
|
128
|
-
if (id === null || id === undefined) {
|
|
129
|
-
throw new Error('Required parameter id was null or undefined when calling archiveMerchantCredit.');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
133
|
-
|
|
134
|
-
let localVarUseFormData = false;
|
|
135
|
-
|
|
136
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
137
|
-
method: 'DELETE',
|
|
138
|
-
qs: localVarQueryParameters,
|
|
139
|
-
headers: localVarHeaderParams,
|
|
140
|
-
uri: localVarPath,
|
|
141
|
-
useQuerystring: this._useQuerystring,
|
|
142
|
-
json: true,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
let authenticationPromise = Promise.resolve();
|
|
146
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
147
|
-
|
|
148
|
-
let interceptorPromise = authenticationPromise;
|
|
149
|
-
for (const interceptor of this.interceptors) {
|
|
150
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return interceptorPromise.then(() => {
|
|
154
|
-
if (Object.keys(localVarFormParams).length) {
|
|
155
|
-
if (localVarUseFormData) {
|
|
156
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
157
|
-
} else {
|
|
158
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
162
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
163
|
-
if (error) {
|
|
164
|
-
reject(error);
|
|
165
|
-
} else {
|
|
166
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
167
|
-
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
168
|
-
resolve({ response: response, body: body });
|
|
169
|
-
} else {
|
|
170
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
*
|
|
179
|
-
* @summary Create merchant credit
|
|
180
|
-
* @param wTMerchantCreditCreationParams
|
|
181
|
-
*/
|
|
182
|
-
public async createMerchantCredit (wTMerchantCreditCreationParams: WTMerchantCreditCreationParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
183
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit';
|
|
184
|
-
let localVarQueryParameters: any = {};
|
|
185
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
186
|
-
const produces = ['application/json'];
|
|
187
|
-
// give precedence to 'application/json'
|
|
188
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
189
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
190
|
-
} else {
|
|
191
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
192
|
-
}
|
|
193
|
-
let localVarFormParams: any = {};
|
|
194
|
-
|
|
195
|
-
// verify required parameter 'wTMerchantCreditCreationParams' is not null or undefined
|
|
196
|
-
if (wTMerchantCreditCreationParams === null || wTMerchantCreditCreationParams === undefined) {
|
|
197
|
-
throw new Error('Required parameter wTMerchantCreditCreationParams was null or undefined when calling createMerchantCredit.');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
201
|
-
|
|
202
|
-
let localVarUseFormData = false;
|
|
203
|
-
|
|
204
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
205
|
-
method: 'POST',
|
|
206
|
-
qs: localVarQueryParameters,
|
|
207
|
-
headers: localVarHeaderParams,
|
|
208
|
-
uri: localVarPath,
|
|
209
|
-
useQuerystring: this._useQuerystring,
|
|
210
|
-
json: true,
|
|
211
|
-
body: ObjectSerializer.serialize(wTMerchantCreditCreationParams, "WTMerchantCreditCreationParams")
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
let authenticationPromise = Promise.resolve();
|
|
215
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
216
|
-
|
|
217
|
-
let interceptorPromise = authenticationPromise;
|
|
218
|
-
for (const interceptor of this.interceptors) {
|
|
219
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return interceptorPromise.then(() => {
|
|
223
|
-
if (Object.keys(localVarFormParams).length) {
|
|
224
|
-
if (localVarUseFormData) {
|
|
225
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
226
|
-
} else {
|
|
227
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
231
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
232
|
-
if (error) {
|
|
233
|
-
reject(error);
|
|
234
|
-
} else {
|
|
235
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
236
|
-
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
237
|
-
resolve({ response: response, body: body });
|
|
238
|
-
} else {
|
|
239
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
*
|
|
248
|
-
* @summary Fetch merchant credit
|
|
249
|
-
* @param id
|
|
250
|
-
*/
|
|
251
|
-
public async fetchMerchantCreditById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
252
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
253
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
254
|
-
let localVarQueryParameters: any = {};
|
|
255
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
256
|
-
const produces = ['application/json'];
|
|
257
|
-
// give precedence to 'application/json'
|
|
258
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
259
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
260
|
-
} else {
|
|
261
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
262
|
-
}
|
|
263
|
-
let localVarFormParams: any = {};
|
|
264
|
-
|
|
265
|
-
// verify required parameter 'id' is not null or undefined
|
|
266
|
-
if (id === null || id === undefined) {
|
|
267
|
-
throw new Error('Required parameter id was null or undefined when calling fetchMerchantCreditById.');
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
271
|
-
|
|
272
|
-
let localVarUseFormData = false;
|
|
273
|
-
|
|
274
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
275
|
-
method: 'GET',
|
|
276
|
-
qs: localVarQueryParameters,
|
|
277
|
-
headers: localVarHeaderParams,
|
|
278
|
-
uri: localVarPath,
|
|
279
|
-
useQuerystring: this._useQuerystring,
|
|
280
|
-
json: true,
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
let authenticationPromise = Promise.resolve();
|
|
284
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
285
|
-
|
|
286
|
-
let interceptorPromise = authenticationPromise;
|
|
287
|
-
for (const interceptor of this.interceptors) {
|
|
288
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return interceptorPromise.then(() => {
|
|
292
|
-
if (Object.keys(localVarFormParams).length) {
|
|
293
|
-
if (localVarUseFormData) {
|
|
294
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
295
|
-
} else {
|
|
296
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
300
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
301
|
-
if (error) {
|
|
302
|
-
reject(error);
|
|
303
|
-
} else {
|
|
304
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
305
|
-
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
306
|
-
resolve({ response: response, body: body });
|
|
307
|
-
} else {
|
|
308
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
*
|
|
317
|
-
* @summary Fetch all active merchant credits
|
|
318
|
-
*/
|
|
319
|
-
public async fetchMerchantCreditCount (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
320
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/count';
|
|
321
|
-
let localVarQueryParameters: any = {};
|
|
322
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
323
|
-
const produces = ['application/json'];
|
|
324
|
-
// give precedence to 'application/json'
|
|
325
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
326
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
327
|
-
} else {
|
|
328
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
329
|
-
}
|
|
330
|
-
let localVarFormParams: any = {};
|
|
331
|
-
|
|
332
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
333
|
-
|
|
334
|
-
let localVarUseFormData = false;
|
|
335
|
-
|
|
336
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
337
|
-
method: 'GET',
|
|
338
|
-
qs: localVarQueryParameters,
|
|
339
|
-
headers: localVarHeaderParams,
|
|
340
|
-
uri: localVarPath,
|
|
341
|
-
useQuerystring: this._useQuerystring,
|
|
342
|
-
json: true,
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
let authenticationPromise = Promise.resolve();
|
|
346
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
347
|
-
|
|
348
|
-
let interceptorPromise = authenticationPromise;
|
|
349
|
-
for (const interceptor of this.interceptors) {
|
|
350
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return interceptorPromise.then(() => {
|
|
354
|
-
if (Object.keys(localVarFormParams).length) {
|
|
355
|
-
if (localVarUseFormData) {
|
|
356
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
357
|
-
} else {
|
|
358
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
362
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
363
|
-
if (error) {
|
|
364
|
-
reject(error);
|
|
365
|
-
} else {
|
|
366
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
367
|
-
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
368
|
-
resolve({ response: response, body: body });
|
|
369
|
-
} else {
|
|
370
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
*
|
|
379
|
-
* @summary Fetch history
|
|
380
|
-
* @param uNKNOWNBASETYPE
|
|
381
|
-
*/
|
|
382
|
-
public async fetchMerchantCreditHistoryLog (uNKNOWNBASETYPE: UNKNOWN_BASE_TYPE, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MSMerchantCreditHistoryPagination; }> {
|
|
383
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/history/log';
|
|
384
|
-
let localVarQueryParameters: any = {};
|
|
385
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
386
|
-
const produces = ['application/json'];
|
|
387
|
-
// give precedence to 'application/json'
|
|
388
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
389
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
390
|
-
} else {
|
|
391
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
392
|
-
}
|
|
393
|
-
let localVarFormParams: any = {};
|
|
394
|
-
|
|
395
|
-
// verify required parameter 'uNKNOWNBASETYPE' is not null or undefined
|
|
396
|
-
if (uNKNOWNBASETYPE === null || uNKNOWNBASETYPE === undefined) {
|
|
397
|
-
throw new Error('Required parameter uNKNOWNBASETYPE was null or undefined when calling fetchMerchantCreditHistoryLog.');
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
401
|
-
|
|
402
|
-
let localVarUseFormData = false;
|
|
403
|
-
|
|
404
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
405
|
-
method: 'POST',
|
|
406
|
-
qs: localVarQueryParameters,
|
|
407
|
-
headers: localVarHeaderParams,
|
|
408
|
-
uri: localVarPath,
|
|
409
|
-
useQuerystring: this._useQuerystring,
|
|
410
|
-
json: true,
|
|
411
|
-
body: ObjectSerializer.serialize(uNKNOWNBASETYPE, "UNKNOWN_BASE_TYPE")
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
let authenticationPromise = Promise.resolve();
|
|
415
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
416
|
-
|
|
417
|
-
let interceptorPromise = authenticationPromise;
|
|
418
|
-
for (const interceptor of this.interceptors) {
|
|
419
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
return interceptorPromise.then(() => {
|
|
423
|
-
if (Object.keys(localVarFormParams).length) {
|
|
424
|
-
if (localVarUseFormData) {
|
|
425
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
426
|
-
} else {
|
|
427
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return new Promise<{ response: http.IncomingMessage; body: MSMerchantCreditHistoryPagination; }>((resolve, reject) => {
|
|
431
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
432
|
-
if (error) {
|
|
433
|
-
reject(error);
|
|
434
|
-
} else {
|
|
435
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
436
|
-
body = ObjectSerializer.deserialize(body, "MSMerchantCreditHistoryPagination");
|
|
437
|
-
resolve({ response: response, body: body });
|
|
438
|
-
} else {
|
|
439
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
*
|
|
448
|
-
* @summary Fetch redemption log
|
|
449
|
-
* @param uNKNOWNBASETYPE
|
|
450
|
-
*/
|
|
451
|
-
public async fetchMerchantCreditRedemptionLog (uNKNOWNBASETYPE: UNKNOWN_BASE_TYPE, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MSMerchantCreditRedemptionPagination; }> {
|
|
452
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/redemption/log';
|
|
453
|
-
let localVarQueryParameters: any = {};
|
|
454
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
455
|
-
const produces = ['application/json'];
|
|
456
|
-
// give precedence to 'application/json'
|
|
457
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
458
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
459
|
-
} else {
|
|
460
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
461
|
-
}
|
|
462
|
-
let localVarFormParams: any = {};
|
|
463
|
-
|
|
464
|
-
// verify required parameter 'uNKNOWNBASETYPE' is not null or undefined
|
|
465
|
-
if (uNKNOWNBASETYPE === null || uNKNOWNBASETYPE === undefined) {
|
|
466
|
-
throw new Error('Required parameter uNKNOWNBASETYPE was null or undefined when calling fetchMerchantCreditRedemptionLog.');
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
470
|
-
|
|
471
|
-
let localVarUseFormData = false;
|
|
472
|
-
|
|
473
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
474
|
-
method: 'POST',
|
|
475
|
-
qs: localVarQueryParameters,
|
|
476
|
-
headers: localVarHeaderParams,
|
|
477
|
-
uri: localVarPath,
|
|
478
|
-
useQuerystring: this._useQuerystring,
|
|
479
|
-
json: true,
|
|
480
|
-
body: ObjectSerializer.serialize(uNKNOWNBASETYPE, "UNKNOWN_BASE_TYPE")
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
let authenticationPromise = Promise.resolve();
|
|
484
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
485
|
-
|
|
486
|
-
let interceptorPromise = authenticationPromise;
|
|
487
|
-
for (const interceptor of this.interceptors) {
|
|
488
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
return interceptorPromise.then(() => {
|
|
492
|
-
if (Object.keys(localVarFormParams).length) {
|
|
493
|
-
if (localVarUseFormData) {
|
|
494
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
495
|
-
} else {
|
|
496
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return new Promise<{ response: http.IncomingMessage; body: MSMerchantCreditRedemptionPagination; }>((resolve, reject) => {
|
|
500
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
501
|
-
if (error) {
|
|
502
|
-
reject(error);
|
|
503
|
-
} else {
|
|
504
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
505
|
-
body = ObjectSerializer.deserialize(body, "MSMerchantCreditRedemptionPagination");
|
|
506
|
-
resolve({ response: response, body: body });
|
|
507
|
-
} else {
|
|
508
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
*
|
|
517
|
-
* @summary Fetch merchant credits by page
|
|
518
|
-
* @param paginationRequestWithSortOptions
|
|
519
|
-
*/
|
|
520
|
-
public async fetchMerchantCreditsByPage (paginationRequestWithSortOptions: PaginationRequestWithSortOptions, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTMerchantCredit>; }> {
|
|
521
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/page';
|
|
522
|
-
let localVarQueryParameters: any = {};
|
|
523
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
524
|
-
const produces = ['application/json'];
|
|
525
|
-
// give precedence to 'application/json'
|
|
526
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
527
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
528
|
-
} else {
|
|
529
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
530
|
-
}
|
|
531
|
-
let localVarFormParams: any = {};
|
|
532
|
-
|
|
533
|
-
// verify required parameter 'paginationRequestWithSortOptions' is not null or undefined
|
|
534
|
-
if (paginationRequestWithSortOptions === null || paginationRequestWithSortOptions === undefined) {
|
|
535
|
-
throw new Error('Required parameter paginationRequestWithSortOptions was null or undefined when calling fetchMerchantCreditsByPage.');
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
539
|
-
|
|
540
|
-
let localVarUseFormData = false;
|
|
541
|
-
|
|
542
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
543
|
-
method: 'POST',
|
|
544
|
-
qs: localVarQueryParameters,
|
|
545
|
-
headers: localVarHeaderParams,
|
|
546
|
-
uri: localVarPath,
|
|
547
|
-
useQuerystring: this._useQuerystring,
|
|
548
|
-
json: true,
|
|
549
|
-
body: ObjectSerializer.serialize(paginationRequestWithSortOptions, "PaginationRequestWithSortOptions")
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
let authenticationPromise = Promise.resolve();
|
|
553
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
554
|
-
|
|
555
|
-
let interceptorPromise = authenticationPromise;
|
|
556
|
-
for (const interceptor of this.interceptors) {
|
|
557
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
return interceptorPromise.then(() => {
|
|
561
|
-
if (Object.keys(localVarFormParams).length) {
|
|
562
|
-
if (localVarUseFormData) {
|
|
563
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
564
|
-
} else {
|
|
565
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTMerchantCredit>; }>((resolve, reject) => {
|
|
569
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
570
|
-
if (error) {
|
|
571
|
-
reject(error);
|
|
572
|
-
} else {
|
|
573
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
574
|
-
body = ObjectSerializer.deserialize(body, "Array<WTMerchantCredit>");
|
|
575
|
-
resolve({ response: response, body: body });
|
|
576
|
-
} else {
|
|
577
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
});
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
*
|
|
586
|
-
* @summary Restore merchant credit
|
|
587
|
-
* @param id
|
|
588
|
-
*/
|
|
589
|
-
public async restoreMerchantCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
590
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
591
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
592
|
-
let localVarQueryParameters: any = {};
|
|
593
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
594
|
-
const produces = ['application/json'];
|
|
595
|
-
// give precedence to 'application/json'
|
|
596
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
597
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
598
|
-
} else {
|
|
599
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
600
|
-
}
|
|
601
|
-
let localVarFormParams: any = {};
|
|
602
|
-
|
|
603
|
-
// verify required parameter 'id' is not null or undefined
|
|
604
|
-
if (id === null || id === undefined) {
|
|
605
|
-
throw new Error('Required parameter id was null or undefined when calling restoreMerchantCredit.');
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
609
|
-
|
|
610
|
-
let localVarUseFormData = false;
|
|
611
|
-
|
|
612
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
613
|
-
method: 'PATCH',
|
|
614
|
-
qs: localVarQueryParameters,
|
|
615
|
-
headers: localVarHeaderParams,
|
|
616
|
-
uri: localVarPath,
|
|
617
|
-
useQuerystring: this._useQuerystring,
|
|
618
|
-
json: true,
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
let authenticationPromise = Promise.resolve();
|
|
622
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
623
|
-
|
|
624
|
-
let interceptorPromise = authenticationPromise;
|
|
625
|
-
for (const interceptor of this.interceptors) {
|
|
626
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
return interceptorPromise.then(() => {
|
|
630
|
-
if (Object.keys(localVarFormParams).length) {
|
|
631
|
-
if (localVarUseFormData) {
|
|
632
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
633
|
-
} else {
|
|
634
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
638
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
639
|
-
if (error) {
|
|
640
|
-
reject(error);
|
|
641
|
-
} else {
|
|
642
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
643
|
-
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
644
|
-
resolve({ response: response, body: body });
|
|
645
|
-
} else {
|
|
646
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
*
|
|
655
|
-
* @summary Search for merchant credits
|
|
656
|
-
* @param merchantCreditSearch
|
|
657
|
-
*/
|
|
658
|
-
public async searchMerchantCredits (merchantCreditSearch: MerchantCreditSearch, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaginatedWTMerchantCredits; }> {
|
|
659
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/search';
|
|
660
|
-
let localVarQueryParameters: any = {};
|
|
661
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
662
|
-
const produces = ['application/json'];
|
|
663
|
-
// give precedence to 'application/json'
|
|
664
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
665
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
666
|
-
} else {
|
|
667
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
668
|
-
}
|
|
669
|
-
let localVarFormParams: any = {};
|
|
670
|
-
|
|
671
|
-
// verify required parameter 'merchantCreditSearch' is not null or undefined
|
|
672
|
-
if (merchantCreditSearch === null || merchantCreditSearch === undefined) {
|
|
673
|
-
throw new Error('Required parameter merchantCreditSearch was null or undefined when calling searchMerchantCredits.');
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
677
|
-
|
|
678
|
-
let localVarUseFormData = false;
|
|
679
|
-
|
|
680
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
681
|
-
method: 'POST',
|
|
682
|
-
qs: localVarQueryParameters,
|
|
683
|
-
headers: localVarHeaderParams,
|
|
684
|
-
uri: localVarPath,
|
|
685
|
-
useQuerystring: this._useQuerystring,
|
|
686
|
-
json: true,
|
|
687
|
-
body: ObjectSerializer.serialize(merchantCreditSearch, "MerchantCreditSearch")
|
|
688
|
-
};
|
|
689
|
-
|
|
690
|
-
let authenticationPromise = Promise.resolve();
|
|
691
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
692
|
-
|
|
693
|
-
let interceptorPromise = authenticationPromise;
|
|
694
|
-
for (const interceptor of this.interceptors) {
|
|
695
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
return interceptorPromise.then(() => {
|
|
699
|
-
if (Object.keys(localVarFormParams).length) {
|
|
700
|
-
if (localVarUseFormData) {
|
|
701
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
702
|
-
} else {
|
|
703
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return new Promise<{ response: http.IncomingMessage; body: PaginatedWTMerchantCredits; }>((resolve, reject) => {
|
|
707
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
708
|
-
if (error) {
|
|
709
|
-
reject(error);
|
|
710
|
-
} else {
|
|
711
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
712
|
-
body = ObjectSerializer.deserialize(body, "PaginatedWTMerchantCredits");
|
|
713
|
-
resolve({ response: response, body: body });
|
|
714
|
-
} else {
|
|
715
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
});
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
*
|
|
724
|
-
* @summary Update merchant credit
|
|
725
|
-
* @param id
|
|
726
|
-
* @param pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber
|
|
727
|
-
*/
|
|
728
|
-
public async updateMerchantCredit (id: any, pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber: PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
729
|
-
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
730
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
731
|
-
let localVarQueryParameters: any = {};
|
|
732
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
733
|
-
const produces = ['application/json'];
|
|
734
|
-
// give precedence to 'application/json'
|
|
735
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
736
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
737
|
-
} else {
|
|
738
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
739
|
-
}
|
|
740
|
-
let localVarFormParams: any = {};
|
|
741
|
-
|
|
742
|
-
// verify required parameter 'id' is not null or undefined
|
|
743
|
-
if (id === null || id === undefined) {
|
|
744
|
-
throw new Error('Required parameter id was null or undefined when calling updateMerchantCredit.');
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
// verify required parameter 'pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber' is not null or undefined
|
|
748
|
-
if (pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber === null || pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber === undefined) {
|
|
749
|
-
throw new Error('Required parameter pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber was null or undefined when calling updateMerchantCredit.');
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
753
|
-
|
|
754
|
-
let localVarUseFormData = false;
|
|
755
|
-
|
|
756
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
757
|
-
method: 'PUT',
|
|
758
|
-
qs: localVarQueryParameters,
|
|
759
|
-
headers: localVarHeaderParams,
|
|
760
|
-
uri: localVarPath,
|
|
761
|
-
useQuerystring: this._useQuerystring,
|
|
762
|
-
json: true,
|
|
763
|
-
body: ObjectSerializer.serialize(pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber, "PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber")
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
let authenticationPromise = Promise.resolve();
|
|
767
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
768
|
-
|
|
769
|
-
let interceptorPromise = authenticationPromise;
|
|
770
|
-
for (const interceptor of this.interceptors) {
|
|
771
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
return interceptorPromise.then(() => {
|
|
775
|
-
if (Object.keys(localVarFormParams).length) {
|
|
776
|
-
if (localVarUseFormData) {
|
|
777
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
778
|
-
} else {
|
|
779
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
783
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
784
|
-
if (error) {
|
|
785
|
-
reject(error);
|
|
786
|
-
} else {
|
|
787
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
788
|
-
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
789
|
-
resolve({ response: response, body: body });
|
|
790
|
-
} else {
|
|
791
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* wallet-api
|
|
3
|
+
* API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.1.3
|
|
6
|
+
* Contact: development@wallet.inc
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AuthError } from '../model/authError';
|
|
19
|
+
import { DuplicateRowFound } from '../model/duplicateRowFound';
|
|
20
|
+
import { FalsumError } from '../model/falsumError';
|
|
21
|
+
import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
|
|
22
|
+
import { InlineResponse2003 } from '../model/inlineResponse2003';
|
|
23
|
+
import { InternalServerError } from '../model/internalServerError';
|
|
24
|
+
import { MSMerchantCreditHistoryPagination } from '../model/mSMerchantCreditHistoryPagination';
|
|
25
|
+
import { MSMerchantCreditRedemptionPagination } from '../model/mSMerchantCreditRedemptionPagination';
|
|
26
|
+
import { MerchantCreditSearch } from '../model/merchantCreditSearch';
|
|
27
|
+
import { MerchantNotInitialized } from '../model/merchantNotInitialized';
|
|
28
|
+
import { PaginatedWTMerchantCredits } from '../model/paginatedWTMerchantCredits';
|
|
29
|
+
import { PaginationRequestWithSortOptions } from '../model/paginationRequestWithSortOptions';
|
|
30
|
+
import { PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded } from '../model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded';
|
|
31
|
+
import { PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber } from '../model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber';
|
|
32
|
+
import { UNKNOWN_BASE_TYPE } from '../model/uNKNOWNBASETYPE';
|
|
33
|
+
import { WTMerchantCredit } from '../model/wTMerchantCredit';
|
|
34
|
+
import { WTMerchantCreditCreationParams } from '../model/wTMerchantCreditCreationParams';
|
|
35
|
+
|
|
36
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
37
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
38
|
+
|
|
39
|
+
import { HttpError, RequestFile } from './apis';
|
|
40
|
+
|
|
41
|
+
let defaultBasePath = 'https://api.wall.et';
|
|
42
|
+
|
|
43
|
+
// ===============================================
|
|
44
|
+
// This file is autogenerated - Please do not edit
|
|
45
|
+
// ===============================================
|
|
46
|
+
|
|
47
|
+
export enum MerchantCreditsApiApiKeys {
|
|
48
|
+
api_key,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class MerchantCreditsApi {
|
|
52
|
+
protected _basePath = defaultBasePath;
|
|
53
|
+
protected _defaultHeaders : any = {};
|
|
54
|
+
protected _useQuerystring : boolean = false;
|
|
55
|
+
|
|
56
|
+
protected authentications = {
|
|
57
|
+
'default': <Authentication>new VoidAuth(),
|
|
58
|
+
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
protected interceptors: Interceptor[] = [];
|
|
62
|
+
|
|
63
|
+
constructor(basePath?: string);
|
|
64
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
65
|
+
if (password) {
|
|
66
|
+
if (basePath) {
|
|
67
|
+
this.basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
if (basePathOrUsername) {
|
|
71
|
+
this.basePath = basePathOrUsername
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
set useQuerystring(value: boolean) {
|
|
77
|
+
this._useQuerystring = value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
set basePath(basePath: string) {
|
|
81
|
+
this._basePath = basePath;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
85
|
+
this._defaultHeaders = defaultHeaders;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get defaultHeaders() {
|
|
89
|
+
return this._defaultHeaders;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get basePath() {
|
|
93
|
+
return this._basePath;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
97
|
+
this.authentications.default = auth;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public setApiKey(key: MerchantCreditsApiApiKeys, value: string) {
|
|
101
|
+
(this.authentications as any)[MerchantCreditsApiApiKeys[key]].apiKey = value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
105
|
+
this.interceptors.push(interceptor);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @summary Archive merchant credit
|
|
111
|
+
* @param id
|
|
112
|
+
*/
|
|
113
|
+
public async archiveMerchantCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
114
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
115
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
116
|
+
let localVarQueryParameters: any = {};
|
|
117
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
118
|
+
const produces = ['application/json'];
|
|
119
|
+
// give precedence to 'application/json'
|
|
120
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
121
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
122
|
+
} else {
|
|
123
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
124
|
+
}
|
|
125
|
+
let localVarFormParams: any = {};
|
|
126
|
+
|
|
127
|
+
// verify required parameter 'id' is not null or undefined
|
|
128
|
+
if (id === null || id === undefined) {
|
|
129
|
+
throw new Error('Required parameter id was null or undefined when calling archiveMerchantCredit.');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
133
|
+
|
|
134
|
+
let localVarUseFormData = false;
|
|
135
|
+
|
|
136
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
137
|
+
method: 'DELETE',
|
|
138
|
+
qs: localVarQueryParameters,
|
|
139
|
+
headers: localVarHeaderParams,
|
|
140
|
+
uri: localVarPath,
|
|
141
|
+
useQuerystring: this._useQuerystring,
|
|
142
|
+
json: true,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
let authenticationPromise = Promise.resolve();
|
|
146
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
147
|
+
|
|
148
|
+
let interceptorPromise = authenticationPromise;
|
|
149
|
+
for (const interceptor of this.interceptors) {
|
|
150
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return interceptorPromise.then(() => {
|
|
154
|
+
if (Object.keys(localVarFormParams).length) {
|
|
155
|
+
if (localVarUseFormData) {
|
|
156
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
157
|
+
} else {
|
|
158
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
162
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
163
|
+
if (error) {
|
|
164
|
+
reject(error);
|
|
165
|
+
} else {
|
|
166
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
167
|
+
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
168
|
+
resolve({ response: response, body: body });
|
|
169
|
+
} else {
|
|
170
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @summary Create merchant credit
|
|
180
|
+
* @param wTMerchantCreditCreationParams
|
|
181
|
+
*/
|
|
182
|
+
public async createMerchantCredit (wTMerchantCreditCreationParams: WTMerchantCreditCreationParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
183
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit';
|
|
184
|
+
let localVarQueryParameters: any = {};
|
|
185
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
186
|
+
const produces = ['application/json'];
|
|
187
|
+
// give precedence to 'application/json'
|
|
188
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
189
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
190
|
+
} else {
|
|
191
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
192
|
+
}
|
|
193
|
+
let localVarFormParams: any = {};
|
|
194
|
+
|
|
195
|
+
// verify required parameter 'wTMerchantCreditCreationParams' is not null or undefined
|
|
196
|
+
if (wTMerchantCreditCreationParams === null || wTMerchantCreditCreationParams === undefined) {
|
|
197
|
+
throw new Error('Required parameter wTMerchantCreditCreationParams was null or undefined when calling createMerchantCredit.');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
201
|
+
|
|
202
|
+
let localVarUseFormData = false;
|
|
203
|
+
|
|
204
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
205
|
+
method: 'POST',
|
|
206
|
+
qs: localVarQueryParameters,
|
|
207
|
+
headers: localVarHeaderParams,
|
|
208
|
+
uri: localVarPath,
|
|
209
|
+
useQuerystring: this._useQuerystring,
|
|
210
|
+
json: true,
|
|
211
|
+
body: ObjectSerializer.serialize(wTMerchantCreditCreationParams, "WTMerchantCreditCreationParams")
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
let authenticationPromise = Promise.resolve();
|
|
215
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
216
|
+
|
|
217
|
+
let interceptorPromise = authenticationPromise;
|
|
218
|
+
for (const interceptor of this.interceptors) {
|
|
219
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return interceptorPromise.then(() => {
|
|
223
|
+
if (Object.keys(localVarFormParams).length) {
|
|
224
|
+
if (localVarUseFormData) {
|
|
225
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
226
|
+
} else {
|
|
227
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
231
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
232
|
+
if (error) {
|
|
233
|
+
reject(error);
|
|
234
|
+
} else {
|
|
235
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
236
|
+
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
237
|
+
resolve({ response: response, body: body });
|
|
238
|
+
} else {
|
|
239
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
*
|
|
248
|
+
* @summary Fetch merchant credit
|
|
249
|
+
* @param id
|
|
250
|
+
*/
|
|
251
|
+
public async fetchMerchantCreditById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
252
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
253
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
254
|
+
let localVarQueryParameters: any = {};
|
|
255
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
256
|
+
const produces = ['application/json'];
|
|
257
|
+
// give precedence to 'application/json'
|
|
258
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
259
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
260
|
+
} else {
|
|
261
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
262
|
+
}
|
|
263
|
+
let localVarFormParams: any = {};
|
|
264
|
+
|
|
265
|
+
// verify required parameter 'id' is not null or undefined
|
|
266
|
+
if (id === null || id === undefined) {
|
|
267
|
+
throw new Error('Required parameter id was null or undefined when calling fetchMerchantCreditById.');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
271
|
+
|
|
272
|
+
let localVarUseFormData = false;
|
|
273
|
+
|
|
274
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
275
|
+
method: 'GET',
|
|
276
|
+
qs: localVarQueryParameters,
|
|
277
|
+
headers: localVarHeaderParams,
|
|
278
|
+
uri: localVarPath,
|
|
279
|
+
useQuerystring: this._useQuerystring,
|
|
280
|
+
json: true,
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
let authenticationPromise = Promise.resolve();
|
|
284
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
285
|
+
|
|
286
|
+
let interceptorPromise = authenticationPromise;
|
|
287
|
+
for (const interceptor of this.interceptors) {
|
|
288
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return interceptorPromise.then(() => {
|
|
292
|
+
if (Object.keys(localVarFormParams).length) {
|
|
293
|
+
if (localVarUseFormData) {
|
|
294
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
295
|
+
} else {
|
|
296
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
300
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
301
|
+
if (error) {
|
|
302
|
+
reject(error);
|
|
303
|
+
} else {
|
|
304
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
305
|
+
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
306
|
+
resolve({ response: response, body: body });
|
|
307
|
+
} else {
|
|
308
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* @summary Fetch all active merchant credits
|
|
318
|
+
*/
|
|
319
|
+
public async fetchMerchantCreditCount (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
320
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/count';
|
|
321
|
+
let localVarQueryParameters: any = {};
|
|
322
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
323
|
+
const produces = ['application/json'];
|
|
324
|
+
// give precedence to 'application/json'
|
|
325
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
326
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
327
|
+
} else {
|
|
328
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
329
|
+
}
|
|
330
|
+
let localVarFormParams: any = {};
|
|
331
|
+
|
|
332
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
333
|
+
|
|
334
|
+
let localVarUseFormData = false;
|
|
335
|
+
|
|
336
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
337
|
+
method: 'GET',
|
|
338
|
+
qs: localVarQueryParameters,
|
|
339
|
+
headers: localVarHeaderParams,
|
|
340
|
+
uri: localVarPath,
|
|
341
|
+
useQuerystring: this._useQuerystring,
|
|
342
|
+
json: true,
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
let authenticationPromise = Promise.resolve();
|
|
346
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
347
|
+
|
|
348
|
+
let interceptorPromise = authenticationPromise;
|
|
349
|
+
for (const interceptor of this.interceptors) {
|
|
350
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return interceptorPromise.then(() => {
|
|
354
|
+
if (Object.keys(localVarFormParams).length) {
|
|
355
|
+
if (localVarUseFormData) {
|
|
356
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
357
|
+
} else {
|
|
358
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
362
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
363
|
+
if (error) {
|
|
364
|
+
reject(error);
|
|
365
|
+
} else {
|
|
366
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
367
|
+
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
368
|
+
resolve({ response: response, body: body });
|
|
369
|
+
} else {
|
|
370
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
*
|
|
379
|
+
* @summary Fetch history
|
|
380
|
+
* @param uNKNOWNBASETYPE
|
|
381
|
+
*/
|
|
382
|
+
public async fetchMerchantCreditHistoryLog (uNKNOWNBASETYPE: UNKNOWN_BASE_TYPE, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MSMerchantCreditHistoryPagination; }> {
|
|
383
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/history/log';
|
|
384
|
+
let localVarQueryParameters: any = {};
|
|
385
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
386
|
+
const produces = ['application/json'];
|
|
387
|
+
// give precedence to 'application/json'
|
|
388
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
389
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
390
|
+
} else {
|
|
391
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
392
|
+
}
|
|
393
|
+
let localVarFormParams: any = {};
|
|
394
|
+
|
|
395
|
+
// verify required parameter 'uNKNOWNBASETYPE' is not null or undefined
|
|
396
|
+
if (uNKNOWNBASETYPE === null || uNKNOWNBASETYPE === undefined) {
|
|
397
|
+
throw new Error('Required parameter uNKNOWNBASETYPE was null or undefined when calling fetchMerchantCreditHistoryLog.');
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
401
|
+
|
|
402
|
+
let localVarUseFormData = false;
|
|
403
|
+
|
|
404
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
405
|
+
method: 'POST',
|
|
406
|
+
qs: localVarQueryParameters,
|
|
407
|
+
headers: localVarHeaderParams,
|
|
408
|
+
uri: localVarPath,
|
|
409
|
+
useQuerystring: this._useQuerystring,
|
|
410
|
+
json: true,
|
|
411
|
+
body: ObjectSerializer.serialize(uNKNOWNBASETYPE, "UNKNOWN_BASE_TYPE")
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
let authenticationPromise = Promise.resolve();
|
|
415
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
416
|
+
|
|
417
|
+
let interceptorPromise = authenticationPromise;
|
|
418
|
+
for (const interceptor of this.interceptors) {
|
|
419
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return interceptorPromise.then(() => {
|
|
423
|
+
if (Object.keys(localVarFormParams).length) {
|
|
424
|
+
if (localVarUseFormData) {
|
|
425
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
426
|
+
} else {
|
|
427
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return new Promise<{ response: http.IncomingMessage; body: MSMerchantCreditHistoryPagination; }>((resolve, reject) => {
|
|
431
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
432
|
+
if (error) {
|
|
433
|
+
reject(error);
|
|
434
|
+
} else {
|
|
435
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
436
|
+
body = ObjectSerializer.deserialize(body, "MSMerchantCreditHistoryPagination");
|
|
437
|
+
resolve({ response: response, body: body });
|
|
438
|
+
} else {
|
|
439
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
*
|
|
448
|
+
* @summary Fetch redemption log
|
|
449
|
+
* @param uNKNOWNBASETYPE
|
|
450
|
+
*/
|
|
451
|
+
public async fetchMerchantCreditRedemptionLog (uNKNOWNBASETYPE: UNKNOWN_BASE_TYPE, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MSMerchantCreditRedemptionPagination; }> {
|
|
452
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/redemption/log';
|
|
453
|
+
let localVarQueryParameters: any = {};
|
|
454
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
455
|
+
const produces = ['application/json'];
|
|
456
|
+
// give precedence to 'application/json'
|
|
457
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
458
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
459
|
+
} else {
|
|
460
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
461
|
+
}
|
|
462
|
+
let localVarFormParams: any = {};
|
|
463
|
+
|
|
464
|
+
// verify required parameter 'uNKNOWNBASETYPE' is not null or undefined
|
|
465
|
+
if (uNKNOWNBASETYPE === null || uNKNOWNBASETYPE === undefined) {
|
|
466
|
+
throw new Error('Required parameter uNKNOWNBASETYPE was null or undefined when calling fetchMerchantCreditRedemptionLog.');
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
470
|
+
|
|
471
|
+
let localVarUseFormData = false;
|
|
472
|
+
|
|
473
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
474
|
+
method: 'POST',
|
|
475
|
+
qs: localVarQueryParameters,
|
|
476
|
+
headers: localVarHeaderParams,
|
|
477
|
+
uri: localVarPath,
|
|
478
|
+
useQuerystring: this._useQuerystring,
|
|
479
|
+
json: true,
|
|
480
|
+
body: ObjectSerializer.serialize(uNKNOWNBASETYPE, "UNKNOWN_BASE_TYPE")
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
let authenticationPromise = Promise.resolve();
|
|
484
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
485
|
+
|
|
486
|
+
let interceptorPromise = authenticationPromise;
|
|
487
|
+
for (const interceptor of this.interceptors) {
|
|
488
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return interceptorPromise.then(() => {
|
|
492
|
+
if (Object.keys(localVarFormParams).length) {
|
|
493
|
+
if (localVarUseFormData) {
|
|
494
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
495
|
+
} else {
|
|
496
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return new Promise<{ response: http.IncomingMessage; body: MSMerchantCreditRedemptionPagination; }>((resolve, reject) => {
|
|
500
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
501
|
+
if (error) {
|
|
502
|
+
reject(error);
|
|
503
|
+
} else {
|
|
504
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
505
|
+
body = ObjectSerializer.deserialize(body, "MSMerchantCreditRedemptionPagination");
|
|
506
|
+
resolve({ response: response, body: body });
|
|
507
|
+
} else {
|
|
508
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
*
|
|
517
|
+
* @summary Fetch merchant credits by page
|
|
518
|
+
* @param paginationRequestWithSortOptions
|
|
519
|
+
*/
|
|
520
|
+
public async fetchMerchantCreditsByPage (paginationRequestWithSortOptions: PaginationRequestWithSortOptions, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTMerchantCredit>; }> {
|
|
521
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/page';
|
|
522
|
+
let localVarQueryParameters: any = {};
|
|
523
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
524
|
+
const produces = ['application/json'];
|
|
525
|
+
// give precedence to 'application/json'
|
|
526
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
527
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
528
|
+
} else {
|
|
529
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
530
|
+
}
|
|
531
|
+
let localVarFormParams: any = {};
|
|
532
|
+
|
|
533
|
+
// verify required parameter 'paginationRequestWithSortOptions' is not null or undefined
|
|
534
|
+
if (paginationRequestWithSortOptions === null || paginationRequestWithSortOptions === undefined) {
|
|
535
|
+
throw new Error('Required parameter paginationRequestWithSortOptions was null or undefined when calling fetchMerchantCreditsByPage.');
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
539
|
+
|
|
540
|
+
let localVarUseFormData = false;
|
|
541
|
+
|
|
542
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
543
|
+
method: 'POST',
|
|
544
|
+
qs: localVarQueryParameters,
|
|
545
|
+
headers: localVarHeaderParams,
|
|
546
|
+
uri: localVarPath,
|
|
547
|
+
useQuerystring: this._useQuerystring,
|
|
548
|
+
json: true,
|
|
549
|
+
body: ObjectSerializer.serialize(paginationRequestWithSortOptions, "PaginationRequestWithSortOptions")
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
let authenticationPromise = Promise.resolve();
|
|
553
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
554
|
+
|
|
555
|
+
let interceptorPromise = authenticationPromise;
|
|
556
|
+
for (const interceptor of this.interceptors) {
|
|
557
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return interceptorPromise.then(() => {
|
|
561
|
+
if (Object.keys(localVarFormParams).length) {
|
|
562
|
+
if (localVarUseFormData) {
|
|
563
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
564
|
+
} else {
|
|
565
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTMerchantCredit>; }>((resolve, reject) => {
|
|
569
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
570
|
+
if (error) {
|
|
571
|
+
reject(error);
|
|
572
|
+
} else {
|
|
573
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
574
|
+
body = ObjectSerializer.deserialize(body, "Array<WTMerchantCredit>");
|
|
575
|
+
resolve({ response: response, body: body });
|
|
576
|
+
} else {
|
|
577
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
*
|
|
586
|
+
* @summary Restore merchant credit
|
|
587
|
+
* @param id
|
|
588
|
+
*/
|
|
589
|
+
public async restoreMerchantCredit (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
590
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
591
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
592
|
+
let localVarQueryParameters: any = {};
|
|
593
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
594
|
+
const produces = ['application/json'];
|
|
595
|
+
// give precedence to 'application/json'
|
|
596
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
597
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
598
|
+
} else {
|
|
599
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
600
|
+
}
|
|
601
|
+
let localVarFormParams: any = {};
|
|
602
|
+
|
|
603
|
+
// verify required parameter 'id' is not null or undefined
|
|
604
|
+
if (id === null || id === undefined) {
|
|
605
|
+
throw new Error('Required parameter id was null or undefined when calling restoreMerchantCredit.');
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
609
|
+
|
|
610
|
+
let localVarUseFormData = false;
|
|
611
|
+
|
|
612
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
613
|
+
method: 'PATCH',
|
|
614
|
+
qs: localVarQueryParameters,
|
|
615
|
+
headers: localVarHeaderParams,
|
|
616
|
+
uri: localVarPath,
|
|
617
|
+
useQuerystring: this._useQuerystring,
|
|
618
|
+
json: true,
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
let authenticationPromise = Promise.resolve();
|
|
622
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
623
|
+
|
|
624
|
+
let interceptorPromise = authenticationPromise;
|
|
625
|
+
for (const interceptor of this.interceptors) {
|
|
626
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return interceptorPromise.then(() => {
|
|
630
|
+
if (Object.keys(localVarFormParams).length) {
|
|
631
|
+
if (localVarUseFormData) {
|
|
632
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
633
|
+
} else {
|
|
634
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
638
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
639
|
+
if (error) {
|
|
640
|
+
reject(error);
|
|
641
|
+
} else {
|
|
642
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
643
|
+
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
644
|
+
resolve({ response: response, body: body });
|
|
645
|
+
} else {
|
|
646
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
*
|
|
655
|
+
* @summary Search for merchant credits
|
|
656
|
+
* @param merchantCreditSearch
|
|
657
|
+
*/
|
|
658
|
+
public async searchMerchantCredits (merchantCreditSearch: MerchantCreditSearch, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PaginatedWTMerchantCredits; }> {
|
|
659
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/search';
|
|
660
|
+
let localVarQueryParameters: any = {};
|
|
661
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
662
|
+
const produces = ['application/json'];
|
|
663
|
+
// give precedence to 'application/json'
|
|
664
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
665
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
666
|
+
} else {
|
|
667
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
668
|
+
}
|
|
669
|
+
let localVarFormParams: any = {};
|
|
670
|
+
|
|
671
|
+
// verify required parameter 'merchantCreditSearch' is not null or undefined
|
|
672
|
+
if (merchantCreditSearch === null || merchantCreditSearch === undefined) {
|
|
673
|
+
throw new Error('Required parameter merchantCreditSearch was null or undefined when calling searchMerchantCredits.');
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
677
|
+
|
|
678
|
+
let localVarUseFormData = false;
|
|
679
|
+
|
|
680
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
681
|
+
method: 'POST',
|
|
682
|
+
qs: localVarQueryParameters,
|
|
683
|
+
headers: localVarHeaderParams,
|
|
684
|
+
uri: localVarPath,
|
|
685
|
+
useQuerystring: this._useQuerystring,
|
|
686
|
+
json: true,
|
|
687
|
+
body: ObjectSerializer.serialize(merchantCreditSearch, "MerchantCreditSearch")
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
let authenticationPromise = Promise.resolve();
|
|
691
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
692
|
+
|
|
693
|
+
let interceptorPromise = authenticationPromise;
|
|
694
|
+
for (const interceptor of this.interceptors) {
|
|
695
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return interceptorPromise.then(() => {
|
|
699
|
+
if (Object.keys(localVarFormParams).length) {
|
|
700
|
+
if (localVarUseFormData) {
|
|
701
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
702
|
+
} else {
|
|
703
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
return new Promise<{ response: http.IncomingMessage; body: PaginatedWTMerchantCredits; }>((resolve, reject) => {
|
|
707
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
708
|
+
if (error) {
|
|
709
|
+
reject(error);
|
|
710
|
+
} else {
|
|
711
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
712
|
+
body = ObjectSerializer.deserialize(body, "PaginatedWTMerchantCredits");
|
|
713
|
+
resolve({ response: response, body: body });
|
|
714
|
+
} else {
|
|
715
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* @summary Update merchant credit
|
|
725
|
+
* @param id
|
|
726
|
+
* @param pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber
|
|
727
|
+
*/
|
|
728
|
+
public async updateMerchantCredit (id: any, pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber: PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }> {
|
|
729
|
+
const localVarPath = this.basePath + '/v1/payment/merchantcredit/{id}'
|
|
730
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
731
|
+
let localVarQueryParameters: any = {};
|
|
732
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
733
|
+
const produces = ['application/json'];
|
|
734
|
+
// give precedence to 'application/json'
|
|
735
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
736
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
737
|
+
} else {
|
|
738
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
739
|
+
}
|
|
740
|
+
let localVarFormParams: any = {};
|
|
741
|
+
|
|
742
|
+
// verify required parameter 'id' is not null or undefined
|
|
743
|
+
if (id === null || id === undefined) {
|
|
744
|
+
throw new Error('Required parameter id was null or undefined when calling updateMerchantCredit.');
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// verify required parameter 'pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber' is not null or undefined
|
|
748
|
+
if (pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber === null || pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber === undefined) {
|
|
749
|
+
throw new Error('Required parameter pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber was null or undefined when calling updateMerchantCredit.');
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
753
|
+
|
|
754
|
+
let localVarUseFormData = false;
|
|
755
|
+
|
|
756
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
757
|
+
method: 'PUT',
|
|
758
|
+
qs: localVarQueryParameters,
|
|
759
|
+
headers: localVarHeaderParams,
|
|
760
|
+
uri: localVarPath,
|
|
761
|
+
useQuerystring: this._useQuerystring,
|
|
762
|
+
json: true,
|
|
763
|
+
body: ObjectSerializer.serialize(pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber, "PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber")
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
let authenticationPromise = Promise.resolve();
|
|
767
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
768
|
+
|
|
769
|
+
let interceptorPromise = authenticationPromise;
|
|
770
|
+
for (const interceptor of this.interceptors) {
|
|
771
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
return interceptorPromise.then(() => {
|
|
775
|
+
if (Object.keys(localVarFormParams).length) {
|
|
776
|
+
if (localVarUseFormData) {
|
|
777
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
778
|
+
} else {
|
|
779
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return new Promise<{ response: http.IncomingMessage; body: WTMerchantCredit; }>((resolve, reject) => {
|
|
783
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
784
|
+
if (error) {
|
|
785
|
+
reject(error);
|
|
786
|
+
} else {
|
|
787
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
788
|
+
body = ObjectSerializer.deserialize(body, "WTMerchantCredit");
|
|
789
|
+
resolve({ response: response, body: body });
|
|
790
|
+
} else {
|
|
791
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
}
|