@netceterapx/click-to-pay-sdk 2.4.2 → 2.6.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 +28 -5
- package/build/click-to-pay-sdk.es.js +4100 -2801
- package/build/click-to-pay-sdk.js +1 -1
- package/index.d.ts +325 -65
- package/package.json +53 -46
package/README.md
CHANGED
|
@@ -31,6 +31,10 @@ SRC component to autofill the users email.
|
|
|
31
31
|
- `true` This starts the SRCi in development mode, using the sandbox version of the chosen credit card brands. As an example,
|
|
32
32
|
this can be useful for local development.
|
|
33
33
|
|
|
34
|
+
`debugLogs` Controls whether logs of requests and responses to the schemes are printed out in the console for debugging purposes. Valid values are:
|
|
35
|
+
- `true` logs of Click to Pay requests and responses are printed out in the console only if the sandbox parameter has a value of true.
|
|
36
|
+
- `false` logs of Click to Pay requests and responses are not printed out in the console.
|
|
37
|
+
|
|
34
38
|
`ispaninpaybutton` This prop controls whether a masked PAN is shown on the payment button. Possible values:
|
|
35
39
|
- `true` Masked pan is shown on the payment button.
|
|
36
40
|
- `false` Masked pan is not shown on the payment button.
|
|
@@ -158,6 +162,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
158
162
|
clickToPay.addEventListener('cardSelection', (e) => {
|
|
159
163
|
// handle card selection event
|
|
160
164
|
});
|
|
165
|
+
|
|
166
|
+
clickToPay.addEventListener('unbindConsumer', (e) => {
|
|
167
|
+
// handle unbind consumer event
|
|
168
|
+
});
|
|
161
169
|
});
|
|
162
170
|
```
|
|
163
171
|
|
|
@@ -197,6 +205,9 @@ has been performed. Example: User clicked on an input field/button, started typi
|
|
|
197
205
|
`clickToPay.addEventListener('cardSelection', (e) => {});` The click-to-pay component will fire a card selection event
|
|
198
206
|
when the user selected a card within the list of cards enrolled in Click to Pay and provide detailed information about the selected card.
|
|
199
207
|
|
|
208
|
+
`clickToPay.addEventListener('unbindConsumer', (e) => {});`The click-to-pay component will fire an unbind consumer event
|
|
209
|
+
when the consumer has chosen to be forgotten by selecting the 'Switch ID' option in the component.
|
|
210
|
+
|
|
200
211
|
```ts
|
|
201
212
|
enum GeneralEvents {
|
|
202
213
|
ON_DCF_CANCEL
|
|
@@ -253,11 +264,23 @@ The response of the `checkout` method is forwarded from the SRC vendor to the me
|
|
|
253
264
|
Example response:
|
|
254
265
|
```json
|
|
255
266
|
{
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
"userAction": "COMPLETE",
|
|
268
|
+
"checkoutResponseSignature": "eyJraWQiOiJTRTZOOE...",
|
|
269
|
+
"creditCardBrand": "Visa",
|
|
270
|
+
"performance":{"correlationId":{"visa":"5ee5add0-bbdd-6094-55bd-16c4c7bda302","mc":"","amex":""},"referenceTimestamp":"2022-12-18T20:15:50.036Z","totalLoadingTime":3731,"consumerStatus":{"isRecognized": false, "hasProfile": true, "hasCards": true, "hasProfileInSchemes": ["Visa"], "manualCardEntryMandatory": false},"sdkPerformance":{"visa":[{"methodName":"init","duration":1428,"startDelta":0},{"methodName":"isRecognized","duration":1297,"startDelta":3690},{"methodName":"identityLookup","duration":1218,"startDelta":18833},{"methodName":"getSrcProfile","duration":2548,"startDelta":41254},{"methodName":"unbindAppInstance","duration":24,"startDelta":52816}]}},
|
|
271
|
+
"userActions": [{"type":"click","target":"email","startDelta":1215},{"type":"text_type","target":"email","startDelta":1743},{"type":"click","target":"continue","startDelta":9258},{"type":"click","target":"otp","startDelta":18889.000000000004},{"type":"text_type","target":"otp","startDelta":43660},{"type":"click","target":"continue","startDelta":44120},{"type":"click","target":"continue","startDelta":50200}]
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Example response with Mastercard recognition token:
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"userAction": "COMPLETE",
|
|
279
|
+
"checkoutResponseSignature": "eyJraWQiOiJTRTZOOE...",
|
|
280
|
+
"recognitionToken": "eyJraWQiOiIyMDIzMD...",
|
|
281
|
+
"creditCardBrand": "Mastercard",
|
|
282
|
+
"performance":{"correlationId":{"visa":"","mc":"34f4a04b.8add86db-c257-4f8c-808a-b51a4a07e444","amex":""},"referenceTimestamp":"2022-12-18T20:15:50.036Z","totalLoadingTime":3731,"consumerStatus":{"isRecognized": false, "hasProfile": true, "hasCards": true, "hasProfileInSchemes": ["Mastercard"], "manualCardEntryMandatory": false},"sdkPerformance":{"mastercard":[{"methodName":"init","duration":1428,"startDelta":0},{"methodName":"isRecognized","duration":1297,"startDelta":3690},{"methodName":"identityLookup","duration":1218,"startDelta":18833},{"methodName":"getSrcProfile","duration":2548,"startDelta":41254},{"methodName":"unbindAppInstance","duration":24,"startDelta":52816}]}},
|
|
283
|
+
"userActions": [{"type":"click","target":"email","startDelta":1215},{"type":"text_type","target":"email","startDelta":1743},{"type":"click","target":"continue","startDelta":9258},{"type":"click","target":"otp","startDelta":18889.000000000004},{"type":"text_type","target":"otp","startDelta":43660},{"type":"click","target":"continue","startDelta":44120},{"type":"click","target":"continue","startDelta":50200}]
|
|
261
284
|
}
|
|
262
285
|
```
|
|
263
286
|
|