razorpay 2.4.1 → 3.0.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +8 -0
  3. data/.github/workflows/ruby.yml +38 -0
  4. data/CHANGELOG.md +19 -0
  5. data/README.md +29 -140
  6. data/documents/Invoice.md +531 -0
  7. data/documents/addon.md +169 -0
  8. data/documents/card.md +611 -0
  9. data/documents/customer.md +161 -0
  10. data/documents/emandate.md +484 -0
  11. data/documents/fund.md +87 -0
  12. data/documents/items.md +184 -0
  13. data/documents/order.md +230 -0
  14. data/documents/papernach.md +718 -0
  15. data/documents/payment.md +636 -0
  16. data/documents/paymentLink.md +1045 -0
  17. data/documents/paymentVerification.md +79 -0
  18. data/documents/plan.md +184 -0
  19. data/documents/qrcode.md +441 -0
  20. data/documents/refund.md +324 -0
  21. data/documents/registerEmandate.md +445 -0
  22. data/documents/registerNach.md +661 -0
  23. data/documents/settlement.md +477 -0
  24. data/documents/subscriptions.md +750 -0
  25. data/documents/tokens.md +208 -0
  26. data/documents/transfers.md +684 -0
  27. data/documents/upi.md +548 -0
  28. data/documents/virtualAccount.md +586 -0
  29. data/lib/razorpay/addon.rb +4 -0
  30. data/lib/razorpay/constants.rb +1 -1
  31. data/lib/razorpay/customer.rb +15 -0
  32. data/lib/razorpay/fund_account.rb +19 -0
  33. data/lib/razorpay/invoice.rb +8 -0
  34. data/lib/razorpay/item.rb +34 -0
  35. data/lib/razorpay/order.rb +10 -0
  36. data/lib/razorpay/payment.rb +52 -0
  37. data/lib/razorpay/payment_link.rb +36 -0
  38. data/lib/razorpay/qr_code.rb +34 -0
  39. data/lib/razorpay/refund.rb +4 -0
  40. data/lib/razorpay/request.rb +13 -6
  41. data/lib/razorpay/settlement.rb +39 -0
  42. data/lib/razorpay/subscription.rb +24 -0
  43. data/lib/razorpay/subscription_registration.rb +16 -0
  44. data/lib/razorpay/transfer.rb +35 -0
  45. data/lib/razorpay/utility.rb +7 -2
  46. data/lib/razorpay/virtual_account.rb +14 -6
  47. data/lib/razorpay.rb +7 -0
  48. data/test/fixtures/addon_collection.json +60 -0
  49. data/test/fixtures/create_json_payment.json +13 -0
  50. data/test/fixtures/delete_token.json +3 -0
  51. data/test/fixtures/downtimes_collection.json +21 -0
  52. data/test/fixtures/empty.json +2 -0
  53. data/test/fixtures/fake_addon.json +3 -3
  54. data/test/fixtures/fake_direct_transfer.json +32 -0
  55. data/test/fixtures/fake_downtime.json +14 -0
  56. data/test/fixtures/fake_fund_account.json +18 -0
  57. data/test/fixtures/fake_instant_settlement.json +19 -0
  58. data/test/fixtures/fake_item.json +9 -0
  59. data/test/fixtures/fake_order_transfers.json +88 -0
  60. data/test/fixtures/fake_otp_generate.json +19 -0
  61. data/test/fixtures/fake_otp_resend.json +7 -0
  62. data/test/fixtures/fake_otp_submit.json +5 -0
  63. data/test/fixtures/fake_payment_link.json +40 -0
  64. data/test/fixtures/fake_pending_update.json +30 -0
  65. data/test/fixtures/fake_qrcode.json +20 -0
  66. data/test/fixtures/fake_qrcode_close.json +22 -0
  67. data/test/fixtures/fake_recurring.json +5 -0
  68. data/test/fixtures/fake_refund.json +1 -1
  69. data/test/fixtures/fake_settlement.json +11 -0
  70. data/test/fixtures/fake_settlement_on_demand.json +39 -0
  71. data/test/fixtures/fake_subscription_pause.json +19 -0
  72. data/test/fixtures/fake_subscription_registration.json +91 -0
  73. data/test/fixtures/fake_subscription_resume.json +19 -0
  74. data/test/fixtures/fake_token.json +31 -0
  75. data/test/fixtures/fake_transfer.json +18 -0
  76. data/test/fixtures/fake_transfer_reverse.json +15 -0
  77. data/test/fixtures/fake_update_payment.json +39 -0
  78. data/test/fixtures/fake_virtual_account_allowed.json +46 -0
  79. data/test/fixtures/fake_virtual_account_receiver.json +46 -0
  80. data/test/fixtures/fund_collection.json +20 -0
  81. data/test/fixtures/item_collection.json +24 -0
  82. data/test/fixtures/payment_collection.json +1 -1
  83. data/test/fixtures/payment_link_collection.json +43 -0
  84. data/test/fixtures/payment_link_response.json +3 -0
  85. data/test/fixtures/qrcode_collection.json +50 -0
  86. data/test/fixtures/qrcode_payments_collection.json +74 -0
  87. data/test/fixtures/settlement_collection.json +26 -0
  88. data/test/fixtures/settlement_instant_collection.json +84 -0
  89. data/test/fixtures/settlement_report_collection.json +117 -0
  90. data/test/fixtures/success.json +3 -0
  91. data/test/fixtures/tokens_collection.json +36 -0
  92. data/test/fixtures/transfer_settlements_collection.json +38 -0
  93. data/test/fixtures/transfers_collection.json +41 -0
  94. data/test/razorpay/test_addon.rb +15 -15
  95. data/test/razorpay/test_customer.rb +27 -3
  96. data/test/razorpay/test_fund_account.rb +42 -0
  97. data/test/razorpay/test_invoice.rb +15 -2
  98. data/test/razorpay/test_item.rb +66 -0
  99. data/test/razorpay/test_order.rb +24 -1
  100. data/test/razorpay/test_payment.rb +184 -8
  101. data/test/razorpay/test_payment_link.rb +83 -0
  102. data/test/razorpay/test_plan.rb +2 -2
  103. data/test/razorpay/test_qr_code.rb +63 -0
  104. data/test/razorpay/test_refund.rb +16 -2
  105. data/test/razorpay/test_settlement.rb +76 -0
  106. data/test/razorpay/test_subscription.rb +72 -9
  107. data/test/razorpay/test_subscription_registration.rb +58 -0
  108. data/test/razorpay/test_transfer.rb +77 -0
  109. data/test/razorpay/test_utility.rb +32 -0
  110. data/test/razorpay/test_virtual_account.rb +64 -17
  111. data/test/test_helper.rb +6 -0
  112. metadata +138 -9
  113. data/.travis.yml +0 -22
  114. data/test/razorpay/test_errors.rb +0 -19
