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
@@ -0,0 +1,444 @@
1
+ ## Product Configuration
2
+
3
+ ### Request a Product Configuration
4
+ ```rb
5
+
6
+ accountId = "acc_GP4lfNA0iIMn5B"
7
+
8
+ Razorpay::Product.request_product_configuration(accountId, {
9
+ "product_name": "payment_gateway",
10
+ "tnc_accepted": true,
11
+ "ip": "233.233.233.234"
12
+ })
13
+ ```
14
+
15
+ **Parameters:**
16
+
17
+ | Name | Type | Description |
18
+ |---------------|-------------|---------------------------------------------|
19
+ | product_name* | string | The product(s) to be configured. Possible value is `payment_gateway`, `payment_links` |
20
+ | tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible values is `true` |
21
+ | ip | integer | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the `tnc_accepted` parameter when the `tnc` is accepted. |
22
+
23
+ **Response:**
24
+ ```json
25
+ {
26
+ "requested_configuration": {
27
+ "payment_methods": []
28
+ },
29
+ "active_configuration": {
30
+ "payment_capture": {
31
+ "mode": "automatic",
32
+ "refund_speed": "normal",
33
+ "automatic_expiry_period": 7200
34
+ },
35
+ "settlements": {
36
+ "account_number": null,
37
+ "ifsc_code": null,
38
+ "beneficiary_name": null
39
+ },
40
+ "checkout": {
41
+ "theme_color": "#FFFFFF",
42
+ "flash_checkout": true,
43
+ "logo": "https://example.com/your_logo"
44
+ },
45
+ "refund": {
46
+ "default_refund_speed": "normal"
47
+ },
48
+ "notifications": {
49
+ "whatsapp": true,
50
+ "sms": false,
51
+ "email": [
52
+ "b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
53
+ ]
54
+ },
55
+ "payment_methods": {
56
+ "netbanking": {
57
+ "enabled": true,
58
+ "instrument": [
59
+ {
60
+ "type": "retail",
61
+ "bank": [
62
+ "hdfc",
63
+ "sbin",
64
+ "utib",
65
+ "icic",
66
+ "scbl",
67
+ "yesb"
68
+ ]
69
+ }
70
+ ]
71
+ },
72
+ "wallet": {
73
+ "enabled": true,
74
+ "instrument": [
75
+ "airtelmoney",
76
+ "freecharge",
77
+ "jiomoney",
78
+ "olamoney",
79
+ "payzapp",
80
+ "mobikwik"
81
+ ]
82
+ },
83
+ "upi": {
84
+ "enabled": true,
85
+ "instrument": [
86
+ "upi"
87
+ ]
88
+ }
89
+ }
90
+ },
91
+ "requirements": [
92
+ {
93
+ "field_reference": "individual_proof_of_address",
94
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
95
+ "status": "required",
96
+ "reason_code": "document_missing"
97
+ },
98
+ {
99
+ "field_reference": "individual_proof_of_identification",
100
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
101
+ "status": "required",
102
+ "reason_code": "document_missing"
103
+ },
104
+ {
105
+ "field_reference": "business_proof_of_identification",
106
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
107
+ "status": "required",
108
+ "reason_code": "document_missing"
109
+ },
110
+ {
111
+ "field_reference": "settlements.beneficiary_name",
112
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
113
+ "status": "required",
114
+ "reason_code": "field_missing"
115
+ },
116
+ {
117
+ "field_reference": "settlements.account_number",
118
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
119
+ "status": "required",
120
+ "reason_code": "field_missing"
121
+ },
122
+ {
123
+ "field_reference": "settlements.ifsc_code",
124
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
125
+ "status": "required",
126
+ "reason_code": "field_missing"
127
+ },
128
+ {
129
+ "field_reference": "contact_name",
130
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
131
+ "status": "required",
132
+ "reason_code": "field_missing"
133
+ },
134
+ {
135
+ "field_reference": "name",
136
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
137
+ "status": "required",
138
+ "reason_code": "field_missing"
139
+ },
140
+ {
141
+ "field_reference": "customer_facing_business_name",
142
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
143
+ "status": "required",
144
+ "reason_code": "field_missing"
145
+ },
146
+ {
147
+ "field_reference": "kyc.pan",
148
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
149
+ "status": "required",
150
+ "reason_code": "field_missing"
151
+ }
152
+ ],
153
+ "tnc":{
154
+ "id": "tnc_IgohZaDBHRGjPv",
155
+ "accepted": true,
156
+ "accepted_at": 1641550798
157
+ },
158
+ "id": "acc_prd_HEgNpywUFctQ9e",
159
+ "account_id": "acc_HQVlm3bnPmccC0",
160
+ "product_name": "payment_gateway",
161
+ "activation_status": "needs_clarification",
162
+ "requested_at": 162547884
163
+ }
164
+ ```
165
+
166
+ -------------------------------------------------------------------------------------------------------
167
+
168
+ ### Edit a Product Configuration
169
+ ```rb
170
+ accountId = "acc_GP4lfNA0iIMn5B"
171
+ productId = "acc_prd_HEgNpywUFctQ9e"
172
+
173
+ Razorpay::Product.edit(accountId, productId, {
174
+ "notifications": {
175
+ "email": [
176
+ "gaurav.kumar@example.com",
177
+ "acd@gmail.com"
178
+ ]
179
+ },
180
+ "checkout": {
181
+ "theme_color": "#528FFF"
182
+ },
183
+ "refund": {
184
+ "default_refund_speed": "optimum"
185
+ },
186
+ "settlements": {
187
+ "account_number": "1234567890",
188
+ "ifsc_code": "HDFC0000317",
189
+ "beneficiary_name": "Gaurav Kumar"
190
+ },
191
+ "tnc_accepted": 1,
192
+ "ip": "233.233.233.234"
193
+ })
194
+ ```
195
+
196
+ **Parameters:**
197
+
198
+ | Name | Type | Description |
199
+ |---------------|-------------|---------------------------------------------|
200
+ | notifications | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
201
+ | checkout | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
202
+ | refund | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
203
+ | settlements | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
204
+ | tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible value is `true` |
205
+ | ip | string | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the tnc_accepted parameter when the `tnc` is accepted. |
206
+ | payment_methods | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
207
+ | type | string | Possible value is `domestic` |
208
+ | issuer | string | The card issuer. Possible values for issuer are `amex`, `dicl`, `maestro`, `mastercard`, `rupay`, `visa`. |
209
+ | wallet | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
210
+ | instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
211
+ | instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
212
+ | upi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
213
+ | instrument(upi) | string | The UPI service provider. Possible values are `google_pay`, `upi`|
214
+ | paylater | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
215
+ | instrument(emi) | string | The Paylater service provider. Possible values are `epaylater`, `getsimpl`|
216
+ | emi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
217
+
218
+ **Response:**
219
+ ```json
220
+ {
221
+ "id": "acc_GP4lfNA0iIMn5B",
222
+ "type": "standard",
223
+ "status": "created",
224
+ "email": "gauri@example.org",
225
+ "profile": {
226
+ "category": "healthcare",
227
+ "subcategory": "clinic",
228
+ "addresses": {
229
+ "registered": {
230
+ "street1": "507, Koramangala 1st block",
231
+ "street2": "MG Road-1",
232
+ "city": "Bengalore",
233
+ "state": "KARNATAKA",
234
+ "postal_code": "560034",
235
+ "country": "IN"
236
+ }
237
+ }
238
+ },
239
+ "notes": [],
240
+ "created_at": 1610603081,
241
+ "phone": "9000090000",
242
+ "reference_id": "randomId",
243
+ "business_type": "partnership",
244
+ "legal_business_name": "Acme Corp",
245
+ "customer_facing_business_name": "ABCD Ltd"
246
+ }
247
+ ```
248
+ -------------------------------------------------------------------------------------------------------
249
+
250
+ ### Fetch a product configuration
251
+ ```rb
252
+ accountId = "acc_GP4lfNA0iIMn5B"
253
+
254
+ productId = "acc_prd_HEgNpywUFctQ9e"
255
+
256
+ Razorpay::Product.fetch(accountId, productId)
257
+ ```
258
+
259
+ **Parameters:**
260
+
261
+ | Name | Type | Description |
262
+ |-------------|-------------|---------------------------------------------|
263
+ | accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
264
+ | productId* | string | The unique identifier of a product generated by Razorpay. |
265
+
266
+ **Response:**
267
+ ```json
268
+ {
269
+ "requested_configuration": {
270
+ "payment_methods": []
271
+ },
272
+ "active_configuration": {
273
+ "payment_capture": {
274
+ "mode": "automatic",
275
+ "refund_speed": "normal",
276
+ "automatic_expiry_period": 7200
277
+ },
278
+ "settlements": {
279
+ "account_number": null,
280
+ "ifsc_code": null,
281
+ "beneficiary_name": null
282
+ },
283
+ "checkout": {
284
+ "theme_color": "#FFFFFF",
285
+ "flash_checkout": true
286
+ },
287
+ "refund": {
288
+ "default_refund_speed": "normal"
289
+ },
290
+ "notifications": {
291
+ "whatsapp": true,
292
+ "sms": false,
293
+ "email": [
294
+ "b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
295
+ ]
296
+ },
297
+ "payment_methods": {
298
+ "netbanking": {
299
+ "enabled": true,
300
+ "instrument": [
301
+ {
302
+ "type": "retail",
303
+ "bank": [
304
+ "hdfc",
305
+ "sbin",
306
+ "utib",
307
+ "icic",
308
+ "scbl",
309
+ "yesb"
310
+ ]
311
+ }
312
+ ]
313
+ },
314
+ "wallet": {
315
+ "enabled": true,
316
+ "instrument": [
317
+ "airtelmoney",
318
+ "freecharge",
319
+ "jiomoney",
320
+ "olamoney",
321
+ "payzapp",
322
+ "mobikwik"
323
+ ]
324
+ },
325
+ "upi": {
326
+ "enabled": true,
327
+ "instrument": [
328
+ "upi"
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ "requirements": [
334
+ {
335
+ "field_reference": "individual_proof_of_address",
336
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
337
+ "status": "required",
338
+ "reason_code": "document_missing"
339
+ },
340
+ {
341
+ "field_reference": "individual_proof_of_identification",
342
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
343
+ "status": "required",
344
+ "reason_code": "document_missing"
345
+ },
346
+ {
347
+ "field_reference": "business_proof_of_identification",
348
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
349
+ "status": "required",
350
+ "reason_code": "document_missing"
351
+ },
352
+ {
353
+ "field_reference": "settlements.beneficiary_name",
354
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
355
+ "status": "required",
356
+ "reason_code": "field_missing"
357
+ },
358
+ {
359
+ "field_reference": "settlements.account_number",
360
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
361
+ "status": "required",
362
+ "reason_code": "field_missing"
363
+ },
364
+ {
365
+ "field_reference": "settlements.ifsc_code",
366
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
367
+ "status": "required",
368
+ "reason_code": "field_missing"
369
+ },
370
+ {
371
+ "field_reference": "contact_name",
372
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
373
+ "status": "required",
374
+ "reason_code": "field_missing"
375
+ },
376
+ {
377
+ "field_reference": "name",
378
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
379
+ "status": "required",
380
+ "reason_code": "field_missing"
381
+ },
382
+ {
383
+ "field_reference": "customer_facing_business_name",
384
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
385
+ "status": "required",
386
+ "reason_code": "field_missing"
387
+ },
388
+ {
389
+ "field_reference": "kyc.pan",
390
+ "resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
391
+ "status": "required",
392
+ "reason_code": "field_missing"
393
+ }
394
+ ],
395
+ "tnc":{
396
+ "id": "tnc_IgohZaDBHRGjPv",
397
+ "accepted": true,
398
+ "accepted_at": 1641550798
399
+ },
400
+ "id": "acc_prd_HEgNpywUFctQ9e",
401
+ "account_id": "acc_HQVlm3bnPmccC0",
402
+ "product_name": "payment_gateway",
403
+ "activation_status": "needs_clarification",
404
+ "requested_at": 1625478849
405
+ }
406
+ ```
407
+
408
+ -------------------------------------------------------------------------------------------------------
409
+
410
+ ### Fetch Terms and Conditions for a Sub-Merchant
411
+ ```rb
412
+
413
+ productName = "payments"
414
+
415
+ Razorpay::Product.fetch_tnc(productName)
416
+ ```
417
+
418
+ **Parameters:**
419
+
420
+ | Name | Type | Description |
421
+ |-------------|-------------|---------------------------------------------|
422
+ | productName* | string | The product family for which the relevant product to be requested for the sub-merchant. Possible value is `payments` |
423
+
424
+ **Response:**
425
+ ```json
426
+ {
427
+ "entity": "tnc_map",
428
+ "product_name": "payments",
429
+ "id": "tnc_map_HjOVhIdpVDZ0FB",
430
+ "tnc": {
431
+ "terms": "https://razorpay.com/terms",
432
+ "privacy": "https://razorpay.com/privacy",
433
+ "agreement": "https://razorpay.com/agreement"
434
+ },
435
+ "last_published_at": 1640589653
436
+ }
437
+ ```
438
+
439
+ -------------------------------------------------------------------------------------------------------
440
+
441
+ **PN: * indicates mandatory fields**
442
+ <br>
443
+ <br>
444
+ **For reference click [here](https://razorpay.com/docs/api/partners/product-configuration/)**
data/documents/qrcode.md CHANGED
@@ -37,7 +37,7 @@ Razorpay::QrCode.create(para_attr)
37
37
  | customer_id | string | Unique identifier of the customer the QR code is linked with |
38
38
  | description | string | A brief description about the QR code. |
39
39
  | close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
40
- | notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
40
+ | notes | object | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
41
41
 
42
42
  **Response:**
43
43
  ```json
@@ -105,8 +105,8 @@ Razorpay::QrCode.create(para_attr)
105
105
  | customer_id | string | Unique identifier of the customer the QR code is linked with |
106
106
  | description | string | A brief description about the QR code. |
107
107
  | close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
108
- | notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
109
- | tax_invoice | array | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. |
108
+ | notes | object | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
109
+ | tax_invoice | object | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. |
110
110
 
111
111
  **Response:**
112
112
  ```json
@@ -258,26 +258,24 @@ Razorpay::QrCode.all(para_attr)
258
258
  "count": 1,
259
259
  "items": [
260
260
  {
261
- "id": "qr_HMsgvioW64f0vh",
261
+ "id": "qr_HMsqRoeVwKbwAF",
262
262
  "entity": "qr_code",
263
- "created_at": 1623660959,
264
- "name": "Store_1",
265
- "usage": "single_use",
263
+ "created_at": 1623661499,
264
+ "name": "Fresh Groceries",
265
+ "usage": "multiple_use",
266
266
  "type": "upi_qr",
267
- "image_url": "https://rzp.io/i/DTa2eQR",
268
- "payment_amount": 300,
267
+ "image_url": "https://rzp.io/i/eI9XD54Q",
268
+ "payment_amount": null,
269
269
  "status": "active",
270
- "description": "For Store 1",
271
- "fixed_amount": true,
272
- "payments_amount_received": 0,
273
- "payments_count_received": 0,
274
- "notes": {
275
- "purpose": "Test UPI QR code notes"
276
- },
270
+ "description": "Buy fresh groceries",
271
+ "fixed_amount": false,
272
+ "payments_amount_received": 1000,
273
+ "payments_count_received": 1,
274
+ "notes": [],
277
275
  "customer_id": "cust_HKsR5se84c5LTO",
278
- "close_by": 1681615838,
279
- "closed_at" : null,
280
- "close_reason": null
276
+ "close_by": 1624472999,
277
+ "close_reason": "paid",
278
+ "tax_invoice": null
281
279
  }
282
280
  ]
283
281
  }
