razorpay 3.0.0 → 3.1.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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +8 -0
  3. data/.github/workflows/ci.yml +79 -0
  4. data/CHANGELOG.md +21 -0
  5. data/README.md +5 -1
  6. data/documents/Invoice.md +11 -3
  7. data/documents/account.md +449 -0
  8. data/documents/addon.md +23 -1
  9. data/documents/card.md +73 -29
  10. data/documents/customer.md +2 -0
  11. data/documents/emandate.md +20 -12
  12. data/documents/fund.md +19 -17
  13. data/documents/items.md +65 -41
  14. data/documents/order.md +51 -0
  15. data/documents/papernach.md +40 -20
  16. data/documents/payment.md +247 -14
  17. data/documents/paymentLink.md +37 -19
  18. data/documents/plan.md +3 -3
  19. data/documents/productConfiguration.md +444 -0
  20. data/documents/qrcode.md +17 -19
  21. data/documents/refund.md +11 -10
  22. data/documents/registerEmandate.md +25 -18
  23. data/documents/registerNach.md +49 -57
  24. data/documents/settlement.md +1 -0
  25. data/documents/stakeholder.md +334 -0
  26. data/documents/subscriptions.md +3 -1
  27. data/documents/tokens.md +201 -2
  28. data/documents/transfers.md +292 -195
  29. data/documents/upi.md +25 -28
  30. data/documents/virtualAccount.md +18 -13
  31. data/documents/webhook.md +224 -0
  32. data/lib/razorpay/account.rb +39 -0
  33. data/lib/razorpay/addon.rb +5 -1
  34. data/lib/razorpay/card.rb +4 -0
  35. data/lib/razorpay/constants.rb +2 -2
  36. data/lib/razorpay/iin.rb +15 -0
  37. data/lib/razorpay/order.rb +1 -1
  38. data/lib/razorpay/payment.rb +8 -0
  39. data/lib/razorpay/payment_method.rb +17 -0
  40. data/lib/razorpay/product.rb +37 -0
  41. data/lib/razorpay/request.rb +16 -16
  42. data/lib/razorpay/stakeholder.rb +39 -0
  43. data/lib/razorpay/token.rb +28 -0
  44. data/lib/razorpay/virtual_account.rb +1 -1
  45. data/lib/razorpay/webhook.rb +50 -0
  46. data/lib/razorpay.rb +7 -0
  47. data/razorpay-ruby.gemspec +2 -1
  48. data/test/fixtures/fake_account.json +78 -0
  49. data/test/fixtures/fake_card_reference.json +5 -0
  50. data/test/fixtures/fake_create_upi_payment.json +3 -0
  51. data/test/fixtures/fake_iin_token.json +23 -0
  52. data/test/fixtures/fake_product.json +138 -0
  53. data/test/fixtures/fake_stakeholder.json +29 -0
  54. data/test/fixtures/fake_tokenise_customer.json +40 -0
  55. data/test/fixtures/fake_validate_vpa.json +5 -0
  56. data/test/fixtures/fake_webhook.json +79 -0
  57. data/test/fixtures/fake_webhook_by_account_id.json +22 -0
  58. data/test/fixtures/fetch_tnc.json +11 -0
  59. data/test/fixtures/payment_methods_collection.json +149 -0
  60. data/test/fixtures/stakeholder_collection.json +35 -0
  61. data/test/fixtures/webhook_by_account_collection.json +35 -0
  62. data/test/fixtures/webhook_collection.json +85 -0
  63. data/test/razorpay/test_account.rb +134 -0
  64. data/test/razorpay/test_addon.rb +6 -2
  65. data/test/razorpay/test_card.rb +6 -0
  66. data/test/razorpay/test_customer.rb +8 -8
  67. data/test/razorpay/test_iin.rb +23 -0
  68. data/test/razorpay/test_order.rb +1 -1
  69. data/test/razorpay/test_payment.rb +46 -2
  70. data/test/razorpay/test_product.rb +67 -0
  71. data/test/razorpay/test_settlement.rb +1 -1
  72. data/test/razorpay/test_stakeholder.rb +87 -0
  73. data/test/razorpay/test_token.rb +66 -0
  74. data/test/razorpay/test_transfer.rb +1 -1
  75. data/test/razorpay/test_webhook.rb +132 -0
  76. data/test/test_helper.rb +2 -0
  77. metadata +76 -7