@@ -0,0 +1,531 @@
1
+ ## Invoices
2
+
3
+ ### Create Invoice
4
+
5
+ Request #1
6
+ In this example, an invoice is created using the customer and item details. Here, the customer and item are created while creating the invoice.
7
+ ```rb
8
+ Razorpay::Invoice.create({
9
+ "type": "invoice",
10
+ "description": "Invoice for the month of January 2020",
11
+ "partial_payment": true,
12
+ "customer": {
13
+ "name": "Gaurav Kumar",
14
+ "contact": 9999999999,
15
+ "email": "gaurav.kumar@example.com",
16
+ "billing_address": {
17
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
18
+ "line2": "Hosur Road",
19
+ "zipcode": 560068,
20
+ "city": "Bengaluru",
21
+ "state": "Karnataka",
22
+ "country": "in"
23
+ },
24
+ "shipping_address": {
25
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
26
+ "line2": "Hosur Road",
27
+ "zipcode": 560068,
28
+ "city": "Bengaluru",
29
+ "state": "Karnataka",
30
+ "country": "in"
31
+ }
32
+ },
33
+ "line_items": [
34
+ {
35
+ "name": "Master Cloud Computing in 30 Days",
36
+ "description": "Book by Ravena Ravenclaw",
37
+ "amount": 399,
38
+ "currency": "USD",
39
+ "quantity": 1
40
+ }
41
+ ],
42
+ "sms_notify": 1,
43
+ "email_notify": 1,
44
+ "currency": "USD",
45
+ "expire_by": 1589765167
46
+ })
47
+ ```
48
+
49
+ Request #2
50
+ In this example, an invoice is created using existing `customer_id` and `item_id`
51
+ ```rb
52
+ Razorpay::Invoice.create({
53
+ "type": "invoice",
54
+ "date": 1589994898,
55
+ "customer_id": "cust_E7q0trFqXgExmT",
56
+ "line_items": [
57
+ {
58
+ "item_id": "item_DRt61i2NnL8oy6"
59
+ }
60
+ ]
61
+ })
62
+ ```
63
+
64
+ **Parameters:**
65
+
66
+ | Name | Type | Description |
67
+ |-----------------|---------|------------------------------------------------------------------------------|
68
+ |type* | string | entity type (here its invoice) |
69
+ |description | string | A brief description of the invoice. |
70
+ |customer_id | string | customer id for which invoice need be raised |
71
+ |customer | object | customer details in a object format |
72
+
73
+ **Response:**
74
+ For create invoice response please click [here](https://razorpay.com/docs/api/invoices/#create-an-invoice)
75
+
76
+ -------------------------------------------------------------------------------------------------------
77
+
78
+ ### Fetch all invoices
79
+
80
+ ```rb
81
+ Razorpay::Invoice.all(options)
82
+ ```
83
+
84
+ **Parameters:**
85
+
86
+ | Name | Type | Description |
87
+ |-----------------|---------|------------------------------------------------------------------------------|
88
+ |type | string | entity type (here its invoice) |
89
+ |payment_id | string | The unique identifier of the payment made by the customer against the invoice. |
90
+ |customer_id | string | The unique identifier of the customer. |
91
+ |receipt | string | The unique receipt number that you entered for internal purposes. |
92
+
93
+ **Response:**
94
+ For fetch all invoice response please click [here](https://razorpay.com/docs/api/invoices/#fetch-multiple-invoices)
95
+
96
+ -------------------------------------------------------------------------------------------------------
97
+
98
+ ### Fetch invoice
99
+
100
+ ```rb
101
+ Razorpay::Invoice.fetch(invoiceId)
102
+ ```
103
+
104
+ **Parameters:**
105
+
106
+ | Name | Type | Description |
107
+ |-----------------|---------|------------------------------------------------------------------------------|
108
+ | invoiceId* | string | The id of the invoice to be fetched |
109
+
110
+ **Response:**
111
+ ```json
112
+ {
113
+ "id": "inv_E7q0tqkxBRzdau",
114
+ "entity": "invoice",
115
+ "receipt": null,
116
+ "invoice_number": null,
117
+ "customer_id": "cust_E7q0trFqXgExmT",
118
+ "customer_details": {
119
+ "id": "cust_E7q0trFqXgExmT",
120
+ "name": "Gaurav Kumar",
121
+ "email": "gaurav.kumar@example.com",
122
+ "contact": "9999999999",
123
+ "gstin": null,
124
+ "billing_address": {
125
+ "id": "addr_E7q0ttqh4SGhAC",
126
+ "type": "billing_address",
127
+ "primary": true,
128
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
129
+ "line2": "Hosur Road",
130
+ "zipcode": "560068",
131
+ "city": "Bengaluru",
132
+ "state": "Karnataka",
133
+ "country": "in"
134
+ },
135
+ "shipping_address": {
136
+ "id": "addr_E7q0ttKwVA1h2V",
137
+ "type": "shipping_address",
138
+ "primary": true,
139
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
140
+ "line2": "Hosur Road",
141
+ "zipcode": "560068",
142
+ "city": "Bengaluru",
143
+ "state": "Karnataka",
144
+ "country": "in"
145
+ },
146
+ "customer_name": "Gaurav Kumar",
147
+ "customer_email": "gaurav.kumar@example.com",
148
+ "customer_contact": "9999999999"
149
+ },
150
+ "order_id": "order_E7q0tvRpC0WJwg",
151
+ "line_items": [
152
+ {
153
+ "id": "li_E7q0tuPNg84VbZ",
154
+ "item_id": null,
155
+ "ref_id": null,
156
+ "ref_type": null,
157
+ "name": "Master Cloud Computing in 30 Days",
158
+ "description": "Book by Ravena Ravenclaw",
159
+ "amount": 399,
160
+ "unit_amount": 399,
161
+ "gross_amount": 399,
162
+ "tax_amount": 0,
163
+ "taxable_amount": 399,
164
+ "net_amount": 399,
165
+ "currency": "INR",
166
+ "type": "invoice",
167
+ "tax_inclusive": false,
168
+ "hsn_code": null,
169
+ "sac_code": null,
170
+ "tax_rate": null,
171
+ "unit": null,
172
+ "quantity": 1,
173
+ "taxes": []
174
+ }
175
+ ],
176
+ "payment_id": null,
177
+ "status": "issued",
178
+ "expire_by": 1589765167,
179
+ "issued_at": 1579765167,
180
+ "paid_at": null,
181
+ "cancelled_at": null,
182
+ "expired_at": null,
183
+ "sms_status": "pending",
184
+ "email_status": "pending",
185
+ "date": 1579765167,
186
+ "terms": null,
187
+ "partial_payment": true,
188
+ "gross_amount": 399,
189
+ "tax_amount": 0,
190
+ "taxable_amount": 399,
191
+ "amount": 399,
192
+ "amount_paid": 0,
193
+ "amount_due": 399,
194
+ "currency": "INR",
195
+ "currency_symbol": "₹",
196
+ "description": "Invoice for the month of January 2020",
197
+ "notes": [],
198
+ "comment": null,
199
+ "short_url": "https://rzp.io/i/2wxV8Xs",
200
+ "view_less": true,
201
+ "billing_start": null,
202
+ "billing_end": null,
203
+ "type": "invoice",
204
+ "group_taxes_discounts": false,
205
+ "created_at": 1579765167
206
+ }
207
+ ```
208
+ -------------------------------------------------------------------------------------------------------
209
+
210
+ ### Update invoice
211
+
212
+ ```rb
213
+ invoiceId = "inv_E7q0tqkxBRzdau"
214
+
215
+ para_attr = {
216
+ "line_items": [
217
+ {
218
+ "id": "li_JDb7pfe5VNwkZD",
219
+ "name": "Book / English August - Updated name and quantity",
220
+ "quantity": 1
221
+ },
222
+ {
223
+ "name": "Book / A Wild Sheep Chase",
224
+ "amount": 200,
225
+ "currency": "INR",
226
+ "quantity": 1
227
+ }
228
+ ],
229
+ "notes": {
230
+ "updated-key": "An updated note. done"
231
+ }
232
+ }
233
+
234
+ Razorpay::Invoice.edit(invoiceId,para_attr)
235
+ ```
236
+
237
+ **Parameters:**
238
+
239
+ | Name | Type | Description |
240
+ |-----------------|---------|------------------------------------------------------------------------------|
241
+ | invoiceId* | string | The id of the invoice to be fetched |
242
+
243
+ **Response:**
244
+ For update invoice response please click [here](https://razorpay.com/docs/api/invoices/#update-an-invoice)
245
+
246
+ -------------------------------------------------------------------------------------------------------
247
+
248
+ ### Issue an invoice
249
+
250
+ ```rb
251
+ Razorpay::Invoice.issue(invoiceId)
252
+ ```
253
+
254
+ **Parameters:**
255
+
256
+ | Name | Type | Description |
257
+ |-----------------|---------|------------------------------------------------------------------------------|
258
+ | invoiceId* | string | The id of the invoice to be issued |
259
+
260
+ **Response:**
261
+ ```json
262
+ {
263
+ "id": "inv_DAweOiQ7amIUVd",
264
+ "entity": "invoice",
265
+ "receipt": "#0961",
266
+ "invoice_number": "#0961",
267
+ "customer_id": "cust_DAtUWmvpktokrT",
268
+ "customer_details": {
269
+ "id": "cust_DAtUWmvpktokrT",
270
+ "name": "Gaurav Kumar",
271
+ "email": "gaurav.kumar@example.com",
272
+ "contact": "9977886633",
273
+ "gstin": null,
274
+ "billing_address": {
275
+ "id": "addr_DAtUWoxgu91obl",
276
+ "type": "billing_address",
277
+ "primary": true,
278
+ "line1": "318 C-Wing, Suyog Co. Housing Society Ltd.",
279
+ "line2": "T.P.S Road, Vazira, Borivali",
280
+ "zipcode": "400092",
281
+ "city": "Mumbai",
282
+ "state": "Maharashtra",
283
+ "country": "in"
284
+ },
285
+ "shipping_address": null,
286
+ "customer_name": "Gaurav Kumar",
287
+ "customer_email": "gaurav.kumar@example.com",
288
+ "customer_contact": "9977886633"
289
+ },
290
+ "order_id": "order_DBG3P8ZgDd1dsG",
291
+ "line_items": [
292
+ {
293
+ "id": "li_DAweOizsysoJU6",
294
+ "item_id": null,
295
+ "name": "Book / English August - Updated name and quantity",
296
+ "description": "150 points in Quidditch",
297
+ "amount": 400,
298
+ "unit_amount": 400,
299
+ "gross_amount": 400,
300
+ "tax_amount": 0,
301
+ "taxable_amount": 400,
302
+ "net_amount": 400,
303
+ "currency": "INR",
304
+ "type": "invoice",
305
+ "tax_inclusive": false,
306
+ "hsn_code": null,
307
+ "sac_code": null,
308
+ "tax_rate": null,
309
+ "unit": null,
310
+ "quantity": 1,
311
+ "taxes": []
312
+ },
313
+ {
314
+ "id": "li_DAwjWQUo07lnjF",
315
+ "item_id": null,
316
+ "name": "Book / A Wild Sheep Chase",
317
+ "description": null,
318
+ "amount": 200,
319
+ "unit_amount": 200,
320
+ "gross_amount": 200,
321
+ "tax_amount": 0,
322
+ "taxable_amount": 200,
323
+ "net_amount": 200,
324
+ "currency": "INR",
325
+ "type": "invoice",
326
+ "tax_inclusive": false,
327
+ "hsn_code": null,
328
+ "sac_code": null,
329
+ "tax_rate": null,
330
+ "unit": null,
331
+ "quantity": 1,
332
+ "taxes": []
333
+ }
334
+ ],
335
+ "payment_id": null,
336
+ "status": "issued",
337
+ "expire_by": 1567103399,
338
+ "issued_at": 1566974805,
339
+ "paid_at": null,
340
+ "cancelled_at": null,
341
+ "expired_at": null,
342
+ "sms_status": null,
343
+ "email_status": null,
344
+ "date": 1566891149,
345
+ "terms": null,
346
+ "partial_payment": false,
347
+ "gross_amount": 600,
348
+ "tax_amount": 0,
349
+ "taxable_amount": 600,
350
+ "amount": 600,
351
+ "amount_paid": 0,
352
+ "amount_due": 600,
353
+ "currency": "INR",
354
+ "currency_symbol": "₹",
355
+ "description": "This is a test invoice.",
356
+ "notes": {
357
+ "updated-key": "An updated note."
358
+ },
359
+ "comment": null,
360
+ "short_url": "https://rzp.io/i/K8Zg72C",
361
+ "view_less": true,
362
+ "billing_start": null,
363
+ "billing_end": null,
364
+ "type": "invoice",
365
+ "group_taxes_discounts": false,
366
+ "created_at": 1566906474,
367
+ "idempotency_key": null
368
+ }
369
+ ```
370
+ -------------------------------------------------------------------------------------------------------
371
+
372
+ ### Delete an invoice
373
+
374
+ ```rb
375
+ Razorpay::Invoice.delete(invoiceId)
376
+ ```
377
+
378
+ **Parameters:**
379
+
380
+ | Name | Type | Description |
381
+ |-----------------|---------|------------------------------------------------------------------------------|
382
+ | invoiceId* | string | The id of the invoice to be deleted |
383
+
384
+ **Response:**
385
+ ```
386
+ []
387
+ ```
388
+ -------------------------------------------------------------------------------------------------------
389
+
390
+ ### Cancel an invoice
391
+
392
+ ```rb
393
+ Razorpay::Invoice.cancel(invoiceId)
394
+ ```
395
+
396
+ **Parameters:**
397
+
398
+ | Name | Type | Description |
399
+ |-----------------|---------|------------------------------------------------------------------------------|
400
+ | invoiceId* | string | The id of the invoice to be cancelled |
401
+
402
+ **Response:**
403
+ ```json
404
+ {
405
+ "id": "inv_E7q0tqkxBRzdau",
406
+ "entity": "invoice",
407
+ "receipt": null,
408
+ "invoice_number": null,
409
+ "customer_id": "cust_E7q0trFqXgExmT",
410
+ "customer_details": {
411
+ "id": "cust_E7q0trFqXgExmT",
412
+ "name": "Gaurav Kumar",
413
+ "email": "gaurav.kumar@example.com",
414
+ "contact": "9972132594",
415
+ "gstin": null,
416
+ "billing_address": {
417
+ "id": "addr_E7q0ttqh4SGhAC",
418
+ "type": "billing_address",
419
+ "primary": true,
420
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
421
+ "line2": "Hosur Road",
422
+ "zipcode": "560068",
423
+ "city": "Bengaluru",
424
+ "state": "Karnataka",
425
+ "country": "in"
426
+ },
427
+ "shipping_address": {
428
+ "id": "addr_E7q0ttKwVA1h2V",
429
+ "type": "shipping_address",
430
+ "primary": true,
431
+ "line1": "Ground & 1st Floor, SJR Cyber Laskar",
432
+ "line2": "Hosur Road",
433
+ "zipcode": "560068",
434
+ "city": "Bengaluru",
435
+ "state": "Karnataka",
436
+ "country": "in"
437
+ },
438
+ "customer_name": "Gaurav Kumar",
439
+ "customer_email": "gaurav.kumar@example.com",
440
+ "customer_contact": "9972132594"
441
+ },
442
+ "order_id": "order_E7q0tvRpC0WJwg",
443
+ "line_items": [
444
+ {
445
+ "id": "li_E7q0tuPNg84VbZ",
446
+ "item_id": null,
447
+ "ref_id": null,
448
+ "ref_type": null,
449
+ "name": "Master Cloud Computing in 30 Days",
450
+ "description": "Book by Ravena Ravenclaw",
451
+ "amount": 399,
452
+ "unit_amount": 399,
453
+ "gross_amount": 399,
454
+ "tax_amount": 0,
455
+ "taxable_amount": 399,
456
+ "net_amount": 399,
457
+ "currency": "INR",
458
+ "type": "invoice",
459
+ "tax_inclusive": false,
460
+ "hsn_code": null,
461
+ "sac_code": null,
462
+ "tax_rate": null,
463
+ "unit": null,
464
+ "quantity": 1,
465
+ "taxes": []
466
+ }
467
+ ],
468
+ "payment_id": null,
469
+ "status": "cancelled",
470
+ "expire_by": null,
471
+ "issued_at": 1579765167,
472
+ "paid_at": null,
473
+ "cancelled_at": 1579768206,
474
+ "expired_at": null,
475
+ "sms_status": "sent",
476
+ "email_status": "sent",
477
+ "date": 1579765167,
478
+ "terms": null,
479
+ "partial_payment": false,
480
+ "gross_amount": 399,
481
+ "tax_amount": 0,
482
+ "taxable_amount": 399,
483
+ "amount": 399,
484
+ "amount_paid": 0,
485
+ "amount_due": 399,
486
+ "currency": "INR",
487
+ "currency_symbol": "₹",
488
+ "description": null,
489
+ "notes": [],
490
+ "comment": null,
491
+ "short_url": "https://rzp.io/i/2wxV8Xs",
492
+ "view_less": true,
493
+ "billing_start": null,
494
+ "billing_end": null,
495
+ "type": "invoice",
496
+ "group_taxes_discounts": false,
497
+ "created_at": 1579765167,
498
+ "idempotency_key": null
499
+ }
500
+ ```
501
+ -------------------------------------------------------------------------------------------------------
502
+
503
+ ### Send notification
504
+
505
+ ```rb
506
+ invoiceId = "inv_E7q0tqkxBRzdau"
507
+
508
+ medium = "email"
509
+
510
+ Razorpay::Invoice.notifyBy(invoiceId,medium)
511
+ ```
512
+
513
+ **Parameters:**
514
+
515
+ | Name | Type | Description |
516
+ |-----------------|---------|------------------------------------------------------------------------------|
517
+ | invoiceId* | string | The id of the invoice to be notified |
518
+ | medium* | string | `sms`/`email`, Medium through which notification should be sent. |
519
+
520
+ **Response:**
521
+ ```json
522
+ {
523
+ "success": true
524
+ }
525
+ ```
526
+ -------------------------------------------------------------------------------------------------------
527
+
528
+ **PN: * indicates mandatory fields**
529
+ <br>
530
+ <br>
531
+ **For reference click [here](https://razorpay.com/docs/api/invoices)**
@@ -0,0 +1,169 @@
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
+ **PN: * indicates mandatory fields**
167
+ <br>
168
+ <br>
169
+ **For reference click [here](https://razorpay.com/docs/api/subscriptions/#add-ons)**