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.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +8 -0
- data/.github/workflows/ci.yml +79 -0
- data/CHANGELOG.md +21 -0
- data/README.md +5 -1
- data/documents/Invoice.md +11 -3
- data/documents/account.md +449 -0
- data/documents/addon.md +23 -1
- data/documents/card.md +73 -29
- data/documents/customer.md +2 -0
- data/documents/emandate.md +20 -12
- data/documents/fund.md +19 -17
- data/documents/items.md +65 -41
- data/documents/order.md +51 -0
- data/documents/papernach.md +40 -20
- data/documents/payment.md +247 -14
- data/documents/paymentLink.md +37 -19
- data/documents/plan.md +3 -3
- data/documents/productConfiguration.md +444 -0
- data/documents/qrcode.md +17 -19
- data/documents/refund.md +11 -10
- data/documents/registerEmandate.md +25 -18
- data/documents/registerNach.md +49 -57
- data/documents/settlement.md +1 -0
- data/documents/stakeholder.md +334 -0
- data/documents/subscriptions.md +3 -1
- data/documents/tokens.md +201 -2
- data/documents/transfers.md +292 -195
- data/documents/upi.md +25 -28
- data/documents/virtualAccount.md +18 -13
- data/documents/webhook.md +224 -0
- data/lib/razorpay/account.rb +39 -0
- data/lib/razorpay/addon.rb +5 -1
- data/lib/razorpay/card.rb +4 -0
- data/lib/razorpay/constants.rb +2 -2
- data/lib/razorpay/iin.rb +15 -0
- data/lib/razorpay/order.rb +1 -1
- data/lib/razorpay/payment.rb +8 -0
- data/lib/razorpay/payment_method.rb +17 -0
- data/lib/razorpay/product.rb +37 -0
- data/lib/razorpay/request.rb +16 -16
- data/lib/razorpay/stakeholder.rb +39 -0
- data/lib/razorpay/token.rb +28 -0
- data/lib/razorpay/virtual_account.rb +1 -1
- data/lib/razorpay/webhook.rb +50 -0
- data/lib/razorpay.rb +7 -0
- data/razorpay-ruby.gemspec +2 -1
- data/test/fixtures/fake_account.json +78 -0
- data/test/fixtures/fake_card_reference.json +5 -0
- data/test/fixtures/fake_create_upi_payment.json +3 -0
- data/test/fixtures/fake_iin_token.json +23 -0
- data/test/fixtures/fake_product.json +138 -0
- data/test/fixtures/fake_stakeholder.json +29 -0
- data/test/fixtures/fake_tokenise_customer.json +40 -0
- data/test/fixtures/fake_validate_vpa.json +5 -0
- data/test/fixtures/fake_webhook.json +79 -0
- data/test/fixtures/fake_webhook_by_account_id.json +22 -0
- data/test/fixtures/fetch_tnc.json +11 -0
- data/test/fixtures/payment_methods_collection.json +149 -0
- data/test/fixtures/stakeholder_collection.json +35 -0
- data/test/fixtures/webhook_by_account_collection.json +35 -0
- data/test/fixtures/webhook_collection.json +85 -0
- data/test/razorpay/test_account.rb +134 -0
- data/test/razorpay/test_addon.rb +6 -2
- data/test/razorpay/test_card.rb +6 -0
- data/test/razorpay/test_customer.rb +8 -8
- data/test/razorpay/test_iin.rb +23 -0
- data/test/razorpay/test_order.rb +1 -1
- data/test/razorpay/test_payment.rb +46 -2
- data/test/razorpay/test_product.rb +67 -0
- data/test/razorpay/test_settlement.rb +1 -1
- data/test/razorpay/test_stakeholder.rb +87 -0
- data/test/razorpay/test_token.rb +66 -0
- data/test/razorpay/test_transfer.rb +1 -1
- data/test/razorpay/test_webhook.rb +132 -0
- data/test/test_helper.rb +2 -0
- metadata +76 -7
data/documents/registerNach.md
CHANGED
@@ -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":
|
50
|
+
"amount":0,
|
52
51
|
"currency": "INR",
|
53
52
|
"method": "nach",
|
54
|
-
"
|
53
|
+
"customer_id": "cust_1Aa00000000001",
|
54
|
+
"receipt": "Receipt No. 1",
|
55
55
|
"notes": {
|
56
|
-
"
|
57
|
-
"
|
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":
|
63
|
-
"expire_at":
|
62
|
+
"max_amount":10000000,
|
63
|
+
"expire_at":1580480689,
|
64
64
|
"notes": {
|
65
|
-
"
|
66
|
-
"
|
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
|
-
"
|
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 |
|
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
|
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":
|
180
|
-
"type": "link",
|
169
|
+
"amount":0,
|
181
170
|
"currency": "INR",
|
182
|
-
"
|
183
|
-
"
|
184
|
-
|
171
|
+
"type": "link",
|
172
|
+
"description": "12 p.m. Meals",
|
173
|
+
"subscription_registration":{
|
185
174
|
"method": "nach",
|
186
175
|
"auth_type": "physical",
|
187
|
-
"
|
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.
|
201
|
-
"
|
202
|
-
"
|
203
|
-
"expire_by":
|
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
|
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
|
-
"
|
379
|
-
"
|
369
|
+
"note_key 1": "Beam me up Scotty",
|
370
|
+
"note_key 2": "Tea. Earl Gray. Hot."
|
380
371
|
}
|
381
372
|
}
|
382
|
-
|
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.
|
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
|
-
|
532
|
+
paymentId = "pay_EnLNTjINiPkMEZ"
|
541
533
|
|
542
|
-
Razorpay::
|
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.
|
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
|
|
data/documents/settlement.md
CHANGED
@@ -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)**
|
data/documents/subscriptions.md
CHANGED
@@ -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 = {
|
489
|
+
options = {"pause_at": "now"}
|
488
490
|
|
489
491
|
Razorpay::Subscription.pause(subscriptionId,options)
|
490
492
|
```
|