@bizzsv/bizz-payment 1.2.4 → 1.4.0

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/dist/index.d.ts CHANGED
@@ -11,12 +11,14 @@ export declare class BizzPaymentForm {
11
11
  private serverErrorHandler;
12
12
  private orchestrator;
13
13
  private paymentIntent;
14
+ private points;
14
15
  private countryContent;
15
16
  private processPayment;
16
17
  private stateContent;
17
18
  private amountEvaluation;
18
19
  private currentAmount;
19
20
  private currentValues;
21
+ private pointsPaymentContext;
20
22
  constructor(config: PaymentFormConfig);
21
23
  /**
22
24
  * Subscribe to host-side events.
@@ -28,17 +30,23 @@ export declare class BizzPaymentForm {
28
30
  */
29
31
  private applyFixedAmountFromOrderTemplate;
30
32
  private renderForm;
33
+ private notifyCountriesLoadError;
31
34
  private resetForm;
32
35
  private setSubmitLoading;
33
36
  private setToken;
34
37
  private sendAlert;
35
38
  private sendFailureEmitter;
39
+ private processPointsPayment;
40
+ private resetPointsPayButton;
41
+ private handlePointsBalance;
36
42
  private sendReadyEmitter;
37
43
  private sendSizingEmitter;
38
44
  private sendSuccess;
39
45
  destroy(): void;
40
46
  }
41
47
 
48
+ declare type Environment = 'production' | 'sandbox';
49
+
42
50
  declare interface FormCustomHeader {
43
51
  logo?: boolean;
44
52
  description?: boolean;
@@ -52,9 +60,11 @@ export declare interface PaymentFormConfig {
52
60
  i18n?: PaymentFormI18n;
53
61
  branchCode: string;
54
62
  paymentRequestCode?: string;
63
+ paymentOrderCode?: string;
55
64
  description?: string;
56
65
  totalAmount?: number;
57
66
  header?: boolean | FormCustomHeader;
67
+ environment?: Environment;
58
68
  }
59
69
 
60
70
  declare type PaymentFormEventMap = {
@@ -112,12 +122,28 @@ export declare type PaymentFormMessage = {
112
122
  } | {
113
123
  type: 'payment-form:success';
114
124
  paymentIntent: PaymentIntentSuccessResponse;
125
+ } | {
126
+ type: 'payment-form:points-balance';
127
+ balance: PointsBalanceView;
128
+ formValues: Record<string, string>;
129
+ } | {
130
+ type: 'payment-form:points-pay';
131
+ } | {
132
+ type: 'payment-form:points-pay-reset';
115
133
  } | {
116
134
  type: 'payment-form:states-loaded';
117
135
  states: State[];
118
136
  } | {
119
137
  type: 'payment-form:validate-amount';
120
138
  amount: string;
139
+ force?: boolean;
140
+ } | {
141
+ type: 'payment-form:update-forms';
142
+ forms: {
143
+ default: string;
144
+ points: string;
145
+ installments: string;
146
+ };
121
147
  } | {
122
148
  type: 'payment-form:sizing';
123
149
  width: number;
@@ -164,6 +190,14 @@ declare interface PaymentIntentSuccessResponse {
164
190
  };
165
191
  }
166
192
 
193
+ declare interface PointsBalanceView {
194
+ availableCents: number;
195
+ availablePoints: number;
196
+ currency: string;
197
+ purchaseCents: number;
198
+ purchasePoints: number;
199
+ }
200
+
167
201
  declare type State = {
168
202
  id: string;
169
203
  name: string;