-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
120 lines (112 loc) · 3.06 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
type Operation =
| "CreateGiftCard"
| "CancelGiftCard"
| "ActivateGiftCard"
| "DeactivateGiftCard"
| "ActivationStatusCheck"
| "GetAvailablefunds";
type OperationStatus = "SUCCESS" | "FAILURE" | "RESEND";
type GiftCardStatus = "Fulfilled" | "RefundedToPurchaser" | "Expired";
type OperationErrorCode = "F100" | "F200" | "F300" | "F400" | "F500";
type OperationErrorType =
| "AccessDenied"
| "AccountHasProblems"
| "ActivationNotAllowed"
| "ActivationRequestIdAlreadyBeenUsed"
| "ActiveContractNotFound"
| "AmountIsNull"
| "APIGetGiftCardActivityPageIsDisabled"
| "BadInput"
| "CancelRequestArrivedAfterTimeLimit"
| "CardActivatedWithDifferentDenomination"
| "CardActivatedWithDifferentRequestId"
| "CardNumberCheckSumError"
| "CardNumberNotFound "
| "CardNumberTooShort"
| "CurrencyCodeIsNull"
| "CurrencyCodeMismatch"
| "DeactivationNotAllowed"
| "EmptyCardInfoList"
| "ExternalReferenceTooLong"
| "FractionalAmountNotAllowed"
| "GcLocked"
| "GcOrderBelongToOtherCustomer"
| "GcRTPNotAllowed"
| "GeneralError"
| "InsufficientFunds"
| "InvalidAccessKey"
| "InvalidAmountInput "
| "InvalidAmountValue "
| "InvalidCardNumberInput "
| "InvalidCurrencyCodeInput "
| "InvalidDateFormat"
| "InvalidEndDate"
| "InvalidGCIdInput"
| "InvalidPageIndex"
| "InvalidPageSize"
| "InvalidPartnerId"
| "InvalidPartnerIdInput "
| "InvalidProgramId"
| "InvalidRequest"
| "InvalidRequestIdInput "
| "InvalidRequestInput "
| "InvalidStartDate"
| "IssuanceCapExceeded"
| "MaxAmountExceeded"
| "MaxPageSizeExceeded"
| "NegativeOrZeroAmount"
| "NonExistingActivationRequestId"
| "OperationNotPermitted"
| "OrderNotFound"
| "ProgramIdNotPresent"
| "ProgramIsNotApproved"
| "RequestedDenominationMismatch"
| "RequestError"
| "RequestIdMustStartWithPartnerName"
| "RequestIdTooLong"
| "SimpleAmountIsNull"
| "StartDateAfterEndDate"
| "WrongActivationRequestId"
| "WrongGcOrderSource"
| "WrongGcOrderType";
export function createGiftCard(
request: CreateGiftCardRequest
): Promise<CreateGiftCardResponse>;
export interface OperationParameters {
partnerId: string;
accessKey: string;
secretKey: string;
environment: string;
endpoint: string;
}
export interface CreateGiftCardRequest
extends GiftCardValue,
OperationParameters {
creationRequestId?: string;
}
export interface OperationResponse {
status: OperationStatus;
}
export interface CreateGiftCardResponse extends OperationResponse {
cardInfo: GiftCardInfo;
creationRequestId: string;
gcClaimCode: string;
gcExpirationDate: string;
gcId: string;
}
export interface GiftCardInfo {
cardNumber: any;
cardStatus: GiftCardStatus;
expirationDate: any;
value: GiftCardValue;
}
export interface GiftCardValue {
amount: number;
currencyCode: string;
}
export interface OperationError {
agcodResponse: OperationResponse;
errorCode: OperationErrorCode;
errorType: OperationErrorType;
message: string;
}