razorpay 2.4.0 → 3.2.4

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 (185) hide show
  1. checksums.yaml +4 -4
  2. data/.cursorignore +174 -0
  3. data/.github/dependabot.yml +8 -0
  4. data/.github/pull_request_template.md +8 -0
  5. data/.github/workflows/ci.yml +80 -0
  6. data/.github/workflows/ruby.yml +38 -0
  7. data/CHANGELOG.md +85 -1
  8. data/README.md +48 -137
  9. data/documents/Invoice.md +539 -0
  10. data/documents/account.md +449 -0
  11. data/documents/addon.md +191 -0
  12. data/documents/card.md +655 -0
  13. data/documents/customer.md +405 -0
  14. data/documents/dispute.md +301 -0
  15. data/documents/documents.md +65 -0
  16. data/documents/emandate.md +492 -0
  17. data/documents/fund.md +89 -0
  18. data/documents/items.md +208 -0
  19. data/documents/oauth_token.md +142 -0
  20. data/documents/order.md +352 -0
  21. data/documents/papernach.md +738 -0
  22. data/documents/payment.md +1122 -0
  23. data/documents/paymentLink.md +1063 -0
  24. data/documents/paymentVerification.md +79 -0
  25. data/documents/plan.md +184 -0
  26. data/documents/productConfiguration.md +444 -0
  27. data/documents/qrcode.md +439 -0
  28. data/documents/refund.md +325 -0
  29. data/documents/registerEmandate.md +452 -0
  30. data/documents/registerNach.md +653 -0
  31. data/documents/settlement.md +478 -0
  32. data/documents/stakeholder.md +334 -0
  33. data/documents/subscriptions.md +752 -0
  34. data/documents/tokens.md +407 -0
  35. data/documents/transfers.md +821 -0
  36. data/documents/upi.md +545 -0
  37. data/documents/virtualAccount.md +591 -0
  38. data/documents/webhook.md +224 -0
  39. data/lib/razorpay/account.rb +39 -0
  40. data/lib/razorpay/addon.rb +9 -1
  41. data/lib/razorpay/card.rb +4 -0
  42. data/lib/razorpay/constants.rb +7 -2
  43. data/lib/razorpay/customer.rb +31 -0
  44. data/lib/razorpay/dispute.rb +26 -0
  45. data/lib/razorpay/document.rb +19 -0
  46. data/lib/razorpay/fund_account.rb +19 -0
  47. data/lib/razorpay/iin.rb +15 -0
  48. data/lib/razorpay/invoice.rb +8 -0
  49. data/lib/razorpay/item.rb +34 -0
  50. data/lib/razorpay/oauth_token.rb +109 -0
  51. data/lib/razorpay/order.rb +19 -1
  52. data/lib/razorpay/payload_validator.rb +93 -0
  53. data/lib/razorpay/payment.rb +64 -0
  54. data/lib/razorpay/payment_link.rb +36 -0
  55. data/lib/razorpay/payment_method.rb +17 -0
  56. data/lib/razorpay/product.rb +37 -0
  57. data/lib/razorpay/qr_code.rb +34 -0
  58. data/lib/razorpay/refund.rb +4 -0
  59. data/lib/razorpay/request.rb +50 -26
  60. data/lib/razorpay/settlement.rb +39 -0
  61. data/lib/razorpay/stakeholder.rb +39 -0
  62. data/lib/razorpay/subscription.rb +24 -0
  63. data/lib/razorpay/subscription_registration.rb +16 -0
  64. data/lib/razorpay/token.rb +28 -0
  65. data/lib/razorpay/transfer.rb +39 -0
  66. data/lib/razorpay/utility.rb +41 -6
  67. data/lib/razorpay/validation_config.rb +11 -0
  68. data/lib/razorpay/virtual_account.rb +15 -7
  69. data/lib/razorpay/webhook.rb +50 -0
  70. data/lib/razorpay.rb +24 -1
  71. data/razorpay-ruby.gemspec +2 -1
  72. data/test/fixtures/addon_collection.json +60 -0
  73. data/test/fixtures/create_json_payment.json +13 -0
  74. data/test/fixtures/delete_token.json +3 -0
  75. data/test/fixtures/dispute_collection.json +67 -0
  76. data/test/fixtures/dispute_error.json +10 -0
  77. data/test/fixtures/document_error.json +10 -0
  78. data/test/fixtures/downtimes_collection.json +21 -0
  79. data/test/fixtures/empty.json +2 -0
  80. data/test/fixtures/error_customer.json +10 -0
  81. data/test/fixtures/error_eligibility.json +10 -0
  82. data/test/fixtures/error_eligibility_check.json +10 -0
  83. data/test/fixtures/fake_account.json +78 -0
  84. data/test/fixtures/fake_addon.json +3 -3
  85. data/test/fixtures/fake_bank_account.json +9 -0
  86. data/test/fixtures/fake_card_reference.json +5 -0
  87. data/test/fixtures/fake_create_upi_payment.json +3 -0
  88. data/test/fixtures/fake_direct_transfer.json +32 -0
  89. data/test/fixtures/fake_dispute.json +29 -0
  90. data/test/fixtures/fake_document.json +9 -0
  91. data/test/fixtures/fake_downtime.json +14 -0
  92. data/test/fixtures/fake_eligiblity.json +79 -0
  93. data/test/fixtures/fake_fulfillment.json +10 -0
  94. data/test/fixtures/fake_fund_account.json +18 -0
  95. data/test/fixtures/fake_iin_token.json +23 -0
  96. data/test/fixtures/fake_instant_settlement.json +19 -0
  97. data/test/fixtures/fake_item.json +9 -0
  98. data/test/fixtures/fake_oauth_token.json +8 -0
  99. data/test/fixtures/fake_order_transfers.json +88 -0
  100. data/test/fixtures/fake_otp_generate.json +19 -0
  101. data/test/fixtures/fake_otp_resend.json +7 -0
  102. data/test/fixtures/fake_otp_submit.json +5 -0
  103. data/test/fixtures/fake_payment_expanded_details.json +38 -0
  104. data/test/fixtures/fake_payment_expanded_details_card.json +50 -0
  105. data/test/fixtures/fake_payment_link.json +40 -0
  106. data/test/fixtures/fake_pending_update.json +30 -0
  107. data/test/fixtures/fake_product.json +138 -0
  108. data/test/fixtures/fake_qrcode.json +20 -0
  109. data/test/fixtures/fake_qrcode_close.json +22 -0
  110. data/test/fixtures/fake_recurring.json +5 -0
  111. data/test/fixtures/fake_refund.json +1 -1
  112. data/test/fixtures/fake_revoke_token.json +3 -0
  113. data/test/fixtures/fake_rto.json +15 -0
  114. data/test/fixtures/fake_settlement.json +11 -0
  115. data/test/fixtures/fake_settlement_on_demand.json +39 -0
  116. data/test/fixtures/fake_stakeholder.json +29 -0
  117. data/test/fixtures/fake_subscription_pause.json +19 -0
  118. data/test/fixtures/fake_subscription_registration.json +91 -0
  119. data/test/fixtures/fake_subscription_resume.json +19 -0
  120. data/test/fixtures/fake_token.json +31 -0
  121. data/test/fixtures/fake_tokenise_customer.json +40 -0
  122. data/test/fixtures/fake_transfer.json +18 -0
  123. data/test/fixtures/fake_transfer_reverse.json +15 -0
  124. data/test/fixtures/fake_update_payment.json +39 -0
  125. data/test/fixtures/fake_validate_vpa.json +5 -0
  126. data/test/fixtures/fake_virtual_account_allowed.json +46 -0
  127. data/test/fixtures/fake_virtual_account_receiver.json +46 -0
  128. data/test/fixtures/fake_webhook.json +79 -0
  129. data/test/fixtures/fake_webhook_by_account_id.json +22 -0
  130. data/test/fixtures/fetch_tnc.json +11 -0
  131. data/test/fixtures/fund_collection.json +20 -0
  132. data/test/fixtures/item_collection.json +24 -0
  133. data/test/fixtures/order_error.json +10 -0
  134. data/test/fixtures/payment_collection.json +1 -1
  135. data/test/fixtures/payment_error.json +10 -0
  136. data/test/fixtures/payment_link_collection.json +43 -0
  137. data/test/fixtures/payment_link_response.json +3 -0
  138. data/test/fixtures/payment_methods_collection.json +149 -0
  139. data/test/fixtures/qrcode_collection.json +50 -0
  140. data/test/fixtures/qrcode_payments_collection.json +74 -0
  141. data/test/fixtures/reversals_collection.json +22 -0
  142. data/test/fixtures/settlement_collection.json +26 -0
  143. data/test/fixtures/settlement_instant_collection.json +84 -0
  144. data/test/fixtures/settlement_report_collection.json +117 -0
  145. data/test/fixtures/stakeholder_collection.json +35 -0
  146. data/test/fixtures/success.json +3 -0
  147. data/test/fixtures/tokens_collection.json +36 -0
  148. data/test/fixtures/transfer_error.json +10 -0
  149. data/test/fixtures/transfer_settlements_collection.json +38 -0
  150. data/test/fixtures/transfers_collection.json +41 -0
  151. data/test/fixtures/webhook_by_account_collection.json +35 -0
  152. data/test/fixtures/webhook_collection.json +85 -0
  153. data/test/razorpay/test_account.rb +134 -0
  154. data/test/razorpay/test_addon.rb +19 -15
  155. data/test/razorpay/test_card.rb +6 -0
  156. data/test/razorpay/test_customer.rb +132 -3
  157. data/test/razorpay/test_dispute.rb +98 -0
  158. data/test/razorpay/test_document.rb +27 -0
  159. data/test/razorpay/test_fund_account.rb +42 -0
  160. data/test/razorpay/test_iin.rb +23 -0
  161. data/test/razorpay/test_invoice.rb +15 -2
  162. data/test/razorpay/test_item.rb +66 -0
  163. data/test/razorpay/test_oauth_token.rb +105 -0
  164. data/test/razorpay/test_order.rb +66 -1
  165. data/test/razorpay/test_payload_validator.rb +61 -0
  166. data/test/razorpay/test_payment.rb +251 -9
  167. data/test/razorpay/test_payment_link.rb +83 -0
  168. data/test/razorpay/test_plan.rb +2 -2
  169. data/test/razorpay/test_product.rb +67 -0
  170. data/test/razorpay/test_qr_code.rb +63 -0
  171. data/test/razorpay/test_razorpay.rb +19 -2
  172. data/test/razorpay/test_refund.rb +16 -2
  173. data/test/razorpay/test_settlement.rb +76 -0
  174. data/test/razorpay/test_stakeholder.rb +87 -0
  175. data/test/razorpay/test_subscription.rb +72 -9
  176. data/test/razorpay/test_subscription_registration.rb +58 -0
  177. data/test/razorpay/test_token.rb +66 -0
  178. data/test/razorpay/test_transfer.rb +94 -0
  179. data/test/razorpay/test_utility.rb +72 -4
  180. data/test/razorpay/test_virtual_account.rb +64 -17
  181. data/test/razorpay/test_webhook.rb +132 -0
  182. data/test/test_helper.rb +8 -0
  183. metadata +265 -10
  184. data/.travis.yml +0 -22
  185. data/test/razorpay/test_errors.rb +0 -19
