@paydock/client-sdk 1.111.1 → 1.113.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 +39 -0
- package/bundles/index.cjs +345 -307
- package/bundles/index.cjs.d.ts +4 -0
- package/bundles/index.mjs +345 -307
- package/bundles/index.mjs.d.ts +4 -0
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-checkout-internal.d.ts +1 -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/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.google_pay_form.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/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-template.d.ts +1 -1
- package/bundles/types/components/iframe-event.d.ts +2 -0
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/index-cba.d.ts +1 -0
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/index.d.ts +1 -0
- package/bundles/types/secure-remote-commerce/index.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/interfaces.d.ts +12 -2
- package/bundles/types/secure-remote-commerce/interfaces.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
- package/bundles/widget.umd.js +345 -307
- package/bundles/widget.umd.js.d.ts +4 -0
- package/bundles/widget.umd.js.min.d.ts +4 -0
- package/bundles/widget.umd.min.js +7 -7
- package/docs/click-to-pay-examples.md +36 -0
- package/docs/click-to-pay.md +3 -0
- package/package.json +66 -66
- package/slate.md +36 -0
|
@@ -229,3 +229,39 @@ src.setStyles({
|
|
|
229
229
|
font_family: 'Arial',
|
|
230
230
|
});
|
|
231
231
|
```
|
|
232
|
+
|
|
233
|
+
## Recognition token
|
|
234
|
+
|
|
235
|
+
In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
|
|
236
|
+
If you already have a recognitionToken stored, you can use it in meta to load the user information.
|
|
237
|
+
|
|
238
|
+
### Storage suggestions
|
|
239
|
+
Merchant can store the tokens by dropping the token as a 1st party cookie in the browser, and must ensure to manage all the security aspects around dropping/storing the cookie by following the security standards:
|
|
240
|
+
|
|
241
|
+
- `Expiration Date=` cookie should be set to expire at a max 180 days
|
|
242
|
+
- `Secure` flag
|
|
243
|
+
- `httpOnly` flag
|
|
244
|
+
- `sameSite=` strict
|
|
245
|
+
- `Value=` recognition token JWT
|
|
246
|
+
|
|
247
|
+
### Example code
|
|
248
|
+
|
|
249
|
+
```javascript
|
|
250
|
+
var src = new paydock.ClickToPay(
|
|
251
|
+
"#checkoutIframe",
|
|
252
|
+
"service_id",
|
|
253
|
+
"paydock_public_key",
|
|
254
|
+
{
|
|
255
|
+
"recognition_token": "eyJraWQiOiIy...",
|
|
256
|
+
},
|
|
257
|
+
);
|
|
258
|
+
src.on('recognitionTokenRequested', (data) => {
|
|
259
|
+
console.log('Recognition token was found: ' + data.data.recognitionToken);
|
|
260
|
+
// Add recognition token to your store
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
src.on('recognitionTokenDropped', () => {
|
|
264
|
+
console.log('Recognition token was droped');
|
|
265
|
+
// Delete recognition token from your store
|
|
266
|
+
});
|
|
267
|
+
```
|
package/docs/click-to-pay.md
CHANGED
|
@@ -78,6 +78,7 @@ Interface of data used for the Mastercard Checkout. For further information refe
|
|
|
78
78
|
| [customer.phone.country_code] | <code>string</code> | Customer phone country code (example "1" for US). |
|
|
79
79
|
| [customer.phone.phone] | <code>string</code> | Customer phone number. |
|
|
80
80
|
| [unaccepted_card_type] | <code>string</code> | Used to block a specific card type. Options are 'CREDIT', 'DEBIT'. |
|
|
81
|
+
| [recognition_token] | <code>string</code> | Used for Click to Pay to load user information and preferences. |
|
|
81
82
|
|
|
82
83
|
<a name="EventData" id="EventData" href="#EventData"> </a>
|
|
83
84
|
|
|
@@ -320,6 +321,8 @@ List of available event's name in the Click To Pay checkout lifecycle
|
|
|
320
321
|
| CHECKOUT_POPUP_CLOSE | <code>string</code> | <code>"checkoutPopupClose"</code> | Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode. |
|
|
321
322
|
| CHECKOUT_COMPLETED | <code>string</code> | <code>"checkoutCompleted"</code> | Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information. |
|
|
322
323
|
| CHECKOUT_ERROR | <code>string</code> | <code>"checkoutError"</code> | Event sent on error checkout by customer. Check [data](#EventData) for more information. |
|
|
324
|
+
| RECOGNITION_TOKEN_REQUESTED | <code>string</code> | <code>"recognitionTokenRequested"</code> | Event sent when a recognition token was found on the mastercard SDK response. |
|
|
325
|
+
| RECOGNITION_TOKEN_DROPPED | <code>string</code> | <code>"recognitionTokenDropped"</code> | Event sent when a recognition token needs to be dropped for user be no longer remembered. |
|
|
323
326
|
|
|
324
327
|
<a name="EVENT_DATA_TYPE" id="EVENT_DATA_TYPE" href="#EVENT_DATA_TYPE"> </a>
|
|
325
328
|
|
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
"name": "@paydock/client-sdk",
|
|
107
|
-
"version": "1.
|
|
107
|
+
"version": "1.113.2-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",
|
|
@@ -137,75 +137,75 @@
|
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
139
|
"@auspayplus/open-payments-checkout": "1.8.0",
|
|
140
|
-
"@newrelic/browser-agent": "
|
|
141
|
-
"@stripe/stripe-js": "
|
|
140
|
+
"@newrelic/browser-agent": "1.260.1",
|
|
141
|
+
"@stripe/stripe-js": "1.54.2"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
|
-
"@babel/cli": "
|
|
145
|
-
"@babel/core": "
|
|
146
|
-
"@babel/plugin-external-helpers": "
|
|
147
|
-
"@babel/plugin-transform-modules-umd": "
|
|
148
|
-
"@babel/plugin-transform-object-assign": "
|
|
149
|
-
"@babel/plugin-transform-runtime": "
|
|
150
|
-
"@babel/polyfill": "
|
|
151
|
-
"@babel/preset-env": "
|
|
152
|
-
"@babel/runtime": "
|
|
153
|
-
"@babel/runtime-corejs2": "
|
|
154
|
-
"@biomejs/biome": "
|
|
155
|
-
"@rollup/plugin-babel": "
|
|
156
|
-
"@rollup/plugin-commonjs": "
|
|
157
|
-
"@rollup/plugin-json": "
|
|
158
|
-
"@rollup/plugin-node-resolve": "
|
|
159
|
-
"@rollup/plugin-replace": "
|
|
160
|
-
"@rollup/plugin-terser": "
|
|
161
|
-
"@rollup/plugin-typescript": "
|
|
162
|
-
"@rollup/pluginutils": "
|
|
163
|
-
"@types/applepayjs": "
|
|
164
|
-
"@types/es6-promise": "
|
|
165
|
-
"@types/googlepay": "
|
|
166
|
-
"@types/jasmine": "
|
|
167
|
-
"@types/jasmine-ajax": "
|
|
168
|
-
"@types/jquery": "
|
|
169
|
-
"babelify": "
|
|
170
|
-
"base64-js": "
|
|
171
|
-
"browser-resolve": "
|
|
172
|
-
"browserify": "
|
|
173
|
-
"browserify-istanbul": "
|
|
174
|
-
"buffer": "
|
|
175
|
-
"dotenv": "
|
|
144
|
+
"@babel/cli": "7.24.5",
|
|
145
|
+
"@babel/core": "7.24.5",
|
|
146
|
+
"@babel/plugin-external-helpers": "7.24.1",
|
|
147
|
+
"@babel/plugin-transform-modules-umd": "7.24.1",
|
|
148
|
+
"@babel/plugin-transform-object-assign": "7.24.1",
|
|
149
|
+
"@babel/plugin-transform-runtime": "7.24.3",
|
|
150
|
+
"@babel/polyfill": "7.12.1",
|
|
151
|
+
"@babel/preset-env": "7.24.5",
|
|
152
|
+
"@babel/runtime": "7.24.5",
|
|
153
|
+
"@babel/runtime-corejs2": "7.24.5",
|
|
154
|
+
"@biomejs/biome": "1.7.3",
|
|
155
|
+
"@rollup/plugin-babel": "6.0.4",
|
|
156
|
+
"@rollup/plugin-commonjs": "25.0.7",
|
|
157
|
+
"@rollup/plugin-json": "6.1.0",
|
|
158
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
159
|
+
"@rollup/plugin-replace": "5.0.5",
|
|
160
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
161
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
162
|
+
"@rollup/pluginutils": "5.1.0",
|
|
163
|
+
"@types/applepayjs": "14.0.8",
|
|
164
|
+
"@types/es6-promise": "3.3.0",
|
|
165
|
+
"@types/googlepay": "0.6.4",
|
|
166
|
+
"@types/jasmine": "5.1.4",
|
|
167
|
+
"@types/jasmine-ajax": "3.3.5",
|
|
168
|
+
"@types/jquery": "3.5.30",
|
|
169
|
+
"babelify": "10.0.0",
|
|
170
|
+
"base64-js": "1.5.1",
|
|
171
|
+
"browser-resolve": "1.11.3",
|
|
172
|
+
"browserify": "17.0.0",
|
|
173
|
+
"browserify-istanbul": "2.0.0",
|
|
174
|
+
"buffer": "5.7.1",
|
|
175
|
+
"dotenv": "16.4.5",
|
|
176
176
|
"fs": "0.0.2",
|
|
177
|
-
"grunt": "
|
|
178
|
-
"grunt-cli": "
|
|
179
|
-
"grunt-jsdoc-to-markdown": "
|
|
180
|
-
"grunt-replace": "
|
|
177
|
+
"grunt": "1.6.1",
|
|
178
|
+
"grunt-cli": "1.4.3",
|
|
179
|
+
"grunt-jsdoc-to-markdown": "6.0.0",
|
|
180
|
+
"grunt-replace": "2.0.2",
|
|
181
181
|
"grunt-template-render": "0.0.1",
|
|
182
|
-
"highlight.js": "
|
|
183
|
-
"ieee754": "
|
|
184
|
-
"include-all": "
|
|
185
|
-
"jasmine-ajax": "
|
|
186
|
-
"jasmine-core": "
|
|
187
|
-
"jquery": "
|
|
188
|
-
"jsdoc-to-markdown": "
|
|
189
|
-
"karma": "
|
|
190
|
-
"karma-browserify": "
|
|
191
|
-
"karma-chrome-launcher": "
|
|
192
|
-
"karma-cli": "
|
|
193
|
-
"karma-firefox-launcher": "
|
|
194
|
-
"karma-jasmine": "
|
|
195
|
-
"karma-jasmine-ajax": "
|
|
196
|
-
"karma-mocha-reporter": "
|
|
197
|
-
"marked": "
|
|
198
|
-
"npm-run-all2": "
|
|
199
|
-
"process": "
|
|
200
|
-
"rimraf": "
|
|
201
|
-
"rollup": "
|
|
202
|
-
"rollup-plugin-dts": "
|
|
203
|
-
"rxjs": "
|
|
204
|
-
"tsify": "
|
|
205
|
-
"tslib": "
|
|
206
|
-
"tslint": "
|
|
207
|
-
"typescript": "
|
|
208
|
-
"zod": "
|
|
182
|
+
"highlight.js": "11.9.0",
|
|
183
|
+
"ieee754": "1.2.1",
|
|
184
|
+
"include-all": "4.0.3",
|
|
185
|
+
"jasmine-ajax": "3.4.0",
|
|
186
|
+
"jasmine-core": "2.99.1",
|
|
187
|
+
"jquery": "3.7.1",
|
|
188
|
+
"jsdoc-to-markdown": "8.0.1",
|
|
189
|
+
"karma": "6.4.3",
|
|
190
|
+
"karma-browserify": "8.1.0",
|
|
191
|
+
"karma-chrome-launcher": "2.2.0",
|
|
192
|
+
"karma-cli": "2.0.0",
|
|
193
|
+
"karma-firefox-launcher": "1.3.0",
|
|
194
|
+
"karma-jasmine": "1.1.2",
|
|
195
|
+
"karma-jasmine-ajax": "0.1.13",
|
|
196
|
+
"karma-mocha-reporter": "2.2.5",
|
|
197
|
+
"marked": "4.3.0",
|
|
198
|
+
"npm-run-all2": "6.2.0",
|
|
199
|
+
"process": "0.11.10",
|
|
200
|
+
"rimraf": "5.0.7",
|
|
201
|
+
"rollup": "4.17.2",
|
|
202
|
+
"rollup-plugin-dts": "6.1.0",
|
|
203
|
+
"rxjs": "7.8.1",
|
|
204
|
+
"tsify": "3.0.4",
|
|
205
|
+
"tslib": "2.6.2",
|
|
206
|
+
"tslint": "5.20.1",
|
|
207
|
+
"typescript": "5.4.5",
|
|
208
|
+
"zod": "3.23.8"
|
|
209
209
|
},
|
|
210
210
|
"engines": {
|
|
211
211
|
"node": ">=16.0.0"
|
package/slate.md
CHANGED
|
@@ -1922,3 +1922,39 @@ src.setStyles({
|
|
|
1922
1922
|
font_family: 'Arial',
|
|
1923
1923
|
});
|
|
1924
1924
|
```
|
|
1925
|
+
|
|
1926
|
+
## Recognition token
|
|
1927
|
+
|
|
1928
|
+
In order to store user information for further payments, click to pay provides a recognition token that is used to load user information.
|
|
1929
|
+
If you already have a recognitionToken stored, you can use it in meta to load the user information.
|
|
1930
|
+
|
|
1931
|
+
### Storage suggestions
|
|
1932
|
+
Merchant can store the tokens by dropping the token as a 1st party cookie in the browser, and must ensure to manage all the security aspects around dropping/storing the cookie by following the security standards:
|
|
1933
|
+
|
|
1934
|
+
- `Expiration Date=` cookie should be set to expire at a max 180 days
|
|
1935
|
+
- `Secure` flag
|
|
1936
|
+
- `httpOnly` flag
|
|
1937
|
+
- `sameSite=` strict
|
|
1938
|
+
- `Value=` recognition token JWT
|
|
1939
|
+
|
|
1940
|
+
### Example code
|
|
1941
|
+
|
|
1942
|
+
```javascript
|
|
1943
|
+
var src = new paydock.ClickToPay(
|
|
1944
|
+
"#checkoutIframe",
|
|
1945
|
+
"service_id",
|
|
1946
|
+
"paydock_public_key",
|
|
1947
|
+
{
|
|
1948
|
+
"recognition_token": "eyJraWQiOiIy...",
|
|
1949
|
+
},
|
|
1950
|
+
);
|
|
1951
|
+
src.on('recognitionTokenRequested', (data) => {
|
|
1952
|
+
console.log('Recognition token was found: ' + data.data.recognitionToken);
|
|
1953
|
+
// Add recognition token to your store
|
|
1954
|
+
});
|
|
1955
|
+
|
|
1956
|
+
src.on('recognitionTokenDropped', () => {
|
|
1957
|
+
console.log('Recognition token was droped');
|
|
1958
|
+
// Delete recognition token from your store
|
|
1959
|
+
});
|
|
1960
|
+
```
|