@depay/widgets 7.2.2 → 7.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/README.md CHANGED
@@ -161,6 +161,29 @@ The address receiving the payment. Always double check that you've set the right
161
161
 
162
162
  #### amount (DePay Payments)
163
163
 
164
+ ##### fixed currency amounts
165
+
166
+ If you want the widget to fix a payment amount in a currency, use `currency` and `fix`:
167
+
168
+ `currency`:
169
+
170
+ Example (charge US$5.20):
171
+
172
+ ```
173
+ {
174
+ amount: {
175
+ currency: 'USD',
176
+ fix: 5.20
177
+ }
178
+ }
179
+ ```
180
+
181
+ Make sure to not pass any amounts to `accept` if you use fix currency amounts.
182
+
183
+ The widget will still display local currency conversions to users. If you want to change this see `currency` configuration.
184
+
185
+ ##### amount selection (changable amounts)
186
+
164
187
  When you want to control how the amount selection behaves, pass the `amount` configuration object,
165
188
  alongside values for `start`, `min` and `step`.
166
189
 
@@ -395,6 +418,24 @@ DePayWidgets.Payment({
395
418
 
396
419
  ```
397
420
 
421
+ #### before (DePay Payments)
422
+
423
+ `before`
424
+
425
+ A function that will be called before the payment is handed over to the wallet.
426
+
427
+ Allows you to stop the payment if this methods returns false.
428
+
429
+ ```javascript
430
+ DePayWidgets.Payment({
431
+
432
+ before: (payment)=> {
433
+ alert('Something went wrong')
434
+ return false // stops payment
435
+ }
436
+ })
437
+ ```
438
+
398
439
  #### sent (DePay Payments)
399
440
 
400
441
  `sent`