razorpay 3.0.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/CHANGELOG.md +17 -0
  4. data/README.md +6 -0
  5. data/documents/account.md +449 -0
  6. data/documents/card.md +45 -0
  7. data/documents/generic.md +150 -0
  8. data/documents/payment.md +44 -1
  9. data/documents/productConfiguration.md +444 -0
  10. data/documents/stakeholder.md +334 -0
  11. data/documents/tokens.md +146 -1
  12. data/documents/webhook.md +224 -0
  13. data/lib/razorpay/account.rb +39 -0
  14. data/lib/razorpay/addon.rb +1 -1
  15. data/lib/razorpay/card.rb +4 -0
  16. data/lib/razorpay/constants.rb +28 -2
  17. data/lib/razorpay/generic.rb +39 -0
  18. data/lib/razorpay/iin.rb +15 -0
  19. data/lib/razorpay/order.rb +1 -1
  20. data/lib/razorpay/product.rb +37 -0
  21. data/lib/razorpay/request.rb +22 -16
  22. data/lib/razorpay/stakeholder.rb +39 -0
  23. data/lib/razorpay/token.rb +28 -0
  24. data/lib/razorpay/virtual_account.rb +1 -1
  25. data/lib/razorpay/webhook.rb +50 -0
  26. data/lib/razorpay.rb +7 -0
  27. data/test/fixtures/fake_account.json +78 -0
  28. data/test/fixtures/fake_card_reference.json +5 -0
  29. data/test/fixtures/fake_iin_token.json +23 -0
  30. data/test/fixtures/fake_product.json +138 -0
  31. data/test/fixtures/fake_stakeholder.json +29 -0
  32. data/test/fixtures/fake_tokenise_customer.json +40 -0
  33. data/test/fixtures/fake_webhook.json +79 -0
  34. data/test/fixtures/fake_webhook_by_account_id.json +22 -0
  35. data/test/fixtures/fetch_tnc.json +11 -0
  36. data/test/fixtures/stakeholder_collection.json +35 -0
  37. data/test/fixtures/webhook_by_account_collection.json +35 -0
  38. data/test/fixtures/webhook_collection.json +85 -0
  39. data/test/razorpay/test_account.rb +134 -0
  40. data/test/razorpay/test_card.rb +6 -0
  41. data/test/razorpay/test_customer.rb +8 -8
  42. data/test/razorpay/test_generic.rb +112 -0
  43. data/test/razorpay/test_iin.rb +23 -0
  44. data/test/razorpay/test_order.rb +1 -1
  45. data/test/razorpay/test_product.rb +67 -0
  46. data/test/razorpay/test_settlement.rb +1 -1
  47. data/test/razorpay/test_stakeholder.rb +87 -0
  48. data/test/razorpay/test_token.rb +66 -0
  49. data/test/razorpay/test_transfer.rb +1 -1
  50. data/test/razorpay/test_webhook.rb +132 -0
  51. metadata +52 -2
