@paydock/client-sdk 1.112.0 → 1.112.4-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 +806 -22
- package/bundles/index.cjs +1572 -229
- package/bundles/index.cjs.d.ts +2505 -2056
- package/bundles/index.mjs +1566 -226
- package/bundles/index.mjs.d.ts +2505 -2056
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-charge-internal.d.ts +1 -0
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
- package/bundles/types/api/api-checkout-internal.d.ts +2 -0
- package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
- package/bundles/types/checkout/checkout.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/helpers/resource-helper.d.ts +4 -3
- package/bundles/types/checkout/helpers/resource-helper.d.ts.map +1 -1
- package/bundles/types/checkout/helpers/session-helper.d.ts +3 -0
- package/bundles/types/checkout/helpers/session-helper.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.afterpay_checkout_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.apple_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.canvas_3ds.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.generic.show_message.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.google_pay_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.payment_methods.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.paypal_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/instructions/v1/instruction.zip_checkout_form.show.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts +3 -0
- package/bundles/types/checkout/layout-widgets/payment-methods-template.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts +1 -1
- package/bundles/types/checkout/layout-widgets/payment-methods.d.ts.map +1 -1
- package/bundles/types/checkout/layout-widgets/payment-template.d.ts +1 -1
- package/bundles/types/components/iframe-event.d.ts +39 -27
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/components/iframe.d.ts +2 -2
- package/bundles/types/components/iframe.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +2 -0
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/configs/env/environment.paydock.d.ts.map +1 -1
- package/bundles/types/fraud-prevention/events.d.ts +44 -0
- package/bundles/types/fraud-prevention/events.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/fraud-prevention.service.d.ts +70 -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 +78 -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-production.template.d.ts +2 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-production.template.d.ts.map +1 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-sandbox.template.d.ts +2 -0
- package/bundles/types/fraud-prevention/providers/forter/templates/forter-snippet-sandbox.template.d.ts.map +1 -0
- package/bundles/types/helper/browser.d.ts.map +1 -1
- package/bundles/types/helper/custom-error.d.ts +8 -0
- package/bundles/types/helper/custom-error.d.ts.map +1 -0
- package/bundles/types/index-cba.d.ts +6 -1
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/index.d.ts +4 -1
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/types/paypal-data-collector/index.d.ts +23 -0
- package/bundles/types/paypal-data-collector/index.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts +58 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts +21 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts +17 -0
- package/bundles/types/paypal-data-collector/paypal-data-collector.service.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts +61 -0
- package/bundles/types/paypal-save-payment-source/index.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts +85 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts +83 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.interfaces.d.ts.map +1 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts +35 -0
- package/bundles/types/paypal-save-payment-source/paypal-save-payment-source.service.d.ts.map +1 -0
- 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/secure-remote-commerce/index.d.ts +2 -0
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +8 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts +12 -0
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map +1 -0
- package/bundles/types/shared/services/configuration-validation/types.d.ts +73 -0
- package/bundles/types/shared/services/configuration-validation/types.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/enums.d.ts +12 -0
- package/bundles/types/wallet-buttons/enums.d.ts.map +1 -0
- package/bundles/types/wallet-buttons/index.d.ts +5 -1
- package/bundles/types/wallet-buttons/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts +28 -15
- package/bundles/types/wallet-buttons/wallet-buttons.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts +1 -1
- package/bundles/types/wallet-buttons/wallet-services/wallet-service.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts +10 -10
- package/bundles/types/wallet-buttons-express/base.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/index.d.ts +1 -0
- package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts +1 -0
- package/bundles/types/wallet-buttons-express/interfaces/wallet-capture-request.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/apple-pay.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +1 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/paypal.wallet-button-express.d.ts.map +1 -1
- package/bundles/types/widget/configuration.d.ts +13 -9
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-multi-widget.d.ts +1 -2
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
- package/bundles/types/widget/html-widget.d.ts +2 -1
- package/bundles/types/widget/html-widget.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts +5 -1
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +1572 -229
- package/bundles/widget.umd.js.d.ts +2505 -2056
- package/bundles/widget.umd.js.min.d.ts +2505 -2056
- package/bundles/widget.umd.min.js +1 -61
- package/docs/api-widget.md +21 -16
- package/docs/click-to-pay.md +1 -0
- package/docs/fraud-prevention-examples.md +196 -0
- package/docs/fraud-prevention.md +0 -0
- package/docs/install/npm.example.md +1 -1
- package/docs/paypal-data-collector-examples.md +59 -0
- package/docs/paypal-data-collector.md +149 -0
- package/docs/paypal-save-payment-source-examples.md +63 -0
- package/docs/paypal-save-payment-source.md +256 -0
- package/docs/wallet-buttons-examples.md +1 -1
- package/docs/wallet-buttons-express-examples.md +1 -1
- package/docs/wallet-buttons-express.md +1 -0
- package/docs/wallet-buttons.md +3 -0
- package/docs/widget-examples.md +48 -3
- package/examples/multi-html-widget/extend.html +5 -0
- package/package.json +7 -7
- package/slate.md +247 -5
package/slate.md
CHANGED
|
@@ -73,7 +73,7 @@ const widget = new Paydock.HtmlWidget('#selector', 'publicKey', 'gatewayId');
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
```js
|
|
76
|
-
// default import -
|
|
76
|
+
// default import - Not officially supported . They are handled differently by different tools / settings!
|
|
77
77
|
❌
|
|
78
78
|
import paydock from '@paydock/client-sdk'
|
|
79
79
|
>>> "Uncaught SyntaxError: The requested module does not provide an export named 'default'"
|
|
@@ -199,6 +199,20 @@ widget.setSupportedCardIcons(['mastercard', 'visa']); // add icons of supported
|
|
|
199
199
|
|
|
200
200
|
This example shows how you can use a lot of other methods to settings your form
|
|
201
201
|
|
|
202
|
+
|
|
203
|
+
### Error handling
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
widget.on('error', (error) => {
|
|
207
|
+
const errorDiv = document.getElementById('error');
|
|
208
|
+
const errorMessage = document.getElementById('error-message');
|
|
209
|
+
|
|
210
|
+
errorMessage.textContent = error.data.message;
|
|
211
|
+
errorDiv.style.display = 'block';
|
|
212
|
+
});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
|
|
202
216
|
### Full example
|
|
203
217
|
|
|
204
218
|
```html
|
|
@@ -214,7 +228,34 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
214
228
|
<div id="widget"
|
|
215
229
|
widget-style="text-color: #FFFFAA; border-color: #yellow"
|
|
216
230
|
title="Payment form"
|
|
217
|
-
finish-text="Payment resource was successfully accepted"
|
|
231
|
+
finish-text="Payment resource was successfully accepted">
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div
|
|
235
|
+
id="error"
|
|
236
|
+
style="
|
|
237
|
+
display: none;
|
|
238
|
+
max-width: 600px;
|
|
239
|
+
margin: 16px auto;
|
|
240
|
+
padding: 16px 20px;
|
|
241
|
+
border-radius: 8px;
|
|
242
|
+
background-color: #FEF2F2;
|
|
243
|
+
border: 1px solid #FEE2E2;
|
|
244
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
245
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
246
|
+
color: #991B1B;
|
|
247
|
+
line-height: 1.5;
|
|
248
|
+
font-size: 14px;
|
|
249
|
+
"
|
|
250
|
+
title="error"
|
|
251
|
+
>
|
|
252
|
+
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
|
253
|
+
<div>
|
|
254
|
+
<h4 style="margin: 0 0 4px 0; font-size: 14px; font-weight: 600;">Access Error</h4>
|
|
255
|
+
<div id="error-message"></div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
218
259
|
</form>
|
|
219
260
|
|
|
220
261
|
<script src="https://widget.paydock.com/sdk/latest/widget.umd.js" ></script>
|
|
@@ -224,11 +265,15 @@ This example shows how you can use a lot of other methods to settings your form
|
|
|
224
265
|
widget.setSupportedCardIcons(['mastercard', 'visa']);
|
|
225
266
|
widget.setFormFields(['phone', 'email']);
|
|
226
267
|
widget.setRefId('custom-ref-id');
|
|
227
|
-
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
268
|
+
widget.onFinishInsert('input[name="payment_source_token"]', 'payment_source');
|
|
228
269
|
|
|
270
|
+
widget.on('error', (error) => {
|
|
271
|
+
document.getElementById('error-message').textContent = error.data.message;
|
|
272
|
+
document.getElementById('error').style.display = 'block';
|
|
273
|
+
});
|
|
229
274
|
widget.load();
|
|
230
275
|
</script>
|
|
231
|
-
|
|
276
|
+
|
|
232
277
|
</body>
|
|
233
278
|
</html>
|
|
234
279
|
```
|
|
@@ -1481,7 +1526,7 @@ _(Required `meta` fields: - . Optional `meta` fields: -)_
|
|
|
1481
1526
|
},
|
|
1482
1527
|
);
|
|
1483
1528
|
button.setEnv('sandbox');
|
|
1484
|
-
button.onUnavailable(() => console.log("No wallet buttons available"));
|
|
1529
|
+
button.onUnavailable((data) => console.log("No wallet buttons available"));
|
|
1485
1530
|
button.onPaymentSuccessful((data) => console.log("The payment was successful"));
|
|
1486
1531
|
button.onPaymentError((data) => console.log("The payment was not successful"));
|
|
1487
1532
|
button.onAuthTokensChanged((data) => console.log('Authentication tokens changed'));
|
|
@@ -1922,3 +1967,200 @@ src.setStyles({
|
|
|
1922
1967
|
font_family: 'Arial',
|
|
1923
1968
|
});
|
|
1924
1969
|
```
|
|
1970
|
+
|
|
1971
|
+
# Fraud prevention
|
|
1972
|
+
|
|
1973
|
+
The Fraud Prevention module allows you to add security layers to your payment workflows
|
|
1974
|
+
by integrating with any of our underlying fraud prevention providers.
|
|
1975
|
+
|
|
1976
|
+
## Real time user behavior analysis
|
|
1977
|
+
|
|
1978
|
+
### Forter
|
|
1979
|
+
|
|
1980
|
+
One of Forter's key features is our ability to track the user's real-time behavior on
|
|
1981
|
+
the site and use it to separate fraudsters from legitimate buyers. To take advantage
|
|
1982
|
+
of Forter's technology, a JavaScript snippet needs to be placed on EVERY page
|
|
1983
|
+
of your commerce site beginning with the homepage and up to and including the final
|
|
1984
|
+
"Thank you for your purchase" page.
|
|
1985
|
+
|
|
1986
|
+
The integration is simple and straightforward - you only need to configure event
|
|
1987
|
+
listeners and then instantiate a FraudPreventionService with your site configuration.
|
|
1988
|
+
|
|
1989
|
+
Additional setup is required in case your website uses Content Security Policies (CSP)
|
|
1990
|
+
|
|
1991
|
+
#### Forter: Code snippet
|
|
1992
|
+
|
|
1993
|
+
```html
|
|
1994
|
+
<!doctype html>
|
|
1995
|
+
<html lang="en">
|
|
1996
|
+
|
|
1997
|
+
<head>
|
|
1998
|
+
<meta charset="utf-8">
|
|
1999
|
+
<title>Real time user behaviour anaylsis - Forter example</title>
|
|
2000
|
+
<base href="/">
|
|
2001
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
2002
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
2003
|
+
<script src="../../../bundles/widget.umd.js"></script>
|
|
2004
|
+
<style>
|
|
2005
|
+
body {
|
|
2006
|
+
min-width: 320px;
|
|
2007
|
+
max-width: 1440px;
|
|
2008
|
+
min-height: 100svh;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
main {
|
|
2012
|
+
padding: 2rem;
|
|
2013
|
+
margin: 0 auto;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
.forter-test {
|
|
2017
|
+
padding: 1rem;
|
|
2018
|
+
border-radius: 8px;
|
|
2019
|
+
background: #f5f5f5;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
.status-card {
|
|
2023
|
+
background: white;
|
|
2024
|
+
padding: 1rem;
|
|
2025
|
+
border-radius: 4px;
|
|
2026
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
.status {
|
|
2030
|
+
display: inline-block;
|
|
2031
|
+
padding: 0.25rem 0.5rem;
|
|
2032
|
+
border-radius: 4px;
|
|
2033
|
+
font-weight: 500;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
.status.success {
|
|
2037
|
+
background: #e6ffe6;
|
|
2038
|
+
color: #006600;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
.status.pending {
|
|
2042
|
+
background: rgb(255, 249, 205);
|
|
2043
|
+
color: rgb(255, 204, 0);
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
.status.error {
|
|
2047
|
+
background: #ffe6e6;
|
|
2048
|
+
color: #cc0000;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
.error {
|
|
2052
|
+
display: inline-block;
|
|
2053
|
+
padding: 0.25rem 0.5rem;
|
|
2054
|
+
border-radius: 4px;
|
|
2055
|
+
background: #ffe6e6;
|
|
2056
|
+
color: #cc0000;
|
|
2057
|
+
font-weight: 500;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
code {
|
|
2061
|
+
background: #f0f0f0;
|
|
2062
|
+
padding: 0.2rem 0.4rem;
|
|
2063
|
+
border-radius: 4px;
|
|
2064
|
+
font-family: monospace;
|
|
2065
|
+
}
|
|
2066
|
+
</style>
|
|
2067
|
+
</head>
|
|
2068
|
+
|
|
2069
|
+
<body>
|
|
2070
|
+
<main>
|
|
2071
|
+
<h1>Real time user behaviour anaylsis - Forter example</h1>
|
|
2072
|
+
<div class="forter-test">
|
|
2073
|
+
<h2>Forter Integration Test</h2>
|
|
2074
|
+
|
|
2075
|
+
<div class="status-card">
|
|
2076
|
+
<p>
|
|
2077
|
+
<strong>Integration Status:</strong>
|
|
2078
|
+
<span data-fraud-prevention="status-indicator" class="status pending">
|
|
2079
|
+
Pending
|
|
2080
|
+
</span>
|
|
2081
|
+
</p>
|
|
2082
|
+
<p>
|
|
2083
|
+
<strong>Token Value:</strong>
|
|
2084
|
+
<code data-fraud-prevention="forter-token">Not available</code>
|
|
2085
|
+
</p>
|
|
2086
|
+
<p data-fraud-prevention="error-container" style="display: none;">
|
|
2087
|
+
<strong>Error Code:</strong>
|
|
2088
|
+
<span data-fraud-prevention="error-code" class="error"></span>
|
|
2089
|
+
</p>
|
|
2090
|
+
</div>
|
|
2091
|
+
</div>
|
|
2092
|
+
</main>
|
|
2093
|
+
<script>
|
|
2094
|
+
const { FraudPreventionEvents, FraudPreventionService } = window.paydock
|
|
2095
|
+
|
|
2096
|
+
let token = '';
|
|
2097
|
+
let errorCode = '';
|
|
2098
|
+
|
|
2099
|
+
const render = () => {
|
|
2100
|
+
const statusIndicator = document.querySelector('[data-fraud-prevention="status-indicator"]');
|
|
2101
|
+
const tokenValue = document.querySelector('[data-fraud-prevention="forter-token"]');
|
|
2102
|
+
const errorContainer = document.querySelector('[data-fraud-prevention="error-container"]');
|
|
2103
|
+
const errorCodeElement = document.querySelector('[data-fraud-prevention="error-code"]');
|
|
2104
|
+
|
|
2105
|
+
if (token) {
|
|
2106
|
+
statusIndicator.className = 'status success';
|
|
2107
|
+
statusIndicator.textContent = 'Active';
|
|
2108
|
+
tokenValue.textContent = token;
|
|
2109
|
+
} else {
|
|
2110
|
+
statusIndicator.className = 'status pending';
|
|
2111
|
+
statusIndicator.textContent = 'Pending';
|
|
2112
|
+
tokenValue.textContent = 'Not available';
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
if (errorCode) {
|
|
2116
|
+
errorCodeElement.textContent = errorCode;
|
|
2117
|
+
errorContainer.style.display = 'block';
|
|
2118
|
+
} else {
|
|
2119
|
+
errorContainer.style.display = 'none';
|
|
2120
|
+
}
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
document.addEventListener(FraudPreventionEvents.namespace, (event) => {
|
|
2124
|
+
switch (event.detail.type) {
|
|
2125
|
+
case FraudPreventionEvents.types.fingerprintTokenReady: {
|
|
2126
|
+
token = event.detail.payload.token;
|
|
2127
|
+
break;
|
|
2128
|
+
}
|
|
2129
|
+
case FraudPreventionEvents.types.fingerprintTokenError: {
|
|
2130
|
+
errorCode = event.detail.payload.code;
|
|
2131
|
+
break;
|
|
2132
|
+
}
|
|
2133
|
+
default: {
|
|
2134
|
+
throw new Error(
|
|
2135
|
+
`${FraudPreventionEvents.namespace} emitted an unsupported event: ${JSON.stringify(event.detail)}.`,
|
|
2136
|
+
);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
render();
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2143
|
+
new FraudPreventionService().withForter({
|
|
2144
|
+
siteId: 'YOUR_SITE_ID_OR_SUBSITE_ID',
|
|
2145
|
+
mode: 'test',
|
|
2146
|
+
csp: false, // set to true if your website uses Content-Security-Policies
|
|
2147
|
+
});
|
|
2148
|
+
</script>
|
|
2149
|
+
</body>
|
|
2150
|
+
|
|
2151
|
+
</html>
|
|
2152
|
+
```
|
|
2153
|
+
|
|
2154
|
+
#### Forter: Content Security Policies
|
|
2155
|
+
|
|
2156
|
+
If your site enforces Content Security Policies (CSP), make sure to:
|
|
2157
|
+
|
|
2158
|
+
1. Set the `csp` option to `true` when invoking `withForter` on your `FraudPreventionService` instance.
|
|
2159
|
+
2. Allowlist Forter's domains on `connect-src`, `script-src`, `script-src-element` and, `worker-src` as shown below.
|
|
2160
|
+
|
|
2161
|
+
```bash
|
|
2162
|
+
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
|
|
2163
|
+
script-src https://*.forter.com https://dlthst9q2beh8.cloudfront.net https://d2nww8zpyj5pk0.cloudfront.net https://d2w2nqfk3z9hdt.cloudfront.net
|
|
2164
|
+
script-src-elem https://*.forter.com https://dlthst9q2beh8.cloudfront.net https://d2nww8zpyj5pk0.cloudfront.net https://d2w2nqfk3z9hdt.cloudfront.net
|
|
2165
|
+
worker-src blob:
|
|
2166
|
+
```
|