@motopays/pay-form 1.0.16-rc.0 → 1.0.16-rc.2

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
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## 1.0.16
4
4
 
5
+ ### Added
6
+ - userPreferences field added to settings model. This field allows to configure non-required checkboxes that have to be selected by users. Check README.md to see more details
7
+
5
8
  ### Changed
6
9
  - 'hidden-enabled' and 'disabled' states for settings.requiredFieldsBehavior.buttonStateUntilCorrect enables buttons when user has filled required fields (without validation). On click the validation occures
7
10
 
package/README.md CHANGED
@@ -147,13 +147,17 @@ declare module "@motopays/pay-form/pay";
147
147
  | chargeTerms | IChargeTermsSettings | The charge terms section |
148
148
  | chargeTerms.visible | boolean | Whether to show the charge terms |
149
149
  | chargeTerms.checkboxes | ITermCheckbox[] | The checkboxes that, without being selected, the user will not be able to make a payment. All these checkboxes have to be selected by user to be able to make a payment |
150
- | chargeTerms.text | string | The text of charge terms. For example, description of subscription plan |
150
+ | chargeTerms.text | string | The text of charge terms. For example, description of terms and policy |
151
151
  | chargeTerms.location | string or ChargeTermsLocation | The location of ChargeTerms element. Currently accepted: { BeforePay, AfterPay } |
152
152
  | availableCardBrands | string[] or CreditCardTypeCardBrandId[] | The сard brands for which icons will be displayed on the form as card payment methods. Currently accepted: {american-express, discover, jcb, maestro, mastercard, unionpay, visa} |
153
153
  | requiredFieldsBehavior | IRequiredFieldsBehavior | Configuration of the display of required fields for the user to manage the user's focus on them |
154
154
  | requiredFieldsBehavior<br>.showStars | boolean | Show the stars on labels of required fields |
155
155
  | requiredFieldsBehavior<br>.buttonStateUntilCorrect | string | If 'disabled', the payment buttons remain disabled until the user fills in all the required fields. If 'enabled', then when one of the buttons is pressed (the buttons are enabled), the required fields will be marked as invalid (red color) for the user. If 'hidden-enabled', then when one of the buttons is pressed (the buttons are enabled but have styles as disabled), the required fields will be marked as invalid (red color) for the user. Current accepted: { enabled, disabled, hidden-enabled } |
156
156
  | requiredFieldsBehavior<br>.markAsInvalidUntilCorrect | boolean | If true, then all unfilled or incorrectly filled required fields will initially appear as invalid (red color) to the user until they are filled and correct. If the value is false, the required fields will only be shown as invalid in the event that the user presses the payment button when the buttons are enabled |
157
+ | userPreferences | IUserPreferencesSettings | The user preferences section |
158
+ | userPreferences.visible | boolean | Whether to show the user preferences |
159
+ | userPreferences.text | string | The text of user preferences. For example, description of autorefill plan |
160
+ | userPreferences.checkboxes | IUserPreferenceCheckbox[] | The text of user preferences. For example, description of autorefill plan |
157
161
 
158
162
 
159
163
  ILink interface:
@@ -172,6 +176,16 @@ interface ITermCheckbox {
172
176
  }
173
177
  ```
174
178
 
179
+ IUserPreferenceCheckbox interface:
180
+ ```
181
+ interface IUserPreferenceCheckbox {
182
+ name: string;
183
+ text: string;
184
+ link?: ILink;
185
+ defaultValue?: boolean;
186
+ }
187
+ ```
188
+
175
189
  Example of merchantInfo:
176
190
  ```
177
191
  merchantInfo: {
@@ -214,6 +228,33 @@ chargeTerms: {
214
228
  },
215
229
  ```
216
230
 
231
+ Example of userPreferences:
232
+ ```
233
+ "userPreferences": {
234
+ "visible": true,
235
+ "text": "By checking this box, I am affirming my full and complete understanding of, as well as my agreement to, all the terms and conditions that were previously presented to me, acknowledging that they form a binding contractual agreement.",
236
+ "checkboxes": [
237
+ {
238
+ "name": "autoFill",
239
+ "text": "Do you want to auto refill? Check this.",
240
+ "link": {
241
+ "text": "Refill policy",
242
+ "href": "https://www.google.com/"
243
+ }
244
+ },
245
+ {
246
+ "name": "isGood",
247
+ "defaultValue": true,
248
+ "text": "Do you want to mark this as good? Check this.",
249
+ "link": {
250
+ "text": "Link to the application",
251
+ "href": "https://www.google.com/"
252
+ }
253
+ }
254
+ ]
255
+ }
256
+ ```
257
+
217
258
  ### Output events
218
259
 
219
260
  | Event | Type | Description |