@@ -0,0 +1,150 @@
1
+ ## Generic Access point
2
+
3
+
4
+ ```rb
5
+ Razorpay.setup('key_id', 'key_secret')
6
+ ```
7
+
8
+ ### Method Signature
9
+ ```rb
10
+ Razorpay::Generic.new(entity).do(url, method, payload, version)
11
+ ```
12
+
13
+ **Parameters:**
14
+
15
+ | Name | Type | Description |
16
+ |---------------|-------------|---------------------------------------------|
17
+ | entity* | string | The endpoint to which the request will be made. (e.g., "contacts" or "accounts") |
18
+ | url* | string | Add params or query or query (e.g., "/order_000000000000001" or "?count=1") |
19
+ | method* | string | The HTTP method for the request (e.g., 'Get', 'Post', 'Put', 'Patch', 'Delete'). |
20
+ | payload | object | The data to be sent with the request.|
21
+ | version | string | Add version (e.g., "v1" or "v2") |
22
+
23
+ -------------------------------------------------------------------------------------------------------
24
+
25
+ ### Create a contacts using POST
26
+
27
+ ```rb
28
+
29
+ payload = {
30
+ "name": "Gaurav Kumar",
31
+ "email": "gaurav.kumar@example.com",
32
+ "contact": "9123456789",
33
+ "type": "employee",
34
+ "reference_id":"Acme Contact ID 12345",
35
+ "notes": {
36
+ "notes_key_1":"Tea, Earl Grey, Hot",
37
+ "notes_key_2":"Tea, Earl Grey… decaf.",
38
+ },
39
+ }
40
+
41
+ Razorpay::Generic.new("contacts").do("/", "Post", payload)
42
+ ```
43
+
44
+ **Response:**
45
+
46
+ ```json
47
+ {
48
+ "id": "cont_00000000000001",
49
+ "entity": "contact",
50
+ "name": "Gaurav Kumar",
51
+ "contact": "9123456789",
52
+ "email": "gaurav.kumar@example.com",
53
+ "type": "employee",
54
+ "reference_id": "Acme Contact ID 12345",
55
+ "batch_id": null,
56
+ "active": true,
57
+ "notes": {
58
+ "notes_key_1": "Tea, Earl Grey, Hot",
59
+ "notes_key_2": "Tea, Earl Grey… decaf."
60
+ },
61
+ "created_at": 1545320320
62
+ }
63
+ ```
64
+
65
+ -------------------------------------------------------------------------------------------------------
66
+
67
+ ### Fetch an order using GET
68
+
69
+ ```rb
70
+ Razorpay::Generic.new("orders").do("/order_00000000000001", "Get", {})
71
+ ```
72
+
73
+ **Response:**
74
+
75
+ ```json
76
+ {
77
+ "amount": 307,
78
+ "amount_due": 0,
79
+ "amount_paid": 307,
80
+ "attempts": 1,
81
+ "created_at": 1695625101,
82
+ "currency": "INR",
83
+ "entity": "order",
84
+ "id": "order_00000000000001",
85
+ "notes": [],
86
+ "offer_id": null,
87
+ "receipt": "851617",
88
+ "status": "paid"
89
+ }
90
+ ```
91
+
92
+ -------------------------------------------------------------------------------------------------------
93
+
94
+ ### Fetch payments of a linked account using headers
95
+
96
+ ```rb
97
+ Razorpay.headers = {"X-Razorpay-Account" => "acc_00000000000001"}
98
+
99
+ Razorpay::Generic.new("payments").do("/pay_00000000000001", "Get", {})
100
+ ```
101
+
102
+ **Response:**
103
+
104
+ ```json
105
+ {
106
+ "entity": "collection",
107
+ "count": 2,
108
+ "items": [
109
+ {
110
+ "id": "pay_00000000000001",
111
+ "entity": "payment",
112
+ "amount": 10000,
113
+ "currency": "INR",
114
+ "status": "captured",
115
+ "order_id": "order_00000000000001",
116
+ "invoice_id": null,
117
+ "international": false,
118
+ "method": "netbanking",
119
+ "amount_refunded": 0,
120
+ "refund_status": null,
121
+ "captured": true,
122
+ "description": "#JJCqaOhFihfkVE",
123
+ "card_id": null,
124
+ "bank": "YESB",
125
+ "wallet": null,
126
+ "vpa": null,
127
+ "email": "john.example@example.com",
128
+ "contact": "9999999999",
129
+ "notes": [],
130
+ "fee": 236,
131
+ "tax": 36,
132
+ "error_code": null,
133
+ "error_description": null,
134
+ "error_source": null,
135
+ "error_step": null,
136
+ "error_reason": null,
137
+ "acquirer_data": {
138
+ "bank_transaction_id": "2118867"
139
+ },
140
+ "created_at": 1649932775
141
+ }
142
+ ]
143
+ }
144
+ ```
145
+
146
+ -------------------------------------------------------------------------------------------------------
147
+
148
+ **PN: * indicates mandatory fields**
149
+ <br>
150
+ <br>
data/documents/payment.md CHANGED
@@ -816,10 +816,53 @@ Razorpay::PaymentMethods.all()
816
816
  **Response:** <br>
