@depay/widgets 8.0.6 → 8.1.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
@@ -22,6 +22,10 @@ and load the DePayWidgets package wherever you need it:
22
22
  import DePayWidgets from '@depay/widgets'
23
23
  ```
24
24
 
25
+ Make sure you load this library as a client-side script for client-side rendering (CSR), in case you are using a server-side rendering (SSR) framework like next.js.
26
+
27
+ Next.js: https://dev.to/elisabethleonhardt/how-to-use-client-side-only-packages-with-ssr-in-gatsby-and-nextjs-3pfa
28
+
25
29
  ## Demo
26
30
 
27
31
  To easily configure DePay Payment Widgets please use our configurator here:
@@ -366,6 +370,28 @@ Make sure you read the [Payment Tracking API](https://depay.com/documentation/ap
366
370
 
367
371
  Payment tracking requests will be attempted indefinitely. After 2 minutes a warning dialog will be presented to users asking them to ensure an internet connection so that the payment tracking can be performed.
368
372
 
373
+ ##### Asynchronous Validation
374
+
375
+ For user flows where you can release the user immediatelly, we recommend performing payment validation asynchronously as in certain situation in can take up to multiple minutes to validate a payment:
376
+
377
+ You can configure the widget to track/validate the payment asynchronously:
378
+
379
+ ```javascript
380
+ DePayWidgets.Payment({
381
+
382
+ track: {
383
+ endpoint: '/track',
384
+ async: true
385
+ }
386
+ })
387
+ ```
388
+
389
+ Which will release the user right after the payment transaction has been confirmed on the user's machine.
390
+
391
+ It still tracks and validates the payment asynchronously (in the background) and calls back your endpoints as soon as it has been validated.
392
+
393
+ This allows you to release the user immediately, showing him some confirmation and reconfirming his payment in an asynchronous step (like a notification or email).
394
+
369
395
  ##### Polling
370
396
 
371
397
  In order to ensure a 100% coverage that users are released and forwarded within your payment flow, you will need to implement polling in addition to tracking.