@@ -6,8 +6,7 @@ para_attr = {
6
6
  "name": "Gaurav Kumar",
7
7
  "contact": 9123456780,
8
8
  "email": "gaurav.kumar@example.com",
9
- "fail_existing": 0,
10
- "gstin": "29XAbbA4369J1PA",
9
+ "fail_existing": "0",
11
10
  "notes": {
12
11
  "notes_key_1": "Tea, Earl Grey, Hot",
13
12
  "notes_key_2": "Tea, Earl Grey… decaf."
@@ -48,30 +47,31 @@ Razorpay::Customer.create(para_attr)
48
47
 
49
48
  ```rb
50
49
  para_attr = {
51
- "amount": 100,
50
+ "amount":0,
52
51
  "currency": "INR",
53
52
  "method": "nach",
54
- "receipt": "Receipt No. 5",
53
+ "customer_id": "cust_1Aa00000000001",
54
+ "receipt": "Receipt No. 1",
55
55
  "notes": {
56
- "note_key 1": "Beam me up Scotty",
57
- "note_key 2": "Tea. Earl Gray. Hot."
56
+ "notes_key_1": "Beam me up Scotty",
57
+ "notes_key_2": "Engage"
58
58
  },
59
- "token": {
59
+ "token":{
60
60
  "first_payment_amount": 10000,
61
61
  "auth_type": "physical",
62
- "max_amount": 50000,
63
- "expire_at": 1634215992,
62
+ "max_amount":10000000,
63
+ "expire_at":1580480689,
64
64
  "notes": {
65
- "note_key 1": "Tea, Earl Grey decaf.",
66
- "note_key 2": "Tea. Earl Gray. Hot."
65
+ "notes_key_1": "Tea, Earl Grey, Hot",
66
+ "notes_key_2": "Tea, Earl Grey… decaf."
67
67
  },
68
- "bank_account": {
68
+ "bank_account":{
69
+ "account_number": "11214311215411",
70
+ "ifsc_code": "HDFC0000001",
69
71
  "beneficiary_name": "Gaurav Kumar",
70
- "account_number": 11214311215411,
71
- "account_type": "savings",
72
- "ifsc_code": "HDFC0001233"
72
+ "account_type": "savings"
73
73
  },
74
- "nach": {
74
+ "nach":{
75
75
  "form_reference1": "Recurring Payment for Gaurav Kumar",
76
76
  "form_reference2": "Method Paper NACH",
77
77
  "description": "Paper NACH Gaurav Kumar"
@@ -85,22 +85,12 @@ Razorpay.Order.create(para_attr)
85
85
 
86
86
  | Name | Type | Description |
87
87
  |-----------------|---------|------------------------------------------------------------------------------|
88
- | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
88
+ | amount* | integer | Amount in currency subunits. For Paper NACH, the amount has to be `0` |
89
89
  | currency* | string | The currency of the payment (defaults to INR) |
90
90
  | customerId* | string | The id of the customer to be fetched |
91
91
  | method* | string | Payment method used to make the registration transaction. Possible value is `nach`. |
92
92
  | receipt | string | Your system order reference id. |
93
- | token.auth_type* | string | Possible value is `physical`|
94
- | token.max_amount | integer | Use to set the maximum amount per debit request. The value can range from `500` - `1000000000` (1cr, default value) |
95
- | token.expire_at | integer | The timestamp, in Unix format, till when the registration link should expire |
96
- | token.notes | object | A key-value pair |
97
- | bank.account_number* | string | Customer's bank account number. |
98
- | bank.ifsc_code* | string | Customer's bank IFSC |
99
- | bank.beneficiary_name* | string | Customer's name |
100
- | bank.account_type* | string | Customer's bank account. Possible value is `saving`(default), `current`, `cc`, `nre`, `nro` |
101
- | nach.form_reference1 | string | A user-entered reference that appears on the NACH form |
102
- | nach.form_reference2 | string | A user-entered reference that appears on the NACH form |
103
- | nach.description | string | All keys listed |
93
+ | token | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported |
104
94
  | notes | object | A key-value pair |
105
95
 
106
96
  **Response:**
@@ -171,37 +161,36 @@ Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-n
171
161
 
172
162
  ```rb
173
163
  para_attr = {
174
- "customer": {
164
+ "customer":{
175
165
  "name": "Gaurav Kumar",
176
166
  "email": "gaurav.kumar@example.com",
177
- "contact": 9123456780
167
+ "contact": "9123456780"
178
168
  },
179
- "amount": 100,
180
- "type": "link",
169
+ "amount":0,
181
170
  "currency": "INR",
182
- "description": "Registration Link for Gaurav Kumar",
183
- "subscription_registration": {
184
- "first_payment_amount": 100,
171
+ "type": "link",
172
+ "description": "12 p.m. Meals",
173
+ "subscription_registration":{
185
174
  "method": "nach",
186
175
  "auth_type": "physical",
187
- "max_amount": 50000,
188
- "expire_at": 1634215992,
189
- "bank_account": {
176
+ "bank_account":{
190
177
  "beneficiary_name": "Gaurav Kumar",
191
- "account_number": 11214311215411,
178
+ "account_number": "11214311215411",
192
179
  "account_type": "savings",
193
180
  "ifsc_code": "HDFC0001233"
194
181
  },
195
- "nach": {
182
+ "nach":{
196
183
  "form_reference1": "Recurring Payment for Gaurav Kumar",
197
184
  "form_reference2": "Method Paper NACH"
198
- }
185
+ },
186
+ "expire_at":1947483647,
187
+ "max_amount":50000
199
188
  },
200
- "receipt": "Receipt No. 5",
201
- "email_notify": 1,
202
- "sms_notify": 1,
203
- "expire_by": 1634215992,
204
- "notes": {
189
+ "receipt": "Receipt No. 1",
190
+ "sms_notify":1,
191
+ "email_notify":1,
192
+ "expire_by":1647483647,
193
+ "notes":{
205
194
  "note_key 1": "Beam me up Scotty",
206
195
  "note_key 2": "Tea. Earl Gray. Hot."
207
196
  }
@@ -213,8 +202,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
213
202
 
214
203
  | Name | Type | Description |
215
204
  |-----------------|---------|---------------------------------------------------------------|
216
- | customer | object | Details of the customer to whom the registration link will be sent. |
217
- | type* | object | the value is `link`. |
205
+ | customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#121-create-a-registration-link) are supported |
218
206
  | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
219
207
  | currency* | string | The currency of the payment (defaults to INR) |
220
208
  | description* | string | A brief description of the payment. |
@@ -340,7 +328,7 @@ Razorpay::Order.create(para_attr)
340
328
  | currency* | string | The currency of the payment (defaults to INR) |
341
329
  | receipt | string | Your system order reference id. |
342
330
  | notes | object | A key-value pair |
343
- | payment_capture | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
331
+ | payment_capture* | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
344
332
 
345
333
  **Response:**
346
334
  ```json
@@ -372,14 +360,18 @@ para_attr = {
372
360
  "contact": "9123456789",
373
361
  "amount": 1000,
374
362
  "currency": "INR",
363
+ "order_id": "order_1Aa00000000002",
364
+ "customer_id": "cust_1Aa00000000001",
365
+ "token": "token_1Aa00000000001",
375
366
  "recurring": "1",
376
367
  "description": "Creating recurring payment for Gaurav Kumar",
377
368
  "notes": {
378
- "key1": "value3",
379
- "key2": "value2"
369
+ "note_key 1": "Beam me up Scotty",
370
+ "note_key 2": "Tea. Earl Gray. Hot."
380
371
  }
381
372
  }
382
- Razorpay::Payment.createRecurringPayment(para_attr)
373
+
374
+ Razorpay::Payment.create_recurring_payment(para_attr)
383
375
  ```
384
376
  **Parameters:**
385
377
 
@@ -413,7 +405,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
413
405
 
414
406
  medium = "email"
415
407
 
416
- Razorpay::Invoice.notifyBy(invoiceId, medium)
408
+ Razorpay::Invoice.notify_by(invoiceId, medium)
417
409
  ```
418
410
  **Parameters:**
419
411
 
@@ -537,9 +529,9 @@ Razorpay::Invoice.cancel(invoiceId);
537
529
  ## Fetch token by payment id
538
530
 
539
531
  ```rb
540
- customerId = "cust_1Aa00000000004"
532
+ paymentId = "pay_EnLNTjINiPkMEZ"
541
533
 
542
- Razorpay::Customer.fetchTokens(customerId)
534
+ Razorpay::Payment.fetch(paymentId)
543
535
  ```
544
536
  **Parameters:**
545
537
 
@@ -593,7 +585,7 @@ Razorpay::Customer.fetchTokens(customerId)
593
585
  ```rb
594
586
  customerId = "cust_1Aa00000000004"
595
587
 
596
- Razorpay::Customer.fetchTokens(customerId)
588
+ Razorpay::Customer.fetch(customerId).fetchTokens
597
589
  ```
598
590
  **Parameters:**
599
591
 
@@ -638,7 +630,7 @@ customerId = "cust_1Aa00000000004"
638
630
 
639
631
  tokenId = "token_Hxe0skTXLeg9pF"
640
632
 
641
- Razorpay::fetch(customerId).deleteToken(tokenId)
633
+ Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
642
634
  ```
643
635
  **Parameters:**
644
636
 
@@ -441,6 +441,7 @@ Razorpay::Settlement.fetch_all_ondemand_settlement(para_attr)
441
441
  | to | timestamp | timestamp before which the payments were created |
442
442
  | count | integer | number of payments to fetch (default: 10) |
443
443
  | skip | integer | number of payments to be skipped (default: 0) |
444
+ | expand[] | string | Possible value is `ondemand_payouts`|
444
445
 
445
446
  **Response:**<br>
446
447
  For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements)
@@ -0,0 +1,334 @@
1
+ ## Stakeholders
2
+
3
+ ### Create an Stakeholder
4
+ ```rb
5
+
6
+ accountId = "acc_GP4lfNA0iIMn5B"
7
+
8
+ Razorpay::Stakeholder.create(accountId, {
9
+ "percentage_ownership": 10,
10
+ "name": "Gaurav Kumar",
11
+ "email": "gaurav.kumar@example.com",
12
+ "relationship": {
13
+ "director": 1,
14
+ "executive": 0
15
+ },
16
+ "phone": {
17
+ "primary": "7474747474",
18
+ "secondary": "7474747474"
19
+ },
20
+ "addresses": {
21
+ "residential": {
22
+ "street": "506, Koramangala 1st block",
23
+ "city": "Bengaluru",
24
+ "state": "Karnataka",
25
+ "postal_code": "560034",
26
+ "country": "IN"
27
+ }
28
+ },
29
+ "kyc": {
30
+ "pan": "AVOPB1111K"
31
+ },
32
+ "notes": {
33
+ "random_key_by_partner": "random_value"
34
+ }
35
+ })
36
+ ```
37
+
38
+ **Parameters:**
39
+
40
+ | Name | Type | Description |
41
+ |---------------|-------------|---------------------------------------------|
42
+ | email | string | The sub-merchant's business email address. |
43
+ | name* | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
44
+ | percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
45
+ | relationship | boolean | The stakeholder's relationship with the account’s business. |
46
+ | phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
47
+ | addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
48
+ | kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
49
+ | notes | object | A key-value pair |
50
+
51
+ **Response:**
52
+ ```json
53
+ {
54
+ "entity": "stakeholder",
55
+ "relationship": {
56
+ "director": true
57
+ },
58
+ "phone": {
59
+ "primary": "7474747474",
60
+ "secondary": "7474747474"
61
+ },
62
+ "notes": {
63
+ "random_key_by_partner": "random_value"
64
+ },
65
+ "kyc": {
66
+ "pan": "AVOPB1111K"
67
+ },
68
+ "id": "sth_GLGgm8fFCKc92m",
69
+ "name": "Gaurav Kumar",
70
+ "email": "gaurav.kumar@example.com",
71
+ "percentage_ownership": 10,
72
+ "addresses": {
73
+ "residential": {
74
+ "street": "506, Koramangala 1st block",
75
+ "city": "Bengaluru",
76
+ "state": "Karnataka",
77
+ "postal_code": "560034",
78
+ "country": "IN"
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
84
+ -------------------------------------------------------------------------------------------------------
85
+
86
+ ### Edit Stakeholder
87
+
88
+ ```rb
89
+ accountId = "acc_GP4lfNA0iIMn5B";
90
+ stakeholderId = "sth_GOQ4Eftlz62TSL";
91
+
92
+ Razorpay::Stakeholder.edit(accountId, stakeholderId, {
93
+ "percentage_ownership": 20,
94
+ "name": "Gauri Kumar",
95
+ "relationship": {
96
+ "director": 0,
97
+ "executive": 1
98
+ },
99
+ "phone": {
100
+ "primary": "9898989898",
101
+ "secondary": "9898989898"
102
+ },
103
+ "addresses": {
104
+ "residential": {
105
+ "street": "507, Koramangala 1st block",
106
+ "city": "Bangalore",
107
+ "state": "Karnataka",
108
+ "postal_code": "560035",
109
+ "country": "IN"
110
+ }
111
+ },
112
+ "kyc": {
113
+ "pan": "AVOPB1111J"
114
+ },
115
+ "notes": {
116
+ "random_key_by_partner": "random_value2"
117
+ }
118
+ })
119
+ ```
120
+
121
+ **Parameters:**
122
+
123
+ | Name | Type | Description |
124
+ |---------------|-------------|---------------------------------------------|
125
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
126
+ | stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
127
+ | name | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
128
+ | percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
129
+ | relationship | boolean | The stakeholder's relationship with the account’s business. |
130
+ | phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
131
+ | addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
132
+ | kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
133
+ | notes | object | A key-value pair |
134
+
135
+ **Response:**
136
+ ```json
137
+ {
138
+ "id": "acc_GP4lfNA0iIMn5B",
139
+ "type": "standard",
140
+ "status": "created",
141
+ "email": "gauri@example.org",
142
+ "profile": {
143
+ "category": "healthcare",
144
+ "subcategory": "clinic",
145
+ "addresses": {
146
+ "registered": {
147
+ "street1": "507, Koramangala 1st block",
148
+ "street2": "MG Road-1",
149
+ "city": "Bengalore",
150
+ "state": "KARNATAKA",
151
+ "postal_code": "560034",
152
+ "country": "IN"
153
+ }
154
+ }
155
+ },
156
+ "notes": [],
157
+ "created_at": 1610603081,
158
+ "phone": "9000090000",
159
+ "reference_id": "randomId",
160
+ "business_type": "partnership",
161
+ "legal_business_name": "Acme Corp",
162
+ "customer_facing_business_name": "ABCD Ltd"
163
+ }
164
+ ```
165
+ -------------------------------------------------------------------------------------------------------
166
+
167
+ ### Fetch all accounts
168
+ ```rb
169
+ accountId = "acc_GP4lfNA0iIMn5B";
170
+
171
+ Razorpay::Stakeholder.all(accountId);
172
+ ```
173
+
174
+ **Parameters:**
175
+
176
+ | Name | Type | Description |
177
+ |---------------|-------------|---------------------------------------------|
178
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
179
+
180
+ **Response:**
181
+ ```json
182
+ {
183
+ "entity": "collection",
184
+ "items": [
185
+ {
186
+ "id": "GZ13yPHLJof9IE",
187
+ "entity": "stakeholder",
188
+ "relationship": {
189
+ "director": true
190
+ },
191
+ "phone": {
192
+ "primary": "9000090000",
193
+ "secondary": "9000090000"
194
+ },
195
+ "notes": {
196
+ "random_key_by_partner": "random_value"
197
+ },
198
+ "kyc": {
199
+ "pan": "AVOPB1111K"
200
+ },
201
+ "name": "Gaurav Kumar",
202
+ "email": "gaurav.kumar@acme.org",
203
+ "percentage_ownership": 10,
204
+ "addresses": {
205
+ "residential": {
206
+ "street": "506, Koramangala 1st block",
207
+ "city": "Bengaluru",
208
+ "state": "Karnataka",
209
+ "postal_code": "560034",
210
+ "country": "in"
211
+ }
212
+ }
213
+ }
214
+ ],
215
+ "count": 1
216
+ }
217
+ ```
218
+
219
+ -------------------------------------------------------------------------------------------------------
220
+
221
+ ### Fetch an stakeholder
222
+ ```rb
223
+ accountId = "acc_GP4lfNA0iIMn5B";
224
+
225
+ stakeholderId = "sth_GOQ4Eftlz62TSL";
226
+
227
+ Razorpay::Stakeholder.fetch(accountId, stakeholderId);
228
+ ```
229
+
230
+ **Parameters:**
231
+
232
+ | Name | Type | Description |
233
+ |-------------|-------------|---------------------------------------------|
234
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
235
+ | stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
236
+
237
+ **Response:**
238
+ ```json
239
+ {
240
+ "entity": "stakeholder",
241
+ "relationship": {
242
+ "director": true
243
+ },
244
+ "phone": {
245
+ "primary": "9000090000",
246
+ "secondary": "9000090000"
247
+ },
248
+ "notes": {
249
+ "random_key_by_partner": "random_value2"
250
+ },
251
+ "kyc": {
252
+ "pan": "AVOPB1111J"
253
+ },
254
+ "id": "sth_GOQ4Eftlz62TSL",
255
+ "name": "Gauri Kumar",
256
+ "email": "gauri@example.com",
257
+ "percentage_ownership": 20,
258
+ "addresses": {
259
+ "residential": {
260
+ "street": "507, Koramangala 1st block",
261
+ "city": "Bangalore",
262
+ "state": "Karnataka",
263
+ "postal_code": "560035",
264
+ "country": "in"
265
+ }
266
+ }
267
+ }
268
+ ```
269
+ -------------------------------------------------------------------------------------------------------
270
+ ### Upload account documents
271
+ ```rb
272
+ account_id = "acc_0000000000001"
273
+ stakeholder_id = "sth_00000000000001"
274
+
275
+ Razorpay::Stakeholder.upload_stakeholder_doc(account_id, stakeholder_id, {
276
+ "file": File.new("/Users/your_name/Downloads/sample_uploaded.jpeg"),
277
+ "document_type": "aadhar_front"
278
+ });
279
+
280
+ ```
281
+
282
+ **Parameters:**
283
+
284
+ | Name | Type | Description |
285
+ |-------------|-------------|---------------------------------------------|
286
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
287
+ | stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
288
+ | file* | string | The URL generated once the business proof document is uploaded. |
289
+ | document_type* | string | The documents valid for the proof type to be shared. In case of individual_proof_of_address, both the front and back of a document proof must be uploaded. Possible values : <br> individual_proof_of_identification: `personal_pan` <br><br> individual_proof_of_address : `voter_id_back`, `voter_id_front`, `aadhar_front`, `aadhar_back`, `passport_front`, `passport_back` |
290
+
291
+ **Response:**
292
+ ```json
293
+ {
294
+ "individual_proof_of_address": [
295
+ {
296
+ "type": "aadhar_front",
297
+ "url": "https://rzp.io/i/bzDAbNg"
298
+ }
299
+ ]
300
+ }
301
+ ```
302
+ -------------------------------------------------------------------------------------------------------
303
+
304
+ ### Fetch stakeholder documents
305
+ ```rb
306
+ account_id = "acc_0000000000001"
307
+ stakeholder_id = "sth_00000000000001"
308
+
309
+ Razorpay::Stakeholder.fetch_stakeholder_doc(account_id, stakeholder_id)
310
+ ```
311
+
312
+ **Parameters:**
313
+
314
+ | Name | Type | Description |
315
+ |-------------|-------------|---------------------------------------------|
316
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
317
+ | stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
318
+
319
+ **Response:**
320
+ ```json
321
+ {
322
+ "individual_proof_of_address": [
323
+ {
324
+ "type": "aadhar_front",
325
+ "document_id": "doc_GOgDZbg848e6bI"
326
+ }
327
+ ]
328
+ }
329
+ ```
330
+ -------------------------------------------------------------------------------------------------------
331
+ **PN: * indicates mandatory fields**
332
+ <br>
333
+ <br>
334
+ **For reference click [here](https://razorpay.com/docs/api/partners/stakeholder)**
@@ -44,6 +44,7 @@ Razorpay::Subscription.create(para_attr)
44
44
  | expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
45
45
  | addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. |
46
46
  | notes | object | Notes you can enter for the contact for future reference. |
47
+ | offer_id | string | The unique identifier of the offer that is linked to the subscription. |
47
48
 
48
49
  **Response:**
49
50
  ```json
@@ -123,6 +124,7 @@ Razorpay::Subscription.create(para_attr)
123
124
  | addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. |
124
125
  | notes | object | Notes you can enter for the contact for future reference. |
125
126
  | notify_info | object | The customer's email and phone number to which notifications are to be sent. (PN: Use this object only if you have set the `customer_notify` parameter to 1. That is, Razorpay sends notifications to the customer.) |
127
+ | offer_id | string | The unique identifier of the offer that is linked to the subscription. |
126
128
 
127
129
  **Response:**
128
130
  ```json
@@ -484,7 +486,7 @@ Razorpay::Subscription.cancel_scheduled_changes(subscriptionId)
484
486
  ```rb
485
487
  subscriptionId = "sub_00000000000001"
486
488
 
487
- options = { "pause_at" : "now" }
489
+ options = {"pause_at": "now"}
488
490
 
489
491
  Razorpay::Subscription.pause(subscriptionId,options)
490
492
  ```