@paydock/client-sdk 1.122.3-beta → 1.123.2-beta
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 +161 -5
- package/bundles/index.cjs +2472 -1735
- package/bundles/index.cjs.d.ts +314 -25
- package/bundles/index.mjs +2471 -1736
- package/bundles/index.mjs.d.ts +314 -25
- package/bundles/types/api/api-base.d.ts +1 -1
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/checkout/helpers/instruction-module.d.ts +1 -1
- package/bundles/types/checkout/helpers/instruction-module.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/index.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.fraud_service.show.d.ts +21 -0
- package/bundles/types/checkout/instructions/v1/instruction.fraud_service.show.d.ts.map +1 -0
- package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +6 -4
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.cba.d.ts +8 -7
- package/bundles/types/configs/env/environment.cba.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.interface.d.ts +6 -6
- package/bundles/types/configs/env/environment.interface.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.paydock.d.ts +8 -7
- package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -1
- package/bundles/types/fraud-prevention/fraud-prevention.constants.d.ts +9 -0
- package/bundles/types/fraud-prevention/fraud-prevention.constants.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/fraud-prevention.events.d.ts +42 -0
- package/bundles/types/fraud-prevention/fraud-prevention.events.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/fraud-prevention.service.d.ts +163 -0
- package/bundles/types/fraud-prevention/fraud-prevention.service.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/index.d.ts +3 -0
- package/bundles/types/fraud-prevention/index.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/providers/forter/forter-device-agent.service.d.ts +79 -0
- package/bundles/types/fraud-prevention/providers/forter/forter-device-agent.service.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-2025-02-06t14:19:34z.template.d.ts +2 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-2025-02-06t14:19:34z.template.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/resources/find-service-config.repository.d.ts +20 -0
- package/bundles/types/fraud-prevention/resources/find-service-config.repository.d.ts.map +1 -0
- package/bundles/types/helper/access-token.d.ts +1 -0
- package/bundles/types/helper/access-token.d.ts.map +1 -1
- package/bundles/types/helper/browser.d.ts.map +1 -1
- package/bundles/types/helper/deep-clone.d.ts +13 -0
- package/bundles/types/helper/deep-clone.d.ts.map +1 -0
- package/bundles/types/index-cba.d.ts +1 -0
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/index.d.ts +2 -1
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +1 -1
- package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -1
- package/bundles/types/shared/device/device-info.service.d.ts +13 -0
- package/bundles/types/shared/device/device-info.service.d.ts.map +1 -0
- package/bundles/types/shared/http/authorization-strategy.d.ts +41 -0
- package/bundles/types/shared/http/authorization-strategy.d.ts.map +1 -0
- package/bundles/types/shared/http/http-fetcher.d.ts +29 -0
- package/bundles/types/shared/http/http-fetcher.d.ts.map +1 -0
- package/bundles/types/shared/http/http-fetcher.factory.d.ts +17 -0
- package/bundles/types/shared/http/http-fetcher.factory.d.ts.map +1 -0
- package/bundles/types/shared/http/http-request.d.ts +1 -1
- package/bundles/types/shared/http/http-request.d.ts.map +1 -1
- package/bundles/types/shared/http/http-response.dto.d.ts +19 -0
- package/bundles/types/shared/http/http-response.dto.d.ts.map +1 -0
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts +1 -1
- package/bundles/types/shared/services/instrumentation/instrumentation.types.d.ts.map +1 -1
- package/bundles/types/shared/services/instrumentation/repositories/action.repository.d.ts.map +1 -1
- package/bundles/types/shared/services/instrumentation/repositories/error.repository.d.ts.map +1 -1
- package/bundles/types/shared/services/instrumentation/repositories/event.repository.d.ts.map +1 -1
- package/bundles/types/shared/shared.constants.d.ts +6 -0
- package/bundles/types/shared/shared.constants.d.ts.map +1 -0
- package/bundles/types/widget/configuration.d.ts +1 -1
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-widget.d.ts +14 -14
- package/bundles/types/widget/html-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +2472 -1735
- package/bundles/widget.umd.js.d.ts +314 -25
- package/bundles/widget.umd.js.min.d.ts +314 -25
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-widget.md +4 -4
- package/docs/fraud-prevention-examples.md +154 -0
- package/docs/fraud-prevention.md +0 -0
- package/docs/install/npm.example.md +1 -1
- package/package.json +17 -9
- package/slate.md +156 -1
- package/bundles/types/shared/http/index.d.ts +0 -2
- package/bundles/types/shared/http/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ const widget = new Paydock.HtmlWidget('#selector', 'publicKey', 'gatewayId');
|
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
```js
|
|
62
|
-
// default import -
|
|
62
|
+
// default import - Not officially supported . They are handled differently by different tools / settings!
|
|
63
63
|
❌
|
|
64
64
|
import paydock from '@paydock/client-sdk'
|
|
65
65
|
>>> "Uncaught SyntaxError: The requested module does not provide an export named 'default'"
|
|
@@ -939,10 +939,10 @@ The method to set meta information for the checkout page
|
|
|
939
939
|
|
|
940
940
|
```javascript
|
|
941
941
|
config.setMeta({
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
942
|
+
brand_name: 'paydock',
|
|
943
|
+
reference: '15',
|
|
944
|
+
email: 'wault@paydock.com'
|
|
945
|
+
});
|
|
946
946
|
```
|
|
947
947
|
<a name="w_HtmlMultiWidget+load" id="w_HtmlMultiWidget+load" href="#user-content-w_HtmlMultiWidget+load"> </a>
|
|
948
948
|
|
|
@@ -8442,6 +8442,162 @@ List of available event data types
|
|
|
8442
8442
|
| SUCCESS | <code>string</code> | <code>"Success"</code> | |
|
|
8443
8443
|
|
|
8444
8444
|
|
|
8445
|
+
# Fraud prevention
|
|
8446
|
+
|
|
8447
|
+
The Fraud Prevention module allows you to add security layers to your payment workflows
|
|
8448
|
+
by integrating with any of our underlying fraud prevention providers.
|
|
8449
|
+
|
|
8450
|
+
## Real time user behavior analysis
|
|
8451
|
+
|
|
8452
|
+
### Forter
|
|
8453
|
+
|
|
8454
|
+
One of Forter's key features is our ability to track the user's real-time behavior on
|
|
8455
|
+
the site and use it to separate fraudsters from legitimate buyers. To take advantage
|
|
8456
|
+
of Forter's technology, a JavaScript snippet needs to be placed on EVERY page
|
|
8457
|
+
of your commerce site beginning with the homepage and up to and including the final
|
|
8458
|
+
"Thank you for your purchase" page.
|
|
8459
|
+
|
|
8460
|
+
The integration is simple and straightforward - you only need to configure event
|
|
8461
|
+
listeners and then instantiate a FraudPreventionService with your site configuration.
|
|
8462
|
+
|
|
8463
|
+
Additional setup is required in case your website uses Content Security Policies (CSP)
|
|
8464
|
+
|
|
8465
|
+
#### Forter: Code snippet
|
|
8466
|
+
|
|
8467
|
+
```html
|
|
8468
|
+
<!doctype html>
|
|
8469
|
+
<html lang="en">
|
|
8470
|
+
|
|
8471
|
+
<head>
|
|
8472
|
+
<meta charset="utf-8">
|
|
8473
|
+
<title>Real time user behaviour anaylsis - Forter example</title>
|
|
8474
|
+
<base href="/">
|
|
8475
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8476
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
8477
|
+
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
8478
|
+
</head>
|
|
8479
|
+
|
|
8480
|
+
<body>
|
|
8481
|
+
<main>
|
|
8482
|
+
<h1>Real time user behaviour anaylsis - Forter example</h1>
|
|
8483
|
+
<div class="forter-test">
|
|
8484
|
+
<h2>Forter Integration</h2>
|
|
8485
|
+
|
|
8486
|
+
<div class="status-card">
|
|
8487
|
+
<p>
|
|
8488
|
+
<strong>Integration Status:</strong>
|
|
8489
|
+
<span data-fraud-prevention="status-indicator" class="status pending">
|
|
8490
|
+
Pending
|
|
8491
|
+
</span>
|
|
8492
|
+
</p>
|
|
8493
|
+
<p>
|
|
8494
|
+
<strong>Token Value:</strong>
|
|
8495
|
+
<code data-fraud-prevention="forter-token">Not available</code>
|
|
8496
|
+
</p>
|
|
8497
|
+
<p data-fraud-prevention="error-container" style="display: none;">
|
|
8498
|
+
<strong>Error Code:</strong>
|
|
8499
|
+
<span data-fraud-prevention="error-code" class="error"></span>
|
|
8500
|
+
</p>
|
|
8501
|
+
</div>
|
|
8502
|
+
</div>
|
|
8503
|
+
</main>
|
|
8504
|
+
<script>
|
|
8505
|
+
const { FRAUD_PREVENTION_EVENTS, FraudPreventionService } = window.paydock
|
|
8506
|
+
|
|
8507
|
+
let token = '';
|
|
8508
|
+
let errorCode = '';
|
|
8509
|
+
|
|
8510
|
+
const render = () => {
|
|
8511
|
+
const statusIndicator = document.querySelector('[data-fraud-prevention="status-indicator"]');
|
|
8512
|
+
const tokenValue = document.querySelector('[data-fraud-prevention="forter-token"]');
|
|
8513
|
+
const errorContainer = document.querySelector('[data-fraud-prevention="error-container"]');
|
|
8514
|
+
const errorCodeElement = document.querySelector('[data-fraud-prevention="error-code"]');
|
|
8515
|
+
|
|
8516
|
+
if (token) {
|
|
8517
|
+
statusIndicator.className = 'status success';
|
|
8518
|
+
statusIndicator.textContent = 'Active';
|
|
8519
|
+
tokenValue.textContent = token;
|
|
8520
|
+
} else {
|
|
8521
|
+
statusIndicator.className = 'status pending';
|
|
8522
|
+
statusIndicator.textContent = 'Pending';
|
|
8523
|
+
tokenValue.textContent = 'Not available';
|
|
8524
|
+
}
|
|
8525
|
+
|
|
8526
|
+
if (errorCode) {
|
|
8527
|
+
errorCodeElement.textContent = errorCode;
|
|
8528
|
+
errorContainer.style.display = 'block';
|
|
8529
|
+
} else {
|
|
8530
|
+
errorContainer.style.display = 'none';
|
|
8531
|
+
}
|
|
8532
|
+
};
|
|
8533
|
+
|
|
8534
|
+
document.addEventListener(FRAUD_PREVENTION_EVENTS.NAMESPACE, (event) => {
|
|
8535
|
+
switch (event.detail.type) {
|
|
8536
|
+
case FRAUD_PREVENTION_EVENTS.TYPES.FINTERPRINT_TOKEN_READY: {
|
|
8537
|
+
token = event.detail.payload.token;
|
|
8538
|
+
break;
|
|
8539
|
+
}
|
|
8540
|
+
case FRAUD_PREVENTION_EVENTS.TYPES.FINGERPRINT_TOKEN_ERROR: {
|
|
8541
|
+
errorCode = event.detail.payload.code;
|
|
8542
|
+
break;
|
|
8543
|
+
}
|
|
8544
|
+
default: {
|
|
8545
|
+
throw new Error(
|
|
8546
|
+
`${FRAUD_PREVENTION_EVENTS.NAMESPACE} emitted an unsupported event: ${JSON.stringify(event.detail)}.`,
|
|
8547
|
+
);
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8550
|
+
|
|
8551
|
+
render();
|
|
8552
|
+
});
|
|
8553
|
+
|
|
8554
|
+
const fraudPreventionServiceConfig = {
|
|
8555
|
+
environmentId: 'sandbox',
|
|
8556
|
+
mode: 'test'
|
|
8557
|
+
}
|
|
8558
|
+
|
|
8559
|
+
// Set "csp" to true if your website uses Content Security Policies
|
|
8560
|
+
const csp = false;
|
|
8561
|
+
|
|
8562
|
+
new FraudPreventionService(fraudPreventionServiceConfig)
|
|
8563
|
+
.withForter({
|
|
8564
|
+
siteId: 'example_site_id_or_subsite_id',
|
|
8565
|
+
csp,
|
|
8566
|
+
});
|
|
8567
|
+
|
|
8568
|
+
// new FraudPreventionService(fraudPreventionServiceConfig)
|
|
8569
|
+
// .withAccessTokenStrategy("eyJhb_access_token_example_...")
|
|
8570
|
+
// .withForter({
|
|
8571
|
+
// providerId: environment.forter.serviceId,
|
|
8572
|
+
// csp,
|
|
8573
|
+
// });
|
|
8574
|
+
|
|
8575
|
+
// new FraudPreventionService(fraudPreventionServiceConfig)
|
|
8576
|
+
// .withPublicKeyStrategy("pk_example_...")
|
|
8577
|
+
// .withForter({
|
|
8578
|
+
// providerId: environment.forter.serviceId,
|
|
8579
|
+
// csp,
|
|
8580
|
+
// });
|
|
8581
|
+
</script>
|
|
8582
|
+
</body>
|
|
8583
|
+
|
|
8584
|
+
</html>
|
|
8585
|
+
```
|
|
8586
|
+
|
|
8587
|
+
#### Forter: Content Security Policies
|
|
8588
|
+
|
|
8589
|
+
If your site enforces Content Security Policies (CSP), make sure to:
|
|
8590
|
+
|
|
8591
|
+
1. Set the `csp` option to `true` when invoking `withForter` on your `FraudPreventionService` instance.
|
|
8592
|
+
2. Allowlist Forter's domains on `connect-src`, `script-src` and `worker-src` as shown below.
|
|
8593
|
+
|
|
8594
|
+
```bash
|
|
8595
|
+
connect-src https://*.forter.com wss://cdn0.forter.com https://d2o5idwacg3gyw.cloudfront.net https://dz8rit8v72mig.cloudfront.net https://db7q4jg5rkhk8.cloudfront.net https://1.1.1.1 https://d94qwxh6czci4.cloudfront.net https://dr6vcclmzwk74.cloudfront.net https://d6rak4b14t5gp.cloudfront.net https://d3k4bt74u9esq1.cloudfront.net https://d1ezzflfzltk6e.cloudfront.net https://d3nocrch4qti4v.cloudfront.net https://duuytoqss3gu4.cloudfront.net https://df45ay5pw60dy.cloudfront.net
|
|
8596
|
+
script-src https://*.forter.com https://dlthst9q2beh8.cloudfront.net https://d2nww8zpyj5pk0.cloudfront.net https://d2w2nqfk3z9hdt.cloudfront.net
|
|
8597
|
+
worker-src blob:
|
|
8598
|
+
```
|
|
8599
|
+
|
|
8600
|
+
|
|
8445
8601
|
## PayPalSavePaymentSource Widget
|
|
8446
8602
|
|
|
8447
8603
|
PayPalSavePaymentSource Widget allows to obtain a Paydock one time token linked with a Paypal payment source from the customer.
|