@paykit-sdk/redsys 1.0.0 → 1.2.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 +16 -16
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -38,11 +38,11 @@ export const endpoints = createEndpointHandlers(paykit);
|
|
|
38
38
|
|
|
39
39
|
## Environment Variables
|
|
40
40
|
|
|
41
|
-
| Variable
|
|
42
|
-
|
|
43
|
-
| `REDSYS_MERCHANT_CODE`
|
|
44
|
-
| `REDSYS_TERMINAL`
|
|
45
|
-
| `REDSYS_SECRET_KEY`
|
|
41
|
+
| Variable | Description |
|
|
42
|
+
| ------------------------- | ---------------------------------------------- |
|
|
43
|
+
| `REDSYS_MERCHANT_CODE` | Your Redsys merchant code |
|
|
44
|
+
| `REDSYS_TERMINAL` | Terminal number |
|
|
45
|
+
| `REDSYS_SECRET_KEY` | HMAC-SHA256 secret key from Redsys backend |
|
|
46
46
|
| `REDSYS_TRANSACTION_TYPE` | `"0"` (immediate) or `"1"` (pre-authorization) |
|
|
47
47
|
|
|
48
48
|
## Flow
|
|
@@ -58,10 +58,10 @@ export const endpoints = createEndpointHandlers(paykit);
|
|
|
58
58
|
The `createCheckout` response includes inSite parameters in metadata:
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
|
-
const checkout = await paykit.
|
|
61
|
+
const checkout = await paykit.checkouts.create(params);
|
|
62
62
|
|
|
63
63
|
// These fields from checkout.metadata are needed for inSite:
|
|
64
|
-
const {
|
|
64
|
+
const {
|
|
65
65
|
redsys_merchant_params,
|
|
66
66
|
redsys_signature,
|
|
67
67
|
redsys_signature_version,
|
|
@@ -78,19 +78,19 @@ Load the Redsys inSite script and initialize:
|
|
|
78
78
|
<script>
|
|
79
79
|
// After checkout is created:
|
|
80
80
|
getInSiteForm(
|
|
81
|
-
'card-form',
|
|
82
|
-
{},
|
|
83
|
-
{},
|
|
84
|
-
{},
|
|
85
|
-
{},
|
|
86
|
-
'Pay now',
|
|
87
|
-
callbackFunction,
|
|
81
|
+
'card-form', // container ID
|
|
82
|
+
{}, // button styles
|
|
83
|
+
{}, // body styles
|
|
84
|
+
{}, // box styles
|
|
85
|
+
{}, // input styles
|
|
86
|
+
'Pay now', // button text (HTML encoded)
|
|
87
|
+
callbackFunction, // callback with operationId
|
|
88
88
|
terminal,
|
|
89
|
-
orderId
|
|
89
|
+
orderId,
|
|
90
90
|
);
|
|
91
91
|
</script>
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
## License
|
|
95
95
|
|
|
96
|
-
MIT
|
|
96
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paykit-sdk/redsys",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Redsys inSite provider for PayKit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsup"
|
|
13
13
|
},
|
|
14
|
+
"paykit": {
|
|
15
|
+
"type": "provider"
|
|
16
|
+
},
|
|
14
17
|
"keywords": [
|
|
15
18
|
"redsys",
|
|
16
19
|
"paykit",
|
|
@@ -18,10 +21,13 @@
|
|
|
18
21
|
"typescript",
|
|
19
22
|
"insite"
|
|
20
23
|
],
|
|
21
|
-
"author": "
|
|
24
|
+
"author": "Emmanuel Odii",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"Juan Soler <https://github.com/juansoler>"
|
|
27
|
+
],
|
|
22
28
|
"license": "MIT",
|
|
23
29
|
"peerDependencies": {
|
|
24
|
-
"@paykit-sdk/core": ">=1.
|
|
30
|
+
"@paykit-sdk/core": ">=1.2.0"
|
|
25
31
|
},
|
|
26
32
|
"devDependencies": {
|
|
27
33
|
"@paykit-sdk/core": "workspace:*",
|
|
@@ -33,9 +39,9 @@
|
|
|
33
39
|
},
|
|
34
40
|
"repository": {
|
|
35
41
|
"type": "git",
|
|
36
|
-
"url": "git+https://github.com/
|
|
42
|
+
"url": "git+https://github.com/usepaykit/paykit-sdk.git"
|
|
37
43
|
},
|
|
38
44
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/
|
|
45
|
+
"url": "https://github.com/usepaykit/paykit-sdk/issues"
|
|
40
46
|
}
|
|
41
47
|
}
|