817
817
  please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/methods-api/#fetch-payment-methods) for response
818
818
 
819
- ```
819
+
820
820
  -------------------------------------------------------------------------------------------------------
821
821
 
822
+ ### Token IIN API
823
+
824
+ ```rb
825
+ tokenIin = "412345";
826
+
827
+ Razorpay::Iin.fetch(tokenIin);
828
+ ```
829
+
830
+ **Parameters:**
831
+
832
+ | Name | Type | Description |
833
+ |------------|--------|-----------------------------------|
834
+ | tokenIin* | string | The token IIN. |
822
835
 
836
+ **Response:**
837
+ ```json
838
+ {
839
+ "iin": "412345",
840
+ "entity": "iin",
841
+ "network": "Visa",
842
+ "type": "credit",
843
+ "sub_type": "business",
844
+ "issuer_code": "HDFC",
845
+ "issuer_name": "HDFC Bank Ltd",
846
+ "international": false,
847
+ "is_tokenized": true,
848
+ "card_iin": "411111",
849
+ "emi":{
850
+ "available": true
851
+ },
852
+ "recurring": {
853
+ "available": true
854
+ },
855
+ "authentication_types": [
856
+ {
857
+ "type":"3ds"
858
+ },
859
+ {
860
+ "type":"otp"
861
+ }
862
+ ]
863
+ }
864
+ ```
865
+ -------------------------------------------------------------------------------------------------------
823
866
  **PN: * indicates mandatory fields**
824
867
  <br>
825
868
  <br>
@@ -0,0 +1,444 @@
1
+ ## Product Configuration
2
+
3
+ ### Request a Product Configuration
4
+ ```rb
5
+
6
+ accountId = "acc_GP4lfNA0iIMn5B"
7
+
8
+ Razorpay::Product.request_product_configuration(accountId, {
9
+ "product_name": "payment_gateway",
10
+ "tnc_accepted": true,
11
+ "ip": "233.233.233.234"
12
+ })
13
+ ```
14
+
15
+ **Parameters:**
16
+
17
+ | Name | Type | Description |
18
+ |---------------|-------------|---------------------------------------------|
19
+ | product_name* | string | The product(s) to be configured. Possible value is `payment_gateway`, `payment_links` |
20
+ | tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible values is `true` |
21
+ | ip | integer | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the `tnc_accepted` parameter when the `tnc` is accepted. |
22
+
23
+ **Response:**
24
+ ```json
25
+ {
26
+ "requested_configuration": {
27
+ "payment_methods": []
28
+ },
29
+ "active_configuration": {
30
+ "payment_capture": {
31
+ "mode": "automatic",
32
+ "refund_speed": "normal",
33
+ "automatic_expiry_period": 7200
34
+ },
35
+ "settlements": {
36
+ "account_number": null,
37
+ "ifsc_code": null,
38
+ "beneficiary_name": null
39
+ },
40
+ "checkout": {
41
+ "theme_color": "#FFFFFF",
42
+ "flash_checkout": true,
43
+ "logo": "https://example.com/your_logo"
44
+ },
45
+ "refund": {
46
+ "default_refund_speed": "normal"
47
+ },
48
+ "notifications": {
49
+ "whatsapp": true,
50
+ "sms": false,
51
+ "email": [
52
+ "b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
53
+ ]
54
+ },
55
+ "payment_methods": {
56
+ "netbanking": {
57
+ "enabled": true,
58
+ "instrument": [
59
+ {
60
+ "type": "retail",
61
+ "bank": [
62
+ "hdfc",
63
+ "sbin",
64
+ "utib",
65
+ "icic",
66
+ "scbl",
67
+ "yesb"
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "wallet": {
73
+ "enabled": true,
74
+ "instrument": [
75
+ "airtelmoney",
76
+ "freecharge",
77
+ "jiomoney",
78
+ "olamoney",
79
+ "payzapp",
80
+ "mobikwik"
81
+ ]
82
+ },
83
+ "upi": {
84
+ "enabled": true,
85
+ "instrument": [
86
+ "upi"
87
+ ]
88
+ }
89
+ }
90
+ },
91
+ "requirements": [
92
+ {
93
+ "field_reference": "individual_proof_of_address",
94
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
95
+ "status": "required",
96
+ "reason_code": "document_missing"
97
+ },
98
+ {
99
+ "field_reference": "individual_proof_of_identification",
100
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
101
+ "status": "required",
102
+ "reason_code": "document_missing"
103
+ },
104
+ {
105
+ "field_reference": "business_proof_of_identification",
106
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
107
+ "status": "required",
108
+ "reason_code": "document_missing"
109
+ },
110
+ {
111
+ "field_reference": "settlements.beneficiary_name",
112
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
113
+ "status": "required",
114
+ "reason_code": "field_missing"
115
+ },
116
+ {
117
+ "field_reference": "settlements.account_number",
118
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
119
+ "status": "required",
120
+ "reason_code": "field_missing"
121
+ },
122
+ {
123
+ "field_reference": "settlements.ifsc_code",
124
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
125
+ "status": "required",
126
+ "reason_code": "field_missing"
127
+ },
128
+ {
129
+ "field_reference": "contact_name",
130
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
131
+ "status": "required",
132
+ "reason_code": "field_missing"
133
+ },
134
+ {
135
+ "field_reference": "name",
136
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
137
+ "status": "required",
138
+ "reason_code": "field_missing"
139
+ },
140
+ {
141
+ "field_reference": "customer_facing_business_name",
142
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
143
+ "status": "required",
144
+ "reason_code": "field_missing"
145
+ },
146
+ {
147
+ "field_reference": "kyc.pan",
148
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
149
+ "status": "required",
150
+ "reason_code": "field_missing"
151
+ }
152
+ ],
153
+ "tnc":{
154
+ "id": "tnc_IgohZaDBHRGjPv",
155
+ "accepted": true,
156
+ "accepted_at": 1641550798
157
+ },
158
+ "id": "acc_prd_HEgNpywUFctQ9e",
159
+ "account_id": "acc_HQVlm3bnPmccC0",
160
+ "product_name": "payment_gateway",
161
+ "activation_status": "needs_clarification",
162
+ "requested_at": 162547884
163
+ }
164
+ ```
165
+
166
+ -------------------------------------------------------------------------------------------------------
167
+
168
+ ### Edit a Product Configuration
169
+ ```rb
170
+ accountId = "acc_GP4lfNA0iIMn5B"
171
+ productId = "acc_prd_HEgNpywUFctQ9e"
172
+
173
+ Razorpay::Product.edit(accountId, productId, {
174
+ "notifications": {
175
+ "email": [
176
+ "gaurav.kumar@example.com",
177
+ "acd@gmail.com"
178
+ ]
179
+ },
180
+ "checkout": {
181
+ "theme_color": "#528FFF"
182
+ },
183
+ "refund": {
184
+ "default_refund_speed": "optimum"
185
+ },
186
+ "settlements": {
187
+ "account_number": "1234567890",
188
+ "ifsc_code": "HDFC0000317",
189
+ "beneficiary_name": "Gaurav Kumar"
190
+ },
191
+ "tnc_accepted": 1,
192
+ "ip": "233.233.233.234"
193
+ })
194
+ ```
195
+
196
+ **Parameters:**
197
+
198
+ | Name | Type | Description |
199
+ |---------------|-------------|---------------------------------------------|
200
+ | notifications | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
201
+ | checkout | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
202
+ | refund | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
203
+ | settlements | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
204
+ | tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible value is `true` |
205
+ | ip | string | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the tnc_accepted parameter when the `tnc` is accepted. |
206
+ | payment_methods | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
207
+ | type | string | Possible value is `domestic` |
208
+ | issuer | string | The card issuer. Possible values for issuer are `amex`, `dicl`, `maestro`, `mastercard`, `rupay`, `visa`. |
209
+ | wallet | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
210
+ | instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
211
+ | instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
212
+ | upi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
213
+ | instrument(upi) | string | The UPI service provider. Possible values are `google_pay`, `upi`|
214
+ | paylater | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
215
+ | instrument(emi) | string | The Paylater service provider. Possible values are `epaylater`, `getsimpl`|
216
+ | emi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
217
+
218
+ **Response:**
219
+ ```json
220
+ {
221
+ "id": "acc_GP4lfNA0iIMn5B",
222
+ "type": "standard",
223
+ "status": "created",
224
+ "email": "gauri@example.org",
225
+ "profile": {
226
+ "category": "healthcare",
227
+ "subcategory": "clinic",
228
+ "addresses": {
229
+ "registered": {
230
+ "street1": "507, Koramangala 1st block",
231
+ "street2": "MG Road-1",
232
+ "city": "Bengalore",
233
+ "state": "KARNATAKA",
234
+ "postal_code": "560034",
235
+ "country": "IN"
236
+ }
237
+ }
238
+ },
239
+ "notes": [],
240
+ "created_at": 1610603081,
241
+ "phone": "9000090000",
242
+ "reference_id": "randomId",
243
+ "business_type": "partnership",
244
+ "legal_business_name": "Acme Corp",
245
+ "customer_facing_business_name": "ABCD Ltd"
246
+ }
247
+ ```
248
+ -------------------------------------------------------------------------------------------------------
249
+
250
+ ### Fetch a product configuration
251
+ ```rb
252
+ accountId = "acc_GP4lfNA0iIMn5B"
253
+
254
+ productId = "acc_prd_HEgNpywUFctQ9e"
255
+
256
+ Razorpay::Product.fetch(accountId, productId)
257
+ ```
258
+
259
+ **Parameters:**
260
+
261
+ | Name | Type | Description |
262
+ |-------------|-------------|---------------------------------------------|
263
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
264
+ | productId* | string | The unique identifier of a product generated by Razorpay. |
265
+
266
+ **Response:**
267
+ ```json
268
+ {
269
+ "requested_configuration": {
270
+ "payment_methods": []
271
+ },
272
+ "active_configuration": {
273
+ "payment_capture": {
274
+ "mode": "automatic",
275
+ "refund_speed": "normal",
276
+ "automatic_expiry_period": 7200
277
+ },
278
+ "settlements": {
279
+ "account_number": null,
280
+ "ifsc_code": null,
281
+ "beneficiary_name": null
282
+ },
283
+ "checkout": {
284
+ "theme_color": "#FFFFFF",
285
+ "flash_checkout": true
286
+ },
287
+ "refund": {
288
+ "default_refund_speed": "normal"
289
+ },
290
+ "notifications": {
291
+ "whatsapp": true,
292
+ "sms": false,
293
+ "email": [
294
+ "b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
295
+ ]
296
+ },
297
+ "payment_methods": {
298
+ "netbanking": {
299
+ "enabled": true,
300
+ "instrument": [
301
+ {
302
+ "type": "retail",
303
+ "bank": [
304
+ "hdfc",
305
+ "sbin",
306
+ "utib",
307
+ "icic",
308
+ "scbl",
309
+ "yesb"
310
+ ]
311
+ }
312
+ ]
313
+ },
314
+ "wallet": {
315
+ "enabled": true,
316
+ "instrument": [
317
+ "airtelmoney",
318
+ "freecharge",
319
+ "jiomoney",
320
+ "olamoney",
321
+ "payzapp",
322
+ "mobikwik"
323
+ ]
324
+ },
325
+ "upi": {
326
+ "enabled": true,
327
+ "instrument": [
328
+ "upi"
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ "requirements": [
334
+ {
335
+ "field_reference": "individual_proof_of_address",
336
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
337
+ "status": "required",
338
+ "reason_code": "document_missing"
339
+ },
340
+ {
341
+ "field_reference": "individual_proof_of_identification",
342
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
343
+ "status": "required",
344
+ "reason_code": "document_missing"
345
+ },
346
+ {
347
+ "field_reference": "business_proof_of_identification",
348
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
349
+ "status": "required",
350
+ "reason_code": "document_missing"
351
+ },
352
+ {
353
+ "field_reference": "settlements.beneficiary_name",
354
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
355
+ "status": "required",
356
+ "reason_code": "field_missing"
357
+ },
358
+ {
359
+ "field_reference": "settlements.account_number",
360
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
361
+ "status": "required",
362
+ "reason_code": "field_missing"
363
+ },
364
+ {
365
+ "field_reference": "settlements.ifsc_code",
366
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
367
+ "status": "required",
368
+ "reason_code": "field_missing"
369
+ },
370
+ {
371
+ "field_reference": "contact_name",
372
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
373
+ "status": "required",
374
+ "reason_code": "field_missing"
375
+ },
376
+ {
377
+ "field_reference": "name",
378
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
379
+ "status": "required",
380
+ "reason_code": "field_missing"
381
+ },
382
+ {
383
+ "field_reference": "customer_facing_business_name",
384
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
385
+ "status": "required",
386
+ "reason_code": "field_missing"
387
+ },
388
+ {
389
+ "field_reference": "kyc.pan",
390
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
391
+ "status": "required",
392
+ "reason_code": "field_missing"
393
+ }
394
+ ],
395
+ "tnc":{
396
+ "id": "tnc_IgohZaDBHRGjPv",
397
+ "accepted": true,
398
+ "accepted_at": 1641550798
399
+ },
400
+ "id": "acc_prd_HEgNpywUFctQ9e",
401
+ "account_id": "acc_HQVlm3bnPmccC0",
402
+ "product_name": "payment_gateway",
403
+ "activation_status": "needs_clarification",
404
+ "requested_at": 1625478849
405
+ }
406
+ ```
407
+
408
+ -------------------------------------------------------------------------------------------------------
409
+
410
+ ### Fetch Terms and Conditions for a Sub-Merchant
411
+ ```rb
412
+
413
+ productName = "payments"
414
+
415
+ Razorpay::Product.fetch_tnc(productName)
416
+ ```
417
+
418
+ **Parameters:**
419
+
420
+ | Name | Type | Description |
421
+ |-------------|-------------|---------------------------------------------|
422
+ | productName* | string | The product family for which the relevant product to be requested for the sub-merchant. Possible value is `payments` |
423
+
424
+ **Response:**
425
+ ```json
426
+ {
427
+ "entity": "tnc_map",
428
+ "product_name": "payments",
429
+ "id": "tnc_map_HjOVhIdpVDZ0FB",
430
+ "tnc": {
431
+ "terms": "https://razorpay.com/terms",
432
+ "privacy": "https://razorpay.com/privacy",
433
+ "agreement": "https://razorpay.com/agreement"
434
+ },
435
+ "last_published_at": 1640589653
436
+ }
437
+ ```
438
+
439
+ -------------------------------------------------------------------------------------------------------
440
+
441
+ **PN: * indicates mandatory fields**
442
+ <br>
443
+ <br>
444
+ **For reference click [here](https://razorpay.com/docs/api/partners/product-configuration/)**