@motopays/pay-form 1.0.21 → 1.0.22-rc.1

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/index.d.ts ADDED
@@ -0,0 +1,250 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { CreditCardTypeCardBrandId } from 'credit-card-type/dist/types';
4
+
5
+ export type TAmountType = "gross-without-gst" | "net" | "gross";
6
+ export type TOrderType = "regular" | "free-trial" | "gems";
7
+ export type TPaymentInitiator = "customer" | "merchant";
8
+ export type TButtonStateUntilFilled = "enabled" | "disabled" | "hidden-enabled";
9
+ export type TLanguageCode = "en-US" | "es-ES" | "fr-FR" | string;
10
+ export interface ITextContainer {
11
+ text: Partial<Record<TLanguageCode, string>>;
12
+ }
13
+ export interface IUserPreferenceCheckbox extends ITextContainer {
14
+ name: string;
15
+ defaultValue?: boolean;
16
+ }
17
+ export interface IUserPreferencesSettings extends ITextContainer {
18
+ checkboxes?: IUserPreferenceCheckbox[];
19
+ }
20
+ export interface IChargeTermsSettings extends ITextContainer {
21
+ checkboxes?: Partial<Record<TLanguageCode, string>>[];
22
+ }
23
+ export interface ILink extends ITextContainer {
24
+ href: string;
25
+ }
26
+ export interface IMerchantInfoSettings extends ITextContainer {
27
+ links?: ILink[];
28
+ }
29
+ export interface IServicesUrls {
30
+ processing: string;
31
+ billingProfiles: string;
32
+ }
33
+ export interface IRequiredFieldsBehavior {
34
+ showStars?: boolean;
35
+ markAsInvalidUntilCorrect?: boolean;
36
+ buttonStateUntilFilled?: TButtonStateUntilFilled;
37
+ }
38
+ export type TComponentType = "available-card-brands" | "card-list" | "requisites" | "phone-number" | "charge-terms" | "pay-button" | "apm-list" | "user-preferences" | "merchant-info" | "protected-by" | "no-methods";
39
+ export type TSecurityCodeLabel = "CVV" | "CVC" | "CID" | "CVN" | "CVE" | "CVP2";
40
+ export interface ISecurityCodeLabels extends Record<TSecurityCodeLabel, string> {
41
+ }
42
+ export interface ILanguage {
43
+ header: string;
44
+ errors: {
45
+ notCheckedCheckboxes: string;
46
+ invalidCardHolder: string;
47
+ invalidCardNumber: string;
48
+ invalidCardExpiration: string;
49
+ invalidCvv: string;
50
+ invalidPhoneNumber: string;
51
+ };
52
+ requisites: {
53
+ paymentDetailsHeader: string;
54
+ cardNumberPlaceholder: string;
55
+ cardExpirationPlaceholder: string;
56
+ cvvPlaceholder?: ISecurityCodeLabels;
57
+ cvvHint: string;
58
+ cardHolderHeader: string;
59
+ cardHolderPlaceholder: string;
60
+ };
61
+ phone: {
62
+ header: string;
63
+ placeholder: string;
64
+ };
65
+ apms: {
66
+ orUseAlternative: string;
67
+ or: string;
68
+ };
69
+ totalHeader: string;
70
+ pay: string;
71
+ availableCardBrandsHeader: string;
72
+ transactionProtectedBy: string;
73
+ existingCards: {
74
+ manageCardsHeader: string;
75
+ addNewCard: string;
76
+ removeCard: string;
77
+ };
78
+ paymentResult: {
79
+ success: string;
80
+ failure: {
81
+ main: string;
82
+ paymentFailed: string;
83
+ };
84
+ };
85
+ noAvailablePaymentMethods: string;
86
+ paymentProcessing: string;
87
+ notifications: {
88
+ cardDeleted: {
89
+ title: string;
90
+ text: string;
91
+ };
92
+ error: {
93
+ default: {
94
+ title: string;
95
+ text: string;
96
+ };
97
+ };
98
+ };
99
+ close: string;
100
+ }
101
+ export interface ILanguageSettings {
102
+ code: TLanguageCode;
103
+ languages?: Partial<Record<TLanguageCode, ILanguage>>;
104
+ }
105
+ export interface IResultComponentsStructure {
106
+ aboveResult: TComponentType[];
107
+ belowResult: TComponentType[];
108
+ }
109
+ export interface IEvents {
110
+ analytics: {
111
+ optional: boolean;
112
+ required: boolean;
113
+ };
114
+ error: boolean;
115
+ }
116
+ export interface ISettings {
117
+ isCloseButtonVisible?: boolean;
118
+ isProblemTipsListVisible?: boolean;
119
+ isSignatureRequired?: boolean;
120
+ isHeaderVisible?: boolean;
121
+ closePaymentRedirect?: boolean;
122
+ languageSettings?: ILanguageSettings;
123
+ urls: IServicesUrls;
124
+ components?: TComponentType[];
125
+ resultComponentsStructure?: IResultComponentsStructure;
126
+ merchantInfo?: IMerchantInfoSettings;
127
+ chargeTerms?: IChargeTermsSettings;
128
+ userPreferences?: IUserPreferencesSettings;
129
+ availableCardBrands?: CreditCardTypeCardBrandId[];
130
+ requiredFieldsBehavior?: IRequiredFieldsBehavior;
131
+ events?: IEvents;
132
+ apmsCollapse?: boolean;
133
+ }
134
+ export interface ISimple<Value = any> {
135
+ [key: string]: Value;
136
+ }
137
+ export interface IBillingAddress {
138
+ addressLine: string;
139
+ city: string;
140
+ state: string;
141
+ country: string;
142
+ zip: string;
143
+ }
144
+ export interface IPaymentSettings {
145
+ userAuthToken?: string;
146
+ userId: string;
147
+ paymentId: string;
148
+ amount: number;
149
+ amountType?: TAmountType;
150
+ tax?: number;
151
+ orderType?: TOrderType;
152
+ currency: string;
153
+ merchantId: string;
154
+ initiator?: TPaymentInitiator;
155
+ webhookUrl?: string;
156
+ returnUrl?: string;
157
+ description?: string;
158
+ email: string;
159
+ details?: ISimple<any>;
160
+ phoneNumber?: string;
161
+ ipAddress?: string;
162
+ signature?: string;
163
+ billingAddress?: IBillingAddress;
164
+ }
165
+ export interface IRedirectData {
166
+ location: string;
167
+ }
168
+ export interface IThreeDsData {
169
+ paReq: string;
170
+ acsurl: string;
171
+ termUrl: string;
172
+ md: string;
173
+ }
174
+ export interface IAction {
175
+ name: string;
176
+ data: IThreeDsData | IRedirectData | any;
177
+ }
178
+ export interface IOrder {
179
+ invoiceId: string;
180
+ details: string;
181
+ }
182
+ export type TPaymentState = "completed" | "rejected" | "needAction";
183
+ export interface IPaymentInfo {
184
+ completeProcessingTime?: Date;
185
+ currency: string;
186
+ paymentType: string;
187
+ paymentSystem: string;
188
+ paymentRequisites?: string;
189
+ price: number;
190
+ }
191
+ export interface IRejectionDetails {
192
+ hardDecline: boolean;
193
+ message?: string;
194
+ problemSolvingTips: string[];
195
+ rejectionCode: number;
196
+ }
197
+ export interface IPayment {
198
+ paymentId: string;
199
+ state: TPaymentState;
200
+ rebillAnchor: string;
201
+ info: IPaymentInfo;
202
+ rejectionDetails?: IRejectionDetails;
203
+ }
204
+ export interface ITaxInfo {
205
+ abbreviation: string;
206
+ price: number;
207
+ priceNet: number;
208
+ tax: number;
209
+ }
210
+ export interface IUser {
211
+ id: string;
212
+ }
213
+ export interface IPaymentResponse {
214
+ ip: string;
215
+ merchant: string;
216
+ action?: IAction;
217
+ order: IOrder;
218
+ payment: IPayment;
219
+ taxInfo: ITaxInfo;
220
+ user: IUser;
221
+ signature?: string;
222
+ }
223
+ declare class ServiceAction<Type extends string, Payload = unknown | undefined> {
224
+ type: Type;
225
+ payload?: Payload | undefined;
226
+ constructor(type: Type, payload?: Payload | undefined);
227
+ }
228
+ export interface ICardAnalytics {
229
+ last4Digits: string;
230
+ }
231
+ export interface ICardListAnalytics {
232
+ toggle: boolean;
233
+ }
234
+ export interface IChargeTermsAnalytics {
235
+ text: string;
236
+ }
237
+ export interface IUserPreferencesAnalytics {
238
+ name: string;
239
+ text: string;
240
+ }
241
+ export type TAnalyticsServiceAction = ServiceAction<"init-start"> | ServiceAction<"loading-finish"> | ServiceAction<"card-number-field-focus"> | ServiceAction<"expiration-date-field-focus"> | ServiceAction<"cvv-field-focus"> | ServiceAction<"card-holder-field-focus"> | ServiceAction<"number-field-focus"> | ServiceAction<`charge-term-checkbox${`-${number}`}-focus`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-check`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-uncheck`, IChargeTermsAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-focus`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-check`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-uncheck`, IUserPreferencesAnalytics> | ServiceAction<"pay-button-focus"> | ServiceAction<"pay-button-click"> | ServiceAction<`${string}-button-focus`> | ServiceAction<`${string}-button-click`> | ServiceAction<"add-card-button-focus"> | ServiceAction<"add-card-button-click"> | ServiceAction<"card-options-button-click", ICardAnalytics> | ServiceAction<"cards-toggle-button-click", ICardListAnalytics> | ServiceAction<"remove-card-button-click", ICardAnalytics> | ServiceAction<"select-card-button-click", ICardAnalytics> | ServiceAction<"apms-show-button-click", ICardAnalytics>;
242
+ export interface IApmsShowAnalytics {
243
+ show: boolean;
244
+ }
245
+
246
+ export {
247
+ CreditCardTypeCardBrandId,
248
+ };
249
+
250
+ export {};