data/documents/refund.md CHANGED
@@ -31,7 +31,7 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr)
31
31
  | paymentId* | string | The id of the payment |
32
32
  | amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) | |
33
33
  | speed | string | Here, it must be normal |
34
- | notes | array | A key-value pair |
34
+ | notes | object | A key-value pair |
35
35
  | receipt | string | A unique identifier provided by you for your internal reference. |
36
36
 
37
37
  **Response:**
@@ -50,7 +50,8 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr)
50
50
  "created_at": 1597078866,
51
51
  "batch_id": null,
52
52
  "status": "processed",
53
- "speed_processed": "normal"
53
+ "speed_processed": "normal",
54
+ "speed_requested": "normal"
54
55
  }
55
56
  ```
56
57
  -------------------------------------------------------------------------------------------------------
@@ -115,11 +116,11 @@ Razorpay::Payment.fetch_multiple_refund(paymentId,option)
115
116
 
116
117
  | Name | Type | Description |
117
118
  |-------|-----------|--------------------------------------------------|
118
- | paymentId* | string | The id of the payment |
119
- | from | timestamp | timestamp after which the payments were created |
120
- | to | timestamp | timestamp before which the payments were created |
121
- | count | integer | number of payments to fetch (default: 10) |
122
- | skip | integer | number of payments to be skipped (default: 0) |
119
+ | paymentId* | string | The id of the payment for which refund has been requested. |
120
+ | from | timestamp | UNIX timestamp at which the refunds were created. |
121
+ | to | timestamp | UNIX timestamp till which the refunds were created. |
122
+ | count | integer | The number of refunds to fetch for the payment. |
123
+ | skip | integer | The number of refunds to be skipped for the payment. |
123
124
 
124
125
  **Refund:**
125
126
  ```json
