@motopays/pay-form 2.2.0-rc.0 → 2.2.0-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/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # Changelog
2
+
2
3
  ## 2.2.0
4
+
3
5
  ### Added
6
+ - fingerprint and deviceInfo additional fields for payment request
4
7
  - paymentFlow field to settings model. Read more details in README.md
5
8
  - createInvoice callback to moto-payment-form component for overriding invoice generation
6
9
  - makePayment callback to moto-payment-form component for overriding payment flow
10
+ ### Changed
11
+ - requisites encryption only instead of whole payment request
12
+
7
13
 
8
14
 
9
15
 
package/README.md CHANGED
@@ -130,6 +130,8 @@ import { IPaymentSettings, ISettings } from '@motopays/pay-form/index.js';
130
130
  <moto-payment-form
131
131
  [payment]="payment"
132
132
  [settings]="settings"
133
+ [createInvoice]="createInvoice"
134
+ [makePayment]="makePayment"
133
135
  (close)="onClose()"
134
136
  (analyticsTracked)="onAnalyticsTracked($event)"
135
137
  (error)="onError($event)"
@@ -143,6 +145,18 @@ export class AppComponent {
143
145
  protected payment: IPaymentSettings = {...};
144
146
  protected settings: ISettings = {...};
145
147
 
148
+ constructor() {
149
+ this.createInvoice = this.createInvoice.bind(this);
150
+ this.makePayment = this.makePayment.bind(this);
151
+ }
152
+
153
+ protected createInvoice(request: IPaymentRequest): Promise<IPaymentRequest> {
154
+ //create invoice
155
+ }
156
+
157
+ protected makePayment(request: IPaymentRequest): Promise<IPaymentResponse> {
158
+ //make payment
159
+ }
146
160
 
147
161
  protected onClose(): void {
148
162
  console.log('close');
@@ -229,6 +243,9 @@ export class AppComponent {
229
243
  | events.analytics | { optional: boolean; required: boolean; } | The analytics events configuration. Optional is responsible for 'focus' events. Required is responsible for 'click' events. Read more about analytics events in the Analytics section |
230
244
  | events.error | boolean | The error events configuration. If true, the error events will be emitted; otherwise, they will not |
231
245
  | apmsCollapse | boolean | The apms collapse configuration. If true, the 'or use alternative methods' text will be clickable and will control whether the apms are shown or not. By default, if true, the apms will be collapsed. |
246
+ | paymentFlow | IPaymentFlowSettings | The payment flow configuration |
247
+ | paymentFlow.tokenizeCard | boolean | If true, than for not 'default' paymentFlow.type card requisites will be tokenized (only for 'invoice-overridden' and 'payment-overridden' paymentFlow.type) |
248
+ | paymentFlow.type | TPaymentFlow | If 'invoice-overridden' and createInvoice callback provided to the payment form, the createInvoice callback will be called with the invoice generated by the payment form. After receiving the invoice from the createInvoice callback, the payment process will proceed according to the default scenario. If 'payment-overridden' and makePayment callback provided to the payment form, the entire payment process will be handled through the makePayment callback with the invoice generated by the payment form |
232
249
 
233
250
  ### Example
234
251
 
@@ -431,6 +448,10 @@ const settings: ISettings = {
431
448
  defaultValue: false
432
449
  }
433
450
  ]
451
+ },
452
+ paymentFlow: {
453
+ tokenizeCard: false,
454
+ type: 'default'
434
455
  }
435
456
  };
436
457
  ```
package/index.d.ts CHANGED
@@ -170,6 +170,31 @@ export interface IPaymentSettings {
170
170
  signature?: string;
171
171
  billingAddress?: IBillingAddress;
172
172
  }
173
+ declare enum ChallengeWindowSizeType {
174
+ SMALL = 1,
175
+ MEDIUM = 2,
176
+ LARGE = 3,
177
+ EXTRA_LARGE = 4,
178
+ FULL_SCREEN = 5
179
+ }
180
+ export interface IBrowserInfo {
181
+ timezoneOffsetUtcMinutes: number;
182
+ locale: string;
183
+ userAgent: string;
184
+ javaEnabled: boolean;
185
+ javaScriptEnabled: boolean;
186
+ colorDepth: number;
187
+ height: number;
188
+ width: number;
189
+ challengeWindowSize: ChallengeWindowSizeType;
190
+ }
191
+ export interface IDeviceInfo {
192
+ id?: string;
193
+ fonts?: string[];
194
+ networkParameters?: string;
195
+ batteryLevelAndChargingStatus?: string;
196
+ browserData: IBrowserInfo;
197
+ }
173
198
  export interface IRedirectData {
174
199
  location: string;
175
200
  }
@@ -235,27 +260,6 @@ interface IBillingAddress$1 {
235
260
  country: string;
236
261
  zip: string;
237
262
  }
238
- declare enum ChallengeWindowSizeType {
239
- SMALL = 1,
240
- MEDIUM = 2,
241
- LARGE = 3,
242
- EXTRA_LARGE = 4,
243
- FULL_SCREEN = 5
244
- }
245
- export interface IBrowserInfo {
246
- timezoneOffsetUtcMinutes: number;
247
- locale: string;
248
- userAgent: string;
249
- javaEnabled: boolean;
250
- javaScriptEnabled: boolean;
251
- colorDepth: number;
252
- height: number;
253
- width: number;
254
- challengeWindowSize: ChallengeWindowSizeType;
255
- }
256
- export interface IDeviceInfo {
257
- browserData: IBrowserInfo;
258
- }
259
263
  type TAmountType$1 = "GrossWithoutGst" | "Net" | "Gross";
260
264
  type TOrderType$1 = "Regular" | "FreeTrial" | "Gems";
261
265
  interface IOrder$1 {