@@ -0,0 +1,449 @@
1
+ ## Account
2
+
3
+ ```rb
4
+ require "razorpay"
5
+
6
+ Razorpay.setup('key_id', 'key_secret')
7
+ ```
8
+
9
+ ### Create an Account
10
+ ```rb
11
+ Razorpay::Account.create({
12
+ "email": "gauriagain.kumar@example.org",
13
+ "phone": "9000090000",
14
+ "legal_business_name": "Acme Corp",
15
+ "business_type": "partnership",
16
+ "customer_facing_business_name": "Example",
17
+ "profile": {
18
+ "category": "healthcare",
19
+ "subcategory": "clinic",
20
+ "description": "Healthcare E-commerce platform",
21
+ "addresses": {
22
+ "operation": {
23
+ "street1": "507, Koramangala 6th block",
24
+ "street2": "Kormanagala",
25
+ "city": "Bengaluru",
26
+ "state": "Karnataka",
27
+ "postal_code": 560047,
28
+ "country": "IN"
29
+ },
30
+ "registered": {
31
+ "street1": "507, Koramangala 1st block",
32
+ "street2": "MG Road",
33
+ "city": "Bengaluru",
34
+ "state": "Karnataka",
35
+ "postal_code": 560034,
36
+ "country": "IN"
37
+ }
38
+ },
39
+ "business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
40
+ },
41
+ "legal_info": {
42
+ "pan": "AAACL1234C",
43
+ "gst": "18AABCU9603R1ZM"
44
+ },
45
+ "brand": {
46
+ "color": "FFFFFF"
47
+ },
48
+ "notes": {
49
+ "internal_ref_id": "123123"
50
+ },
51
+ "contact_name": "Gaurav Kumar",
52
+ "contact_info": {
53
+ "chargeback": {
54
+ "email": "cb@example.org"
55
+ },
56
+ "refund": {
57
+ "email": "cb@example.org"
58
+ },
59
+ "support": {
60
+ "email": "support@example.org",
61
+ "phone": "9999999998",
62
+ "policy_url": "https://www.google.com"
63
+ }
64
+ },
65
+ "apps": {
66
+ "websites": [
67
+ "https://www.example.org"
68
+ ],
69
+ "android": [
70
+ {
71
+ "url": "playstore.example.org",
72
+ "name": "Example"
73
+ }
74
+ ],
75
+ "ios": [
76
+ {
77
+ "url": "appstore.example.org",
78
+ "name": "Example"
79
+ }
80
+ ]
81
+ }
82
+ })
83
+ ```
84
+
85
+ **Parameters:**
86
+
87
+ | Name | Type | Description |
88
+ |---------------|-------------|---------------------------------------------|
89
+ | email* | string | The sub-merchant's business email address. |
90
+ | phone* | integer | The sub-merchant's business phone number. The minimum length is 8 characters and the maximum length is 15. |
91
+ | legal_business_name* | string | The name of the sub-merchant's business. For example, Acme Corp. The minimum length is 4 characters and the maximum length is 200. |
92
+ | customer_facing_business_name | string | The sub-merchant billing label as it appears on the Razorpay Dashboard. The minimum length is 1 character and the maximum length is 255. |
93
+ | business_type | string | The type of business operated by the sub-merchant.Possible value is `proprietorship`, `partnership`, `private_limited`, `public_limited`, `llp`, `ngo`, `trust`, `society`, `not_yet_registered`, `huf` |
94
+ | reference_id | string | Partner's external account reference id. The minimum length is 1 character and the maximum length is 512. |
95
+ | profile | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
96
+ | legal_info | object | All keys listed [here](hhttps://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
97
+ | brand | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
98
+ | notes | object | A key-value pair |
99
+ | contact_name* | string | The name of the contact. The minimum length is 4 and the maximum length is 255 characters. |
100
+ | contact_info | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
101
+ | apps | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
102
+
103
+
104
+ **Response:**
105
+ ```json
106
+ {
107
+ "id": "acc_GRWKk7qQsLnDjX",
108
+ "type": "standard",
109
+ "status": "created",
110
+ "email": "gauriagain.kumar@example.org",
111
+ "profile": {
112
+ "category": "healthcare",
113
+ "subcategory": "clinic",
114
+ "addresses": {
115
+ "registered": {
116
+ "street1": "507, Koramangala 1st block",
117
+ "street2": "MG Road",
118
+ "city": "Bengaluru",
119
+ "state": "KARNATAKA",
120
+ "postal_code": 560034,
121
+ "country": "IN"
122
+ },
123
+ "operation": {
124
+ "street1": "507, Koramangala 6th block",
125
+ "street2": "Kormanagalo",
126
+ "city": "Bengaluru",
127
+ "state": "KARNATAKA",
128
+ "country": "IN",
129
+ "postal_code": 560047
130
+ }
131
+ },
132
+ "business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
133
+ },
134
+ "notes": {
135
+ "internal_ref_id": "123123"
136
+ },
137
+ "created_at": 1611136837,
138
+ "phone": "9000090000",
139
+ "business_type": "partnership",
140
+ "legal_business_name": "Acme Corp",
141
+ "customer_facing_business_name": "Example",
142
+ "legal_info": {
143
+ "pan": "AAACL1234C",
144
+ "gst": "18AABCU9603R1ZM"
145
+ },
146
+ "apps": {
147
+ "websites": [
148
+ "https://www.example.org"
149
+ ],
150
+ "android": [
151
+ {
152
+ "url": "playstore.example.org",
153
+ "name": "Example"
154
+ }
155
+ ],
156
+ "ios": [
157
+ {
158
+ "url": "appstore.example.org",
159
+ "name": "Example"
160
+ }
161
+ ]
162
+ },
163
+ "brand": {
164
+ "color": "#FFFFFF"
165
+ },
166
+ "contact_info": {
167
+ "chargeback": {
168
+ "email": "cb@example.org",
169
+ "phone": null,
170
+ "policy_url": null
171
+ },
172
+ "refund": {
173
+ "email": "cb@example.org",
174
+ "phone": null,
175
+ "policy_url": null
176
+ },
177
+ "support": {
178
+ "email": "support@example.org",
179
+ "phone": "9999999998",
180
+ "policy_url": "https://www.google.com"
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ -------------------------------------------------------------------------------------------------------
187
+
188
+ ### Edit Account
189
+
190
+ ```rb
191
+ accountId = "acc_GP4lfNA0iIMn5B";
192
+
193
+ Razorpay::Account.edit(accountId,{
194
+ "customer_facing_business_name": "ABCD Ltd"
195
+ })
196
+ ```
197
+
198
+ **Parameters:**
199
+
200
+ | Name | Type | Description |
201
+ |---------------|-------------|---------------------------------------------|
202
+ | phone | integer | The sub-merchant's business phone number. The minimum length is 8 characters and the maximum length is 15. |
203
+ | legal_business_name | string | The name of the sub-merchant's business. For example, Acme Corp. The minimum length is 4 characters and the maximum length is 200. |
204
+ | customer_facing_business_name | string | The sub-merchant billing label as it appears on the Razorpay Dashboard. The minimum length is 1 character and the maximum length is 255. |
205
+ | profile | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
206
+ | legal_info | object | All keys listed [here](hhttps://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
207
+ | brand | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
208
+ | notes | object | A key-value pair |
209
+ | contact_name* | string | The name of the contact. The minimum length is 4 and the maximum length is 255 characters. |
210
+ | contact_info | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
211
+ | apps | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
212
+
213
+ **Response:**
214
+ ```json
215
+ {
216
+ "id": "acc_GP4lfNA0iIMn5B",
217
+ "type": "standard",
218
+ "status": "created",
219
+ "email": "gauri@example.org",
220
+ "profile": {
221
+ "category": "healthcare",
222
+ "subcategory": "clinic",
223
+ "addresses": {
224
+ "registered": {
225
+ "street1": "507, Koramangala 1st block",
226
+ "street2": "MG Road-1",
227
+ "city": "Bengalore",
228
+ "state": "KARNATAKA",
229
+ "postal_code": "560034",
230
+ "country": "IN"
231
+ }
232
+ }
233
+ },
234
+ "notes": [],
235
+ "created_at": 1610603081,
236
+ "phone": "9000090000",
237
+ "reference_id": "randomId",
238
+ "business_type": "partnership",
239
+ "legal_business_name": "Acme Corp",
240
+ "customer_facing_business_name": "ABCD Ltd"
241
+ }
242
+ ```
243
+ -------------------------------------------------------------------------------------------------------
244
+
245
+ ### Delete an account
246
+ ```rb
247
+ accountId = "acc_GP4lfNA0iIMn5B";
248
+
249
+ Razorpay::Account.delete(accountId)
250
+ ```
251
+
252
+ **Parameters:**
253
+
254
+ | Name | Type | Description |
255
+ |---------------|-------------|---------------------------------------------|
256
+ | accountId* | string | The unique identifier of a sub-merchant account that must be deleted. |
257
+
258
+ **Response:**
259
+ ```json
260
+ {
261
+ "id": "acc_GXQAkO2MrvBYg4",
262
+ "type": "standard",
263
+ "status": "suspended",
264
+ "email": "gaurav.kumar@acme.org",
265
+ "profile": {
266
+ "category": "healthcare",
267
+ "subcategory": "clinic",
268
+ "addresses": {
269
+ "registered": {
270
+ "street1": "507, Koramangala 1st block",
271
+ "street2": "MG Road",
272
+ "city": "Bengaluru",
273
+ "state": "KARNATAKA",
274
+ "postal_code": "560034",
275
+ "country": "IN"
276
+ },
277
+ "operation": {
278
+ "street1": "507, Koramangala 1st block",
279
+ "street2": "MG Road",
280
+ "city": "Bengaluru",
281
+ "state": "KARNATAKA",
282
+ "country": "IN",
283
+ "postal_code": "560034"
284
+ }
285
+ },
286
+ "business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
287
+ },
288
+ "notes": {
289
+ "internal_ref_id": "123123"
290
+ },
291
+ "created_at": 1612425180,
292
+ "suspended_at": 1612425235,
293
+ "phone": "9000090000",
294
+ "reference_id": "account_COdeRandom",
295
+ "business_type": "partnership",
296
+ "legal_business_name": "Acme Corp Pvt Ltd",
297
+ "customer_facing_business_name": "Acme",
298
+ "legal_info": {
299
+ "pan": "AAACL1234C",
300
+ "gst": "18AABCU9603R1ZM"
301
+ },
302
+ "apps": {
303
+ "websites": [
304
+ "https://www.acme.org"
305
+ ],
306
+ "android": [
307
+ {
308
+ "url": "playstore.acme.org",
309
+ "name": "Acme"
310
+ }
311
+ ],
312
+ "ios": [
313
+ {
314
+ "url": "appstore.acme.org",
315
+ "name": "Acme"
316
+ }
317
+ ]
318
+ },
319
+ "brand": {
320
+ "color": "#FFFFFF"
321
+ },
322
+ "contact_name": "Gaurav Kumar",
323
+ "contact_info": {
324
+ "chargeback": {
325
+ "email": "cb@acme.org",
326
+ "phone": "9000090000",
327
+ "policy_url": "https://www.google.com"
328
+ },
329
+ "refund": {
330
+ "email": "cb@acme.org",
331
+ "phone": "9898989898",
332
+ "policy_url": "https://www.google.com"
333
+ },
334
+ "support": {
335
+ "email": "support@acme.org",
336
+ "phone": "9898989898",
337
+ "policy_url": "https://www.google.com"
338
+ }
339
+ }
340
+ }
341
+ ```
342
+
343
+ -------------------------------------------------------------------------------------------------------
344
+
345
+ ### Fetch an account
346
+ ```rb
347
+ accountId = "acc_GP4lfNA0iIMn5B";
348
+
349
+ Razorpay::Account.fetch(accountId)
350
+ ```
351
+
352
+ **Parameters:**
353
+
354
+ | Name | Type | Description |
355
+ |-------------|-------------|---------------------------------------------|
356
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
357
+
358
+ **Response:**
359
+ ```json
360
+ {
361
+ "id": "acc_GP4lfNA0iIMn5B",
362
+ "type": "standard",
363
+ "status": "created",
364
+ "email": "gauri@example.org",
365
+ "profile": {
366
+ "category": "healthcare",
367
+ "subcategory": "clinic",
368
+ "addresses": {
369
+ "registered": {
370
+ "street1": "507, Koramangala 1st block",
371
+ "street2": "MG Road-1",
372
+ "city": "Bengalore",
373
+ "state": "KARNATAKA",
374
+ "postal_code": "560034",
375
+ "country": "IN"
376
+ }
377
+ }
378
+ },
379
+ "notes": [],
380
+ "created_at": 1610603081,
381
+ "phone": "9000090000",
382
+ "reference_id": "randomId",
383
+ "business_type": "partnership",
384
+ "legal_business_name": "Acme Corp",
385
+ "customer_facing_business_name": "Example Pvt. Ltd."
386
+ }
387
+ ```
388
+ -------------------------------------------------------------------------------------------------------
389
+ ### Upload account documents
390
+ ```rb
391
+ account_id = "acc_0000000000001"
392
+
393
+ Razorpay::Account.upload_account_doc(account_id,{
394
+ "file": File.new("/Users/your_name/Downloads/sample_uploaded.jpeg"),
395
+ "document_type": "business_proof_url"
396
+ })
397
+
398
+ ```
399
+
400
+ **Parameters:**
401
+
402
+ | Name | Type | Description |
403
+ |-------------|-------------|---------------------------------------------|
404
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
405
+ | file* | string | The URL generated once the business proof document is uploaded. |
406
+ | document_type* | string | The documents valid for the proof type to be shared. Possible values : <br> business_proof_of_identification: `shop_establishment_certificate`, `gst_certificate`, `msme_certificate`, `business_proof_url`, `business_pan_url`, <br><br> additional_documents : `form_12_a_url`, `form_80g_url`, `cancelled_cheque` |
407
+
408
+ **Response:**
409
+ ```json
410
+ {
411
+ "business_proof_of_identification": [
412
+ {
413
+ "type": "business_proof_url",
414
+ "url": "<https://rzp.io/i/bzDKbNg>"
415
+ }
416
+ ]
417
+ }
418
+ ```
419
+ -------------------------------------------------------------------------------------------------------
420
+
421
+ ### Fetch account documents
422
+ ```rb
423
+ account_id = "acc_0000000000001"
424
+
425
+ Razorpay::Account.fetch_account_doc(account_id)
426
+ ```
427
+
428
+ **Parameters:**
429
+
430
+ | Name | Type | Description |
431
+ |-------------|-------------|---------------------------------------------|
432
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
433
+
434
+ **Response:**
435
+ ```json
436
+ {
437
+ "business_proof_of_identification": [
438
+ {
439
+ "type": "business_proof_url",
440
+ "url": "<https://rzp.io/i/bzDKbNg>"
441
+ }
442
+ ]
443
+ }
444
+ ```
445
+ -------------------------------------------------------------------------------------------------------
446
+ **PN: * indicates mandatory fields**
447
+ <br>
448
+ <br>
449
+ **For reference click [here](https://razorpay.com/docs/api/partners/account-onboarding/)**
@@ -0,0 +1,191 @@
1
+ ## Addons
2
+
3
+ ```rb
4
+ require "razorpay"
5
+
6
+ Razorpay.setup('key_id', 'key_secret')
7
+ ```
8
+
9
+ ### Create an addon
10
+
11
+ ```rb
12
+ subscriptionId = "sub_JBELhNBHtTCyhh"
13
+
14
+ Razorpay::Addon.create(subscriptionId,{
15
+ "item":{
16
+ "name":"Extra appala (papadum)",
17
+ "amount":30000,
18
+ "currency":"INR",
19
+ "description":"1 extra oil fried appala with meals"
20
+ },
21
+ "quantity":2
22
+ })
23
+ ```
24
+
25
+ **Parameters:**
26
+
27
+ | Name | Type | Description |
28
+ |-------|-----------|--------------------------------------------------|
29
+ | subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
30
+ | items* | object | Details of the add-on you want to create. |
31
+ | quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |
32
+
33
+ **Response:**
34
+ ```json
35
+ {
36
+ "id":"ao_00000000000001",
37
+ "entity":"addon",
38
+ "item":{
39
+ "id":"item_00000000000001",
40
+ "active":true,
41
+ "name":"Extra appala (papadum)",
42
+ "description":"1 extra oil fried appala with meals",
43
+ "amount":30000,
44
+ "unit_amount":30000,
45
+ "currency":"INR",
46
+ "type":"addon",
47
+ "unit":null,
48
+ "tax_inclusive":false,
49
+ "hsn_code":null,
50
+ "sac_code":null,
51
+ "tax_rate":null,
52
+ "tax_id":null,
53
+ "tax_group_id":null,
54
+ "created_at":1581597318,
55
+ "updated_at":1581597318
56
+ },
57
+ "quantity":2,
58
+ "created_at":1581597318,
59
+ "subscription_id":"sub_00000000000001",
60
+ "invoice_id":null
61
+ }
62
+ ```
63
+ -------------------------------------------------------------------------------------------------------
64
+
65
+ ### Fetch all addons
66
+
67
+ ```rb
68
+ options = {"count": 2}
69
+
70
+ Razorpay::Addon.all(options)
71
+ ```
72
+
73
+ **Parameters:**
74
+
75
+ | Name | Type | Description |
76
+ |-------|-----------|--------------------------------------------------|
77
+ | from | timestamp | timestamp after which the payments were created |
78
+ | to | timestamp | timestamp before which the payments were created |
79
+ | count | integer | number of payments to fetch (default: 10) |
80
+ | skip | integer | number of payments to be skipped (default: 0) |
81
+
82
+ **Response:**
83
+ ```json
84
+ {
85
+ "entity": "collection",
86
+ "count": 1,
87
+ "items": [
88
+ {
89
+ "id": "ao_00000000000002",
90
+ "entity": "addon",
91
+ "item": {
92
+ "id": "item_00000000000002",
93
+ "active": true,
94
+ "name": "Extra sweet",
95
+ "description": "1 extra sweet of the day with meals",
96
+ "amount": 90000,
97
+ "unit_amount": 90000,
98
+ "currency": "INR",
99
+ "type": "addon",
100
+ "unit": null,
101
+ "tax_inclusive": false,
102
+ "hsn_code": null,
103
+ "sac_code": null,
104
+ "tax_rate": null,
105
+ "tax_id": null,
106
+ "tax_group_id": null,
107
+ "created_at": 1581597318,
108
+ "updated_at": 1581597318
109
+ },
110
+ "quantity": 1,
111
+ "created_at": 1581597318,
112
+ "subscription_id": "sub_00000000000001",
113
+ "invoice_id": "inv_00000000000001"
114
+ }
115
+ ]
116
+ }
117
+ ```
118
+ -------------------------------------------------------------------------------------------------------
119
+
120
+ ### Fetch an addon
121
+
122
+ ```rb
123
+ addonId = "ao_IrSY3UIqDRx7df"
124
+
125
+ Razorpay::Addon.fetch(addonId)
126
+ ```
127
+
128
+ **Parameters:**
129
+
130
+ | Name | Type | Description |
131
+ |-----------------|---------|------------------------------------|
132
+ | addonId* | string | addon id to be fetched |
133
+
134
+ **Response:**
135
+ ```json
136
+ {
137
+ "id":"ao_IrSY3UIqDRx7df",
138
+ "entity":"addon",
139
+ "item":{
140
+ "id":"item_00000000000001",
141
+ "active":true,
142
+ "name":"Extra appala (papadum)",
143
+ "description":"1 extra oil fried appala with meals",
144
+ "amount":30000,
145
+ "unit_amount":30000,
146
+ "currency":"INR",
147
+ "type":"addon",
148
+ "unit":null,
149
+ "tax_inclusive":false,
150
+ "hsn_code":null,
151
+ "sac_code":null,
152
+ "tax_rate":null,
153
+ "tax_id":null,
154
+ "tax_group_id":null,
155
+ "created_at":1581597318,
156
+ "updated_at":1581597318
157
+ },
158
+ "quantity":2,
159
+ "created_at":1581597318,
160
+ "subscription_id":"sub_00000000000001",
161
+ "invoice_id":null
162
+ }
163
+ ```
164
+ ----------------------------------------------------------------------------------------------------
165
+
166
+ ### Delete an addon
167
+
168
+ ```rb
169
+ addonId = "ao_IrSY3UIqDRx7df"
170
+
171
+ Razorpay::Addon.delete(addonId)
172
+ ```
173
+
174
+
175
+ **Parameters:**
176
+
177
+ | Name | Type | Description |
178
+ |-----------------|---------|------------------------------------------------------------------------------|
179
+ | addonId* | string | addon id to be deleted |
180
+
181
+ **Response:**
182
+
183
+ ```json
184
+ []
185
+ ```
186
+ -------------------------------------------------------------------------------------------------------
187
+
188
+ **PN: * indicates mandatory fields**
189
+ <br>
190
+ <br>
191
+ **For reference click [here](https://razorpay.com/docs/api/subscriptions/#add-ons)**