@@ -164,8 +165,8 @@ Razorpay::Payment.fetch(paymentId).fetch_refund(refundId)
164
165
 
165
166
  | Name | Type | Description |
166
167
  |---------------|-------------|---------------------------------------------|
167
- | paymentId* | string | The id of the payment to be fetched |
168
- | refundId* | string | The id of the refund to be fetched |
168
+ | paymentId* | string | Unique identifier of the payment for which the refund has been made.|
169
+ | refundId* | string | Unique identifier of the refund to be retrieved. |
169
170
 
170
171
  **Response:**
171
172
  ```json
@@ -291,7 +292,7 @@ Razorpay::Refund.fetch(refundId).edit(para_attr)
291
292
  | Name | Type | Description |
292
293
  |-------|-----------|--------------------------------------------------|
293
294
  | refundId* | string | The id of the refund to be fetched |
294
- | notes* | array | A key-value pair |
295
+ | notes* | object | A key-value pair |
295
296
 
296
297
  **Response:**
297
298
  ```json
@@ -53,31 +53,33 @@ Razorpay::Customer.create(para_attr)
53
53
 
54
54
  ```rb
55
55
  para_attr = {
56
- "amount": 100,
56
+ "amount": 0,
57
57
  "currency": "INR",
58
58
  "method": "emandate",
59
- "receipt": "Receipt No. 5",
59
+ "customer_id": "cust_1Aa00000000001",
60
+ "receipt": "Receipt No. 1",
60
61
  "notes": {
61
- "note_key 1": "Beam me up Scotty",
62
- "note_key 2": "Engage"
62
+ "notes_key_1": "Beam me up Scotty",
63
+ "notes_key_2": "Engage"
63
64
  },
64
65
  "token": {
65
- "first_payment_amount": 10000,
66
+ "first_payment_amount": 100,
66
67
  "auth_type": "netbanking",
67
68
  "max_amount": 9999900,
68
69
  "expire_at": 4102444799,
69
70
  "notes": {
70
- "note_key 1": "Tea, Earl Grey decaf.",
71
- "note_key 2": "Tea. Earl Gray. Hot."
71
+ "notes_key_1": "Tea, Earl Grey, Hot",
72
+ "notes_key_2": "Tea, Earl Grey… decaf."
72
73
  },
73
74
  "bank_account": {
74
75
  "beneficiary_name": "Gaurav Kumar",
75
- "account_number": 11214311215411,
76
+ "account_number": "1121431121541121",
76
77
  "account_type": "savings",
77
- "ifsc_code": "HDFC0001233"
78
+ "ifsc_code": "HDFC0000001"
78
79
  }
79
80
  }
80
81
  }
82
+
81
83
  Razorpay::Order.create(para_attr)
82
84
  ```
