-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathhyperswitch-card-vault.postman_collection.json
More file actions
255 lines (255 loc) · 6.99 KB
/
Copy pathhyperswitch-card-vault.postman_collection.json
File metadata and controls
255 lines (255 loc) · 6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
{
"info": {
"_postman_id": "c4ca9eca-2446-4011-bab0-dc0813ff737e",
"name": "Hyperswitch Card Vault",
"description": "The is the API collection to test the card vault.\n\nIf you are newly deploying the card vault application, by using the docker images available here [juspaydotin/hyperswitch-card-vault](). You be required to unlock the locker using the key custodian API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "23503638"
},
"item": [
{
"name": "Key Custodian",
"item": [
{
"name": "Key 1",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"key\": \"{{key1}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/custodian/key1",
"host": [
"{{base_url}}"
],
"path": [
"custodian",
"key1"
]
}
},
"response": []
},
{
"name": "Key 2",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"key\": \"{{key2}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/custodian/key2",
"host": [
"{{base_url}}"
],
"path": [
"custodian",
"key2"
]
}
},
"response": []
},
{
"name": "Decrypt",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/custodian/decrypt",
"host": [
"{{base_url}}"
],
"path": [
"custodian",
"decrypt"
]
}
},
"response": []
}
],
"description": "The folder consists of 3 requests\n\n- Provide Key1: Providing the key1 to the locker\n- Provide Key2: Providing the key2 to the locker\n- Decrypt: After providing the keys, call this to unlock the locker"
},
{
"name": "Cards API",
"item": [
{
"name": "Add Card",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"merchant_id\": \"test-merchant\",\n \"merchant_customer_id\": \"test-customer\",\n \"card\": {\n \"card_number\": \"4242424242424242\",\n \"name_on_card\": \"John Smith4\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/data/add",
"host": [
"{{base_url}}"
],
"path": [
"data",
"add"
]
}
},
"response": []
},
{
"name": "Retrieve Card",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"merchant_id\": \"test-merchant\",\n \"merchant_customer_id\": \"test-customer\",\n \"card_reference\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/data/retrieve",
"host": [
"{{base_url}}"
],
"path": [
"data",
"retrieve"
]
}
},
"response": []
},
{
"name": "Delete Card",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"merchant_id\": \"test-merchant\",\n \"merchant_customer_id\": \"test-customer\",\n \"card_reference\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/data/delete",
"host": [
"{{base_url}}"
],
"path": [
"data",
"delete"
]
}
},
"response": []
}
],
"description": "This API is encrypted using `JWE + JWS` for end-to-end encryption with the application. To test this API, you need to encrypt the json payload using the locker public key and hyperswitch private key for signing.\n\n---\n\n### Prerequisites\n\nYou need to use the utility provided with the application, to install that utility you can run the following command\n`cargo install --git https://github.com/juspay/hyperswitch-card-vault --bin utils --root .`\nYou would also need the hyperswitch(tenant) private key and locker public key, while encrypting the payload\n(in the steps below, I am assuming that these keys are saved as `tenant-private-key.pem` and `locker-public-key.pem`)\n \n---\n\nYou can follow the below mentioned steps to encrypt and decrypt the payloads as required\n\nYou would also need the hyperswitch(tenant) private key and locker public key, while encrypting the payload.\n(in the steps below, I am assuming that these keys are saved as \\`tenant-private-key.pem\\` and \\`locker-public-key.pem\\`)\n\n1. To encrypt the payload call the utility \n `./bin/utils jwe-encrypt --priv tenant-private-key.pem --pub locker-public-key.pem` \n then paste the payload and close the buffer using `ctrl+d`\n2. You can use the output of this command as the body for the request.\n3. The output will also be JWE + JWS encrypted, you we can use the utility again to decrypt it. \n `./bin/utils jwe-decrypt --priv tenant-private-key.pem --pub locker-public-key.pem` \n then paste the response received and close the buffer using `ctrl+d`"
},
{
"name": "Fingerprint API",
"item": [
{
"name": "Fingerprint",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"card\": {\n \"card_number\": \"4242424242424242\"\n },\n \"hash_key\": \"123\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{base_url}}/cards/fingerprint",
"host": [
"{{base_url}}"
],
"path": [
"cards",
"fingerprint"
]
}
},
"response": []
}
],
"description": "This fold consists of the fingerprint API, this API is used to fingerprint cards for global uniqueness. For a specific merchant. This receives the card details perform HMAC hashing with the provided merchant key. Stores the hash and returns a unique nanoid key that is attached to the hash."
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "base_url",
"value": "http://localhost:8080",
"type": "string"
},
{
"key": "key1",
"value": "",
"type": "string"
},
{
"key": "key2",
"value": "",
"type": "string"
}
]
}