@paydock/client-sdk 1.147.0 → 1.148.0-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/bundles/index.cjs +227 -39
- package/bundles/index.cjs.d.ts +757 -581
- package/bundles/index.mjs +227 -39
- package/bundles/index.mjs.d.ts +757 -581
- package/bundles/types/api/api-charge-internal.d.ts +6 -1
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts +15 -0
- package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts +27 -0
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/index.d.ts +1 -1
- package/bundles/types/canvas-3ds/index.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +36 -2
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +10 -0
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -1
- package/bundles/types/index.d.ts +1 -1
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/widget.umd.js +227 -39
- package/bundles/widget.umd.js.d.ts +757 -581
- package/bundles/widget.umd.js.min.d.ts +757 -581
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-canvas3ds.md +31 -0
- package/package.json +11 -8
package/docs/api-canvas3ds.md
CHANGED
|
@@ -29,6 +29,7 @@ Class Canvas3ds include method for working on html
|
|
|
29
29
|
* [.load()](#Canvas3ds+load)
|
|
30
30
|
* [.setEnv(env, [alias])](#Canvas3ds+setEnv)
|
|
31
31
|
* [.on(eventName, cb)](#Canvas3ds+on) ⇒
|
|
32
|
+
* [.authenticate()](#Canvas3ds+authenticate)
|
|
32
33
|
* [.hide([saveSize])](#Canvas3ds+hide)
|
|
33
34
|
* [.show()](#Canvas3ds+show)
|
|
34
35
|
* [.reload()](#Canvas3ds+reload)
|
|
@@ -98,6 +99,35 @@ widget.on('chargeAuthReject').then((data) => {
|
|
|
98
99
|
console.log(data);
|
|
99
100
|
});
|
|
100
101
|
```
|
|
102
|
+
<a name="Canvas3ds+authenticate" id="Canvas3ds+authenticate" href="#Canvas3ds+authenticate"> </a>
|
|
103
|
+
|
|
104
|
+
### canvas3ds.authenticate()
|
|
105
|
+
Two-step mode only (`_3ds.authentication_flow: 'two_step'`): runs the authentication the API deferred after the
|
|
106
|
+
fingerprint. Call it when the shopper confirms (e.g. presses "Pay"); the outcome arrives through the
|
|
107
|
+
usual events (`chargeAuthChallenge`, `chargeAuthSuccess`, `chargeAuthReject`, `error`).
|
|
108
|
+
|
|
109
|
+
Never throws. After `chargeAuthReady` the authentication starts at once; before it, the call is
|
|
110
|
+
remembered and runs as soon as the fingerprint completes. One-step charges, repeated calls and calls after
|
|
111
|
+
a terminal outcome are no-ops. For inbuilt 3DS (`html` / `url`) tokens it is a silent no-op: no event is
|
|
112
|
+
emitted at all, so do not wait for `error` there. Calling it before `load()` is an integration error: it emits `error` and
|
|
113
|
+
is not remembered. If `/process` could not be reached (`error` with `error_code` `service_unreachable` /
|
|
114
|
+
`aborted`), `authenticate()` may be called once more; any other `error`, and any failure of that retry,
|
|
115
|
+
is final.
|
|
116
|
+
No client-side deadline: a stale 3DS Server session surfaces as `error` / `chargeAuthReject`.
|
|
117
|
+
|
|
118
|
+
**Kind**: instance method of [<code>Canvas3ds</code>](#Canvas3ds)
|
|
119
|
+
**Example**
|
|
120
|
+
```js
|
|
121
|
+
const widget = new Canvas3ds('#widget', token); // charge created with _3ds.authentication_flow: 'two_step'
|
|
122
|
+
widget.on('chargeAuthReady', () => payButton.disabled = false);
|
|
123
|
+
widget.on('chargeAuthChallenge', () => showChallengeModal());
|
|
124
|
+
widget.on('chargeAuthSuccess', (data) => completePayment(data.charge_3ds_id));
|
|
125
|
+
widget.on('chargeAuthReject', () => showDeclined());
|
|
126
|
+
widget.on('error', () => showError());
|
|
127
|
+
widget.load(); // fingerprint runs while the shopper reviews the order
|
|
128
|
+
|
|
129
|
+
payButton.addEventListener('click', () => widget.authenticate());
|
|
130
|
+
```
|
|
101
131
|
<a name="Canvas3ds+hide" id="Canvas3ds+hide" href="#Canvas3ds+hide"> </a>
|
|
102
132
|
|
|
103
133
|
### canvas3ds.hide([saveSize])
|
|
@@ -160,6 +190,7 @@ List of available event's name for Standalone 3ds flow
|
|
|
160
190
|
| AUTH_ERROR | <code>string</code> | <code>"chargeAuthReject"</code> | |
|
|
161
191
|
| DECOUPLED | <code>string</code> | <code>"chargeAuthDecoupled"</code> | |
|
|
162
192
|
| CHALLENGE | <code>string</code> | <code>"chargeAuthChallenge"</code> | |
|
|
193
|
+
| READY | <code>string</code> | <code>"chargeAuthReady"</code> | two-step mode only: fingerprint done, waiting for `authenticate()` |
|
|
163
194
|
| CHALLENGE_LOADED | <code>string</code> | <code>"chargeAuthChallengeLoaded"</code> | challenge iframe painted (first `load`, or 2.5 s fallback); reveal your challenge UI here |
|
|
164
195
|
| CHALLENGE_COMPLETED | <code>string</code> | <code>"chargeAuthChallengeCompleted"</code> | the shopper finished the challenge (issuer result delivered to the 3DS Server); cover the challenge iframe with your own loader until the terminal event |
|
|
165
196
|
| INFO | <code>string</code> | <code>"chargeAuthInfo"</code> | |
|
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
"name": "@paydock/client-sdk",
|
|
107
|
-
"version": "1.
|
|
107
|
+
"version": "1.148.0-beta",
|
|
108
108
|
"scripts": {
|
|
109
109
|
"build:doc": "node docs/html/marked.js",
|
|
110
110
|
"build:js": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
@@ -213,15 +213,17 @@
|
|
|
213
213
|
"tsify": "3.0.4",
|
|
214
214
|
"tslib": "2.6.2",
|
|
215
215
|
"typescript": "5.4.5",
|
|
216
|
-
"vitest": "
|
|
216
|
+
"vitest": "4.1.11",
|
|
217
217
|
"zod": "3.23.8"
|
|
218
218
|
},
|
|
219
219
|
"overrides": {
|
|
220
220
|
"sha.js@>=2.0.0 <=2.4.11": "2.4.12",
|
|
221
221
|
"pbkdf2": ">=3.1.3",
|
|
222
222
|
"form-data": ">=4.0.6",
|
|
223
|
-
"qs": "
|
|
224
|
-
"js-yaml": "4.3.
|
|
223
|
+
"qs": "6.16.0",
|
|
224
|
+
"js-yaml": "4.3.2",
|
|
225
|
+
"fflate@0.4": "0.4.9",
|
|
226
|
+
"fflate@0.7": "0.7.5",
|
|
225
227
|
"@babel/plugin-transform-modules-systemjs": ">=7.29.4",
|
|
226
228
|
"fast-uri": "3.1.7",
|
|
227
229
|
"tmp": ">=0.2.6",
|
|
@@ -230,8 +232,8 @@
|
|
|
230
232
|
"minimatch@^5": "5.1.9",
|
|
231
233
|
"minimatch@^9": "9.0.9",
|
|
232
234
|
"@isaacs/brace-expansion": ">=5.0.1",
|
|
233
|
-
"brace-expansion@1": "1.1.
|
|
234
|
-
"brace-expansion@2": "2.1.
|
|
235
|
+
"brace-expansion@1": "1.1.21",
|
|
236
|
+
"brace-expansion@2": "2.1.7",
|
|
235
237
|
"postcss": "8.5.23",
|
|
236
238
|
"bn.js": ">=5.2.3",
|
|
237
239
|
"ajv": "8.18.0",
|
|
@@ -243,7 +245,7 @@
|
|
|
243
245
|
"node-forge": ">=1.4.0",
|
|
244
246
|
"picomatch": ">=2.3.2",
|
|
245
247
|
"socket.io-parser": "4.2.7",
|
|
246
|
-
"engine.io": "6.6.
|
|
248
|
+
"engine.io": "6.6.11",
|
|
247
249
|
"lodash": ">=4.18.0",
|
|
248
250
|
"vite": ">=6.4.2 <7",
|
|
249
251
|
"follow-redirects": ">=1.16.0",
|
|
@@ -251,7 +253,8 @@
|
|
|
251
253
|
"esbuild": ">=0.28.1",
|
|
252
254
|
"linkify-it": "5.0.2",
|
|
253
255
|
"body-parser": "1.20.6",
|
|
254
|
-
"nanoid": "3.3.18"
|
|
256
|
+
"nanoid": "3.3.18",
|
|
257
|
+
"markdown-it": "14.2.0"
|
|
255
258
|
},
|
|
256
259
|
"engines": {
|
|
257
260
|
"node": ">=16.0.0"
|