83
85
 
@@ -147,7 +149,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
147
149
 
148
150
  | Name | Type | Description |
149
151
  |-----------------|---------|---------------------------------------------------------------|
150
- | customer | object | Details of the customer to whom the registration link will be sent. |
152
+ | customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link) are supported |
151
153
  | type* | object | the value is `link`. |
152
154
  | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
153
155
  | currency* | string | The currency of the payment (defaults to INR) |
@@ -161,6 +163,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
161
163
 
162
164
  **Response:**
163
165
  For create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link)
166
+
164
167
  -------------------------------------------------------------------------------------------------------
165
168
 
166
169
  ## Create an order to charge the customer
@@ -170,6 +173,7 @@ para_attr ={
170
173
  "amount": "100",
171
174
  "currency": "INR",
172
175
  "receipt": "Receipt No. 1",
176
+ "payment_capture": true,
173
177
  "notes": {
174
178
  "key1": "value3",
175
179
  "key2": "value2"
@@ -214,17 +218,20 @@ Razorpay::Order.create(para_attr)
214
218
  ```rb
215
219
  para_attr = {
216
220
  "email": "gaurav.kumar@example.com",
217
- "contact": 9123456789,
221
+ "contact": "9123456789",
218
222
  "amount": 1000,
219
223
  "currency": "INR",
220
- "recurring": 1,
224
+ "order_id": "order_1Aa00000000002",
225
+ "customer_id": "cust_1Aa00000000001",
226
+ "token": "token_1Aa00000000001",
227
+ "recurring": "1",
221
228
  "description": "Creating recurring payment for Gaurav Kumar",
222
229
  "notes": {
223
- "key1": "value3",
224
- "key2": "value2"
230
+ "note_key 1": "Beam me up Scotty",
231
+ "note_key 2": "Tea. Earl Gray. Hot."
225
232
  }
226
233
  }
227
- Razorpay::Payment.createRecurringPayment(para_attr)
234
+ Razorpay::Payment.create_recurring_payment(para_attr)
228
235
  ```
229
236
  **Parameters:**
230
237
 
@@ -258,7 +265,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
258
265
 
259
266
  medium = "email"
260
267
 
261
- Razorpay::Invoice.notifyBy(invoiceId, medium)
268
+ Razorpay::Invoice.notify_by(invoiceId, medium)
262
269
  ```
263
270
  **Parameters:**
264
271
 
@@ -369,7 +376,7 @@ For fetch token by payment id response please click [here](https://razorpay.com/
369
376
  ```rb
370
377
  customerId = "cust_1Aa00000000004"
371
378
 
372
- Razorpay::Customer.fetchTokens(customerId)
379
+ Razorpay::Customer.fetch(customerId).fetchTokens
373
380
  ```
374
381
  **Parameters:**
375
382
 
@@ -422,7 +429,7 @@ customerId = "cust_1Aa00000000004"
422
429
 
423
430
  tokenId = "token_Hxe0skTXLeg9pF"
424
431
 
425
- Razorpay::fetch(customerId).deleteToken(tokenId)
432
+ Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
426
433
  ```
427
434
  **Parameters:**
428
435