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,405 @@
1
+ ## Customer
2
+
3
+ ```rb
4
+ require "razorpay"
5
+
6
+ Razorpay.setup('key_id', 'key_secret')
7
+ ```
8
+
9
+ ### Create customer
10
+ ```rb
11
+ Razorpay::Customer.create({
12
+ "name": "Gaurav Kumar",
13
+ "contact": 9123456780,
14
+ "email": "gaurav.kumar@example.com",
15
+ "fail_existing": 0,
16
+ "gstin": "29XAbbA4369J1PA",
17
+ "notes": {
18
+ "notes_key_1": "Tea, Earl Grey, Hot",
19
+ "notes_key_2": "Tea, Earl Grey… decaf."
20
+ }
21
+ })
22
+ ```
23
+
24
+ **Parameters:**
25
+
26
+ | Name | Type | Description |
27
+ |---------------|-------------|---------------------------------------------|
28
+ | name* | string | Name of the customer |
29
+ | email | string | Email of the customer |
30
+ | contact | string | Contact number of the customer |
31
+ | fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `0` or `1`|
32
+ | gstin | string | Customer's GST number, if available. For example, `29XAbbA4369J1PA` |
33
+ | notes | object | A key-value pair |
34
+
35
+ **Response:**
36
+ ```json
37
+ {
38
+ "id" : "cust_1Aa00000000004",
39
+ "entity": "customer",
40
+ "name" : "Gaurav Kumar",
41
+ "email" : "gaurav.kumar@example.com",
42
+ "contact" : "9123456780",
43
+ "gstin": "29XAbbA4369J1PA",
44
+ "notes":{
45
+ "notes_key_1":"Tea, Earl Grey, Hot",
46
+ "notes_key_2":"Tea, Earl Grey… decaf."
47
+ },
48
+ "created_at ": 1234567890
49
+ }
50
+ ```
51
+
52
+ -------------------------------------------------------------------------------------------------------
53
+
54
+ ### Edit customer
55
+ ```rb
56
+ customerId = "cust_6vRXClWqnLhV14"
57
+
58
+ Razorpay::Customer.edit(customerId,{
59
+ "name": "Gaurav Kumar",
60
+ "email": "Gaurav.Kumar@example.com",
61
+ "contact": 9000000000
62
+ })
63
+ ```
64
+
65
+ **Parameters:**
66
+
67
+ | Name | Type | Description |
68
+ |---------------|-------------|---------------------------------------------|
69
+ | customerId* | string | The id of the customer to be updated |
70
+ | email | string | Email of the customer |
71
+ | name | string | Name of the customer |
72
+ | contact | string | Contact number of the customer |
73
+
74
+ **Response:**
75
+ ```json
76
+ {
77
+ "id": "cust_1Aa00000000003",
78
+ "entity": "customer",
79
+ "name": "Gaurav Kumar",
80
+ "email": "Gaurav.Kumar@example.com",
81
+ "contact": "9000000000",
82
+ "gstin": null,
83
+ "notes": {
84
+ "notes_key_1": "Tea, Earl Grey, Hot",
85
+ "notes_key_2": "Tea, Earl Grey… decaf."
86
+ },
87
+ "created_at": 1582033731
88
+ }
89
+ ```
90
+ -------------------------------------------------------------------------------------------------------
91
+
92
+ ### Fetch all customer
93
+ ```rb
94
+ options = {"count": 2}
95
+
96
+ Razorpay::Customer.all(options)
97
+ ```
98
+
99
+ **Parameters:**
100
+
101
+ | Name | Type | Description |
102
+ |---------------|-------------|---------------------------------------------|
103
+ | count | integer | number of payments to fetch (default: 10) |
104
+ | skip | integer | number of payments to be skipped (default: 0) |
105
+
106
+ **Response:**
107
+ ```json
108
+ {
109
+ "entity":"collection",
110
+ "count":1,
111
+ "items":[
112
+ {
113
+ "id":"cust_1Aa00000000001",
114
+ "entity":"customer",
115
+ "name":"Gaurav Kumar",
116
+ "email":"gaurav.kumar@example.com",
117
+ "contact":"9876543210",
118
+ "gstin":"29XAbbA4369J1PA",
119
+ "notes":{
120
+ "note_key_1":"September",
121
+ "note_key_2":"Make it so."
122
+ },
123
+ "created_at ":1234567890
124
+ }
125
+ ]
126
+ }
127
+ ```
128
+
129
+ -------------------------------------------------------------------------------------------------------
130
+
131
+ ### Fetch a customer
132
+ ```rb
133
+ customerId = "cust_6vRXClWqnLhV14"
134
+
135
+ Razorpay::Customer.fetch(customerId)
136
+ ```
137
+
138
+ **Parameters:**
139
+
140
+ | Name | Type | Description |
141
+ |---------------|-------------|---------------------------------------------|
142
+ | customerId* | string | The id of the customer to be fetched |
143
+
144
+ **Response:**
145
+ ```json
146
+ {
147
+ "id" : "cust_1Aa00000000001",
148
+ "entity": "customer",
149
+ "name" : "Saurav Kumar",
150
+ "email" : "Saurav.kumar@example.com",
151
+ "contact" : "+919000000000",
152
+ "gstin":"29XAbbA4369J1PA",
153
+ "notes" : [],
154
+ "created_at ": 1234567890
155
+ }
156
+ ```
157
+
158
+ -------------------------------------------------------------------------------------------------------
159
+
160
+ ### Add Bank Account of Customer
161
+
162
+ ```rb
163
+ customerId = "cust_N5mywh91sXB69O"
164
+
165
+ Razorpay::Customer.add_bank_account(customerId,{
166
+ "ifsc_code": "UTIB0000194",
167
+ "account_number": "916010082985661",
168
+ "beneficiary_name": "Pratheek",
169
+ "beneficiary_address1": "address 1",
170
+ "beneficiary_address2": "address 2",
171
+ "beneficiary_address3": "address 3",
172
+ "beneficiary_address4": "address 4",
173
+ "beneficiary_email": "random@email.com",
174
+ "beneficiary_mobile": "8762489310",
175
+ "beneficiary_city": "Bangalore",
176
+ "beneficiary_state": "KA",
177
+ "beneficiary_country": "IN"
178
+ })
179
+ ```
180
+
181
+ **Parameters:**
182
+
183
+ | Name | Type | Description |
184
+ |----------------------|----------|----------------------------------------------------------------------------|
185
+ | customerId* | string | Unique identifier of the customer. |
186
+ | account_number | string | Customer's bank account number. For example, `0002020000304030434`. |
187
+ | beneficiary_name | string | The name of the beneficiary associated with the bank account. |
188
+ | beneficiary_address1 | string | The virtual payment address. |
189
+ | beneficiary_email | string | Email address of the beneficiary. For example, `gaurav.kumar@example.com`. |
190
+ | beneficiary_mobile | integer | Mobile number of the beneficiary. |
191
+ | beneficiary_city | string | The name of the city of the beneficiary. |
192
+ | beneficiary_state | string | The state of the beneficiary. |
193
+ | beneficiary_country | string | The country of the beneficiary. |
194
+ | beneficiary_pin | interger | The pin code of the beneficiary's address. |
195
+ | ifsc_code | string | The IFSC code of the bank branch associated with the account. |
196
+
197
+ **Response:**
198
+ ```json
199
+ {
200
+ "id": "ba_LSZht1Cm7xFTwF",
201
+ "entity": "bank_account",
202
+ "ifsc": "ICIC0001207",
203
+ "bank_name": "ICICI Bank",
204
+ "name": "Gaurav Kumar",
205
+ "notes": [],
206
+ "account_number": "XXXXXXXXXXXXXXX0434"
207
+ }
208
+ ```
209
+
210
+ -------------------------------------------------------------------------------------------------------
211
+
212
+ ### Delete Bank Account of Customer
213
+
214
+ ```rb
215
+ customerId = "cust_N5mywh91sXB69O"
216
+
217
+ bankAccountId = "ba_N6aM8uo64IzxHu"
218
+
219
+ Razorpay::Customer.delete_bank_account(customerId, bankAccountId)
220
+ ```
221
+
222
+ **Parameters:**
223
+
224
+ | Name | Type | Description |
225
+ |---------------|-----------|-------------------------------------------------------------------|
226
+ | customerId* | string | Customer id of the customer whose bank account is to be deleted. |
227
+ | bankAccountId | string | The bank_id that needs to be deleted. |
228
+
229
+ **Response:**
230
+ ```json
231
+ {
232
+ "id": "ba_Evg09Ll05SIPSD",
233
+ "ifsc": "ICIC0001207",
234
+ "bank_name": "ICICI Bank",
235
+ "name": "Test R4zorpay",
236
+ "account_number": "XXXXXXXXXXXXXXX0434",
237
+ "status": "deleted"
238
+ }
239
+ ```
240
+
241
+ -------------------------------------------------------------------------------------------------------
242
+
243
+ ### Eligibility Check API
244
+
245
+ ```rb
246
+ Razorpay::Customer.request_eligibility_check({
247
+ "inquiry": "affordability",
248
+ "amount": 500,
249
+ "currency": "INR",
250
+ "customer": {
251
+ "id": "elig_xxxxxxxxxxxxx",
252
+ "contact": "+919999999999",
253
+ "ip": "105.106.107.108",
254
+ "referrer": "https://merchansite.com/example/paybill",
255
+ "user_agent": "Mozilla/5.0"
256
+ }
257
+ })
258
+ ```
259
+
260
+ **Parameters:**
261
+
262
+ | Name | Type | Description |
263
+ |-------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
264
+ | inquiry | string | List of methods or instruments on which eligibility check is required. Possible value is `affordability`. |
265
+ | amount* | integer | The amount for which the order was created, in currency subunits. For example, for an amount of ₹295, enter `29500`. The user makes a payment for this amount against the order; hence, eligibility is checked for the amount. |
266
+ | currency* | string | A three-letter ISO code for the currency in which you want to accept the payment. Possible value is `INR`. |
267
+ | customer* | object | Customer details. [here](https://razorpay.com/docs/payments/payment-gateway/affordability/eligibility-check/#eligibility-check-api) |
268
+ | instruments | object | Payment instruments on which an eligibility check is required. [here](https://razorpay.com/docs/payments/payment-gateway/affordability/eligibility-check/#eligibility-check-api) |
269
+
270
+
271
+ **Response:**
272
+ ```json
273
+ {
274
+ "amount": "500000",
275
+ "customer": {
276
+ "id": "KkBhM9EC1Y0HTm",
277
+ "contact": "+919999999999"
278
+ },
279
+ "instruments": [
280
+ {
281
+ "method": "emi",
282
+ "issuer": "HDFC",
283
+ "type": "debit",
284
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
285
+ "eligibility": {
286
+ "status": "eligible"
287
+ }
288
+ },
289
+ {
290
+ "method": "paylater",
291
+ "provider": "getsimpl",
292
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
293
+ "eligibility": {
294
+ "status": "eligible"
295
+ }
296
+ },
297
+ {
298
+ "method": "paylater",
299
+ "provider": "icic",
300
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
301
+ "eligibility": {
302
+ "status": "eligible"
303
+ }
304
+ },
305
+ {
306
+ "method": "cardless_emi",
307
+ "provider": "walnut369",
308
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
309
+ "eligibility": {
310
+ "status": "ineligible",
311
+ "error": {
312
+ "code": "GATEWAY_ERROR",
313
+ "description": "The customer has not been approved by the partner.",
314
+ "source": "business",
315
+ "step": "inquiry",
316
+ "reason": "user_not_approved"
317
+ }
318
+ }
319
+ },
320
+ {
321
+ "method": "cardless_emi",
322
+ "provider": "zestmoney",
323
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
324
+ "eligibility": {
325
+ "status": "ineligible",
326
+ "error": {
327
+ "code": "GATEWAY_ERROR",
328
+ "description": "The customer has exhausted their credit limit.",
329
+ "source": "business",
330
+ "step": "inquiry",
331
+ "reason": "credit_limit_exhausted"
332
+ }
333
+ }
334
+ },
335
+ {
336
+ "method": "paylater",
337
+ "provider": "lazypay",
338
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
339
+ "eligibility": {
340
+ "status": "ineligible",
341
+ "error": {
342
+ "code": "GATEWAY_ERROR",
343
+ "description": "The order amount is less than the minimum transaction amount.",
344
+ "source": "business",
345
+ "step": "inquiry",
346
+ "reason": "min_amt_required"
347
+ }
348
+ }
349
+ }
350
+ ]
351
+ }
352
+ ```
353
+
354
+ -------------------------------------------------------------------------------------------------------
355
+
356
+ ### Fetch Eligibility by id
357
+
358
+ ```rb
359
+ eligibilityId = "elig_F1cxDoHWD4fkQt"
360
+ Razorpay::Customer.fetch_eligibility(eligibilityId)
361
+ ```
362
+
363
+ **Parameters:**
364
+
365
+ | Name | Type | Description |
366
+ |---------------|-------------|--------------------------------------------------------------------|
367
+ | eligibilityId | string | The unique identifier of the eligibility request to be retrieved. |
368
+
369
+ **Response:**
370
+ ```json
371
+ {
372
+ "instruments": [
373
+ {
374
+ "method": "paylater",
375
+ "provider": "lazypay",
376
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
377
+ "eligibility": {
378
+ "status": "eligible"
379
+ }
380
+ },
381
+ {
382
+ "method": "paylater",
383
+ "provider": "getsimpl",
384
+ "eligibility_req_id": "elig_xxxxxxxxxxxxx",
385
+ "eligibility": {
386
+ "status": "ineligible",
387
+ "error": {
388
+ "code": "GATEWAY_ERROR",
389
+ "description": "The customer has exhausted their credit limit",
390
+ "source": "gateway",
391
+ "step": "inquiry",
392
+ "reason": "credit_limit_exhausted"
393
+ }
394
+ }
395
+ }
396
+ ]
397
+ }
398
+ ```
399
+
400
+ -------------------------------------------------------------------------------------------------------
401
+
402
+ **PN: * indicates mandatory fields**
403
+ <br>
404
+ <br>
405
+ **For reference click [here](https://razorpay.com/docs/api/customers/)**
@@ -0,0 +1,301 @@
1
+ ## Document
2
+
3
+ ### Fetch All Disputes
4
+
5
+ ```rb
6
+ Razorpay::Dispute.all()
7
+ ```
8
+
9
+ **Response:**
10
+ ```json
11
+ {
12
+ "entity": "collection",
13
+ "count": 1,
14
+ "items": [
15
+ {
16
+ "id": "disp_Esz7KAitoYM7PJ",
17
+ "entity": "dispute",
18
+ "payment_id": "pay_EsyWjHrfzb59eR",
19
+ "amount": 10000,
20
+ "currency": "INR",
21
+ "amount_deducted": 0,
22
+ "reason_code": "pre_arbitration",
23
+ "respond_by": 1590604200,
24
+ "status": "open",
25
+ "phase": "pre_arbitration",
26
+ "created_at": 1590059211,
27
+ "evidence": {
28
+ "amount": 10000,
29
+ "summary": null,
30
+ "shipping_proof": null,
31
+ "billing_proof": null,
32
+ "cancellation_proof": null,
33
+ "customer_communication": null,
34
+ "proof_of_service": null,
35
+ "explanation_letter": null,
36
+ "refund_confirmation": null,
37
+ "access_activity_log": null,
38
+ "refund_cancellation_policy": null,
39
+ "term_and_conditions": null,
40
+ "others": null,
41
+ "submitted_at": null
42
+ }
43
+ }
44
+ ]
45
+ }
46
+ ```
47
+ -------------------------------------------------------------------------------------------------------
48
+
49
+ ### Fetch a Dispute
50
+
51
+ ```rb
52
+ disputeId = "disp_0000000000000"
53
+
54
+ Razorpay::Dispute.fetch(disputeId)
55
+ ```
56
+
57
+ **Parameters:**
58
+
59
+ | Name | Type | Description |
60
+ |-------------|--------|--------------------------------------------------|
61
+ | disputeId* | string | The unique identifier of the dispute. |
62
+
63
+ **Response:**
64
+ ```json
65
+ {
66
+ "id": "disp_AHfqOvkldwsbqt",
67
+ "entity": "dispute",
68
+ "payment_id": "pay_EsyWjHrfzb59eR",
69
+ "amount": 10000,
70
+ "currency": "INR",
71
+ "amount_deducted": 0,
72
+ "reason_code": "pre_arbitration",
73
+ "respond_by": 1590604200,
74
+ "status": "open",
75
+ "phase": "pre_arbitration",
76
+ "created_at": 1590059211,
77
+ "evidence": {
78
+ "amount": 10000,
79
+ "summary": "goods delivered",
80
+ "shipping_proof": null,
81
+ "billing_proof": null,
82
+ "cancellation_proof": null,
83
+ "customer_communication": null,
84
+ "proof_of_service": null,
85
+ "explanation_letter": null,
86
+ "refund_confirmation": null,
87
+ "access_activity_log": null,
88
+ "refund_cancellation_policy": null,
89
+ "term_and_conditions": null,
90
+ "others": null,
91
+ "submitted_at": null
92
+ }
93
+ }
94
+ ```
95
+ -------------------------------------------------------------------------------------------------------
96
+
97
+ ### Accept a Dispute
98
+
99
+ ```rb
100
+ disputeId = "disp_0000000000000"
101
+
102
+ Razorpay::Dispute.accept(disputeId)
103
+ ```
104
+
105
+ **Parameters:**
106
+
107
+ | Name | Type | Description |
108
+ |-------------|--------|--------------------------------------------------|
109
+ | disputeId* | string | The unique identifier of the dispute. |
110
+
111
+ **Response:**
112
+ ```json
113
+ {
114
+ "id": "disp_AHfqOvkldwsbqt",
115
+ "entity": "dispute",
116
+ "payment_id": "pay_EsyWjHrfzb59eR",
117
+ "amount": 10000,
118
+ "currency": "INR",
119
+ "amount_deducted": 10000,
120
+ "reason_code": "pre_arbitration",
121
+ "respond_by": 1590604200,
122
+ "status": "lost",
123
+ "phase": "pre_arbitration",
124
+ "created_at": 1590059211,
125
+ "evidence": {
126
+ "amount": 10000,
127
+ "summary": null,
128
+ "shipping_proof": null,
129
+ "billing_proof": null,
130
+ "cancellation_proof": null,
131
+ "customer_communication": null,
132
+ "proof_of_service": null,
133
+ "explanation_letter": null,
134
+ "refund_confirmation": null,
135
+ "access_activity_log": null,
136
+ "refund_cancellation_policy": null,
137
+ "term_and_conditions": null,
138
+ "others": null,
139
+ "submitted_at": null
140
+ }
141
+ }
142
+ ```
143
+ -------------------------------------------------------------------------------------------------------
144
+ ### Contest a Dispute (Draft)
145
+
146
+ ```rb
147
+ # Use this API sample code for draft
148
+
149
+ disputeId = "disp_0000000000000"
150
+
151
+ Razorpay::Dispute.contest(disputeId,{
152
+ "amount": 5000,
153
+ "summary": "goods delivered",
154
+ "shipping_proof": [
155
+ "doc_EFtmUsbwpXwBH9",
156
+ "doc_EFtmUsbwpXwBH8"
157
+ ],
158
+ "others": [
159
+ {
160
+ "type": "receipt_signed_by_customer",
161
+ "document_ids": [
162
+ "doc_EFtmUsbwpXwBH1",
163
+ "doc_EFtmUsbwpXwBH7"
164
+ ]
165
+ }
166
+ ],
167
+ "action": "draft"
168
+ })
169
+ ```
170
+
171
+ **Parameters:**
172
+
173
+ | Name | Type | Description |
174
+ |-----------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
175
+ | disputeId* | string | The unique identifier of the dispute. |
176
+ | amount | integer | The amount being contested. If the contest amount is not mentioned, we will assume it to be a full dispute contest. |
177
+ | summary | string | The explanation provided by you for contesting the dispute. It can have a maximum length of 1000 characters. |
178
+ | shipping_proof | array | List of document ids which serves as proof that the product was shipped to the customer at their provided address. It should show their complete shipping address, if possible. |
179
+ | others | array | All keys listed [here](https://razorpay.com/docs/api/disputes/contest) are supported |
180
+ | action | string | Possible value is `draft` or `submit` |
181
+
182
+ **Response:**
183
+ ```json
184
+ {
185
+ "id": "disp_AHfqOvkldwsbqt",
186
+ "entity": "dispute",
187
+ "payment_id": "pay_EsyWjHrfzb59eR",
188
+ "amount": 10000,
189
+ "currency": "INR",
190
+ "amount_deducted": 0,
191
+ "reason_code": "chargeback",
192
+ "respond_by": 1590604200,
193
+ "status": "open",
194
+ "phase": "chargeback",
195
+ "created_at": 1590059211,
196
+ "evidence": {
197
+ "amount": 5000,
198
+ "summary": "goods delivered",
199
+ "shipping_proof": [
200
+ "doc_EFtmUsbwpXwBH9",
201
+ "doc_EFtmUsbwpXwBH8"
202
+ ],
203
+ "billing_proof": null,
204
+ "cancellation_proof": null,
205
+ "customer_communication": null,
206
+ "proof_of_service": null,
207
+ "explanation_letter": null,
208
+ "refund_confirmation": null,
209
+ "access_activity_log": null,
210
+ "refund_cancellation_policy": null,
211
+ "term_and_conditions": null,
212
+ "others": [
213
+ {
214
+ "type": "receipt_signed_by_customer",
215
+ "document_ids": [
216
+ "doc_EFtmUsbwpXwBH1",
217
+ "doc_EFtmUsbwpXwBH7"
218
+ ]
219
+ }
220
+ ],
221
+ "submitted_at": null
222
+ }
223
+ }
224
+ ```
225
+
226
+ -------------------------------------------------------------------------------------------------------
227
+ ### Contest a Dispute (Submit)
228
+
229
+ ```rb
230
+ # Use this API sample code for submit
231
+
232
+ disputeId = "disp_0000000000000"
233
+
234
+ Razorpay::Dispute.contest(disputeId, {
235
+ "billing_proof": [
236
+ "doc_EFtmUsbwpXwBG9",
237
+ "doc_EFtmUsbwpXwBG8"
238
+ ],
239
+ "action": "submit"
240
+ })
241
+ ```
242
+
243
+ **Parameters:**
244
+
245
+ | Name | Type | Description |
246
+ |-----------------|---------|--------------------------------------------------------------------------------------|
247
+ | disputeId* | string | The unique identifier of the dispute. |
248
+ | billing_proof | integer | List of document ids which serves as proof of order confirmation, such as a receipt. |
249
+ | action | string | Possible value is `draft` or `submit` |
250
+
251
+ **Response:**
252
+ ```json
253
+ {
254
+ "id": "disp_AHfqOvkldwsbqt",
255
+ "entity": "dispute",
256
+ "payment_id": "pay_EsyWjHrfzb59eR",
257
+ "amount": 10000,
258
+ "currency": "INR",
259
+ "amount_deducted": 0,
260
+ "reason_code": "chargeback",
261
+ "respond_by": 1590604200,
262
+ "status": "under_review",
263
+ "phase": "chargeback",
264
+ "created_at": 1590059211,
265
+ "evidence": {
266
+ "amount": 5000,
267
+ "summary": "goods delivered",
268
+ "shipping_proof": [
269
+ "doc_EFtmUsbwpXwBH9",
270
+ "doc_EFtmUsbwpXwBH8"
271
+ ],
272
+ "billing_proof": [
273
+ "doc_EFtmUsbwpXwBG9",
274
+ "doc_EFtmUsbwpXwBG8"
275
+ ],
276
+ "cancellation_proof": null,
277
+ "customer_communication": null,
278
+ "proof_of_service": null,
279
+ "explanation_letter": null,
280
+ "refund_confirmation": null,
281
+ "access_activity_log": null,
282
+ "refund_cancellation_policy": null,
283
+ "term_and_conditions": null,
284
+ "others": [
285
+ {
286
+ "type": "receipt_signed_by_customer",
287
+ "document_ids": [
288
+ "doc_EFtmUsbwpXwBH1",
289
+ "doc_EFtmUsbwpXwBH7"
290
+ ]
291
+ }
292
+ ],
293
+ "submitted_at": 1590603200
294
+ }
295
+ }
296
+ ```
297
+ -------------------------------------------------------------------------------------------------------
298
+ **PN: * indicates mandatory fields**
299
+ <br>
300
+ <br>
301
+ **For reference click [here](https://razorpay.com/docs/api/documents)**