@netceterapx/click-to-pay-sdk 2.0.0-rc1.1 → 2.0.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 +14 -27
- package/dist/build/click-to-pay-sdk.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -35,9 +35,9 @@ this can be useful for local development.
|
|
|
35
35
|
- `true` Masked pan is shown on the payment button.
|
|
36
36
|
- `false` Masked pan is not shown on the payment button.
|
|
37
37
|
|
|
38
|
-
`
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
38
|
+
`buttonstyle` This prop controls whether the main button in the component is in filled or outlined state. Possible values:
|
|
39
|
+
- `FILLED` Button is in filled state.
|
|
40
|
+
- `OUTLINED` Button is in outlined state.
|
|
41
41
|
|
|
42
42
|
Note: The application starts by default in production mode.
|
|
43
43
|
|
|
@@ -57,7 +57,7 @@ clickToPay.config = {
|
|
|
57
57
|
srcInitiatorId: 'required-src-initiator-id',
|
|
58
58
|
srciDpaId: 'required-src-dpa-id',
|
|
59
59
|
encryptionKey: 'required-encryption-key',
|
|
60
|
-
|
|
60
|
+
nModulus: 'required-n-modulus',
|
|
61
61
|
},
|
|
62
62
|
amex: {
|
|
63
63
|
srcInitiatorId: 'required-src-initiator-id',
|
|
@@ -127,8 +127,8 @@ It is a required prop.
|
|
|
127
127
|
|
|
128
128
|
```js
|
|
129
129
|
clickToPay.transactionamount = {
|
|
130
|
-
amount: 10,
|
|
131
|
-
currencyCode: USD
|
|
130
|
+
amount: '10',
|
|
131
|
+
currencyCode: 'USD',
|
|
132
132
|
}
|
|
133
133
|
```
|
|
134
134
|
|
|
@@ -140,9 +140,9 @@ The SRCi component able to react to any changes of its props. That means the mer
|
|
|
140
140
|
its props, and the component will update itself accordingly.
|
|
141
141
|
|
|
142
142
|
```js
|
|
143
|
-
document.addEventListener('DOMContentLoaded',
|
|
143
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
const clickToPay = document.querySelector('click-to-pay');
|
|
146
146
|
|
|
147
147
|
clickToPay.setAttribute('isExpanded', 'false');
|
|
148
148
|
|
|
@@ -175,9 +175,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
175
175
|
});
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
`document.addEventListener('DOMContentLoaded',
|
|
178
|
+
`document.addEventListener('DOMContentLoaded', () => {...});` It's recommended to initialize/update any properties after the component is fully initialized.
|
|
179
179
|
|
|
180
|
-
`
|
|
180
|
+
`const clickToPay = document.querySelector('click-to-pay');` The merchant can get a reference to the SRCi component.
|
|
181
181
|
|
|
182
182
|
`clickToPay.setAttribute('isExpanded', 'false');` Then, the merchant is able to modify any prop for the component, when
|
|
183
183
|
that happens the component reacts.
|
|
@@ -229,9 +229,9 @@ You can hide the UI with the `isExpanded` props.
|
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
```js
|
|
232
|
-
document.addEventListener('DOMContentLoaded',
|
|
232
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
const clickToPay = document.querySelector('click-to-pay');
|
|
235
235
|
|
|
236
236
|
clickToPay.config = {
|
|
237
237
|
// ...
|
|
@@ -241,7 +241,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
241
241
|
let checkoutButton = document.querySelector('#checkout-button');
|
|
242
242
|
|
|
243
243
|
// .then().catch() are also compatible.
|
|
244
|
-
checkoutButton.onclick = async
|
|
244
|
+
checkoutButton.onclick = async () => {
|
|
245
245
|
try {
|
|
246
246
|
let response = await clickToPay.checkout({
|
|
247
247
|
card: {
|
|
@@ -336,23 +336,10 @@ The modal can be closed by:
|
|
|
336
336
|
|
|
337
337
|
```js
|
|
338
338
|
document.addEventListener('DOMContentLoaded', () => {
|
|
339
|
-
|
|
339
|
+
const clickToPay = document.querySelector('click-to-pay');
|
|
340
340
|
|
|
341
341
|
clickToPay.displayClickToPayExplanationModal();
|
|
342
342
|
});
|
|
343
343
|
```
|
|
344
344
|
|
|
345
345
|
The Click to Pay explanation modal is following the UX guidelines of the schemes.
|
|
346
|
-
|
|
347
|
-
### Styling
|
|
348
|
-
|
|
349
|
-
There are multiple class names, and an id spread throughout the components of the SRCi.
|
|
350
|
-
These can be used as hooks to override / add styling as necessary.
|
|
351
|
-
|
|
352
|
-
`click-to-pay` This id is the top most HTML element which the SRCi mounts on.
|
|
353
|
-
|
|
354
|
-
`click-to-pay--main` This class wraps the main attribute. It's a container that wraps all sub-components and also contains the DCF window if chosen to do so.
|
|
355
|
-
|
|
356
|
-
`click-to-pay--spinner-container` This class wraps the spinner. This can be used to manipulate the spinner as to fit your specific styling requirements.
|
|
357
|
-
|
|
358
|
-
`click-to-pay--component-container` This class wraps every component that is currently active.
|