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,439 @@
1
+ ## Qr Codes
2
+
3
+ ```rb
4
+ require "razorpay"
5
+
6
+ Razorpay.setup('key_id', 'key_secret')
7
+ ```
8
+
9
+ ### Create Qr code
10
+
11
+ ```rb
12
+ para_attr = {
13
+ "type": "upi_qr",
14
+ "name": "Store_1",
15
+ "usage": "single_use",
16
+ "fixed_amount": true,
17
+ "payment_amount": 300,
18
+ "description": "For Store 1",
19
+ "customer_id": "cust_HKsR5se84c5LTO",
20
+ "close_by": 1681615838,
21
+ "notes": {
22
+ "purpose": "Test UPI QR code notes"
23
+ }
24
+ }
25
+ Razorpay::QrCode.create(para_attr)
26
+ ```
27
+
28
+ **Parameters:**
29
+
30
+ | Name | Type | Description |
31
+ |-----------------|---------|------------------------------------------------------------------------------|
32
+ | type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
33
+ | name | string | Label entered to identify the QR code. |
34
+ | usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
35
+ | fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
36
+ | payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
37
+ | customer_id | string | Unique identifier of the customer the QR code is linked with |
38
+ | description | string | A brief description about the QR code. |
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 | 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
+
42
+ **Response:**
43
+ ```json
44
+ {
45
+ "id": "qr_HMsVL8HOpbMcjU",
46
+ "entity": "qr_code",
47
+ "created_at": 1623660301,
48
+ "name": "Store_1",
49
+ "usage": "single_use",
50
+ "type": "upi_qr",
51
+ "image_url": "https://rzp.io/i/BWcUVrLp",
52
+ "payment_amount": 300,
53
+ "status": "active",
54
+ "description": "For Store 1",
55
+ "fixed_amount": true,
56
+ "payments_amount_received": 0,
57
+ "payments_count_received": 0,
58
+ "notes": {
59
+ "purpose": "Test UPI QR code notes"
60
+ },
61
+ "customer_id": "cust_HKsR5se84c5LTO",
62
+ "close_by": 1681615838
63
+ }
64
+ ```
65
+ -------------------------------------------------------------------------------------------------------
66
+
67
+ ### Create Qr code with GST
68
+
69
+ ```rb
70
+ para_attr = {
71
+ "type": "upi_qr",
72
+ "name": "Store_1",
73
+ "usage": "single_use",
74
+ "fixed_amount": true,
75
+ "payment_amount": 300,
76
+ "description": "For Store 1",
77
+ "customer_id": "cust_HKsR5se84c5LTO",
78
+ "close_by": 1681615838,
79
+ "notes": {
80
+ "purpose": "Test UPI QR code notes"
81
+ },
82
+ "tax_invoice": {
83
+ "number": "INV001",
84
+ "date": 1589994898,
85
+ "customer_name": "Gaurav Kumar",
86
+ "business_gstin": "06AABCU9605R1ZR",
87
+ "gst_amount": 4000,
88
+ "cess_amount": 0,
89
+ "supply_type": "interstate"
90
+ }
91
+ }
92
+
93
+ Razorpay::QrCode.create(para_attr)
94
+ ```
95
+
96
+ **Parameters:**
97
+
98
+ | Name | Type | Description |
99
+ |-----------------|---------|------------------------------------------------------------------------------|
100
+ | type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
101
+ | name | string | Label entered to identify the QR code. |
102
+ | usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
103
+ | fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
104
+ | payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
105
+ | customer_id | string | Unique identifier of the customer the QR code is linked with |
106
+ | description | string | A brief description about the QR code. |
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 | 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
+
111
+ **Response:**
112
+ ```json
113
+ {
114
+ "id": "qr_HMsVL8HOpbMcjU",
115
+ "entity": "qr_code",
116
+ "created_at": 1623660301,
117
+ "name": "Store_1",
118
+ "usage": "single_use",
119
+ "type": "upi_qr",
120
+ "image_url": "https://rzp.io/i/BWcUVrLp",
121
+ "payment_amount": 300,
122
+ "status": "active",
123
+ "description": "For Store 1",
124
+ "fixed_amount": true,
125
+ "payments_amount_received": 0,
126
+ "payments_count_received": 0,
127
+ "notes": {
128
+ "purpose": "Test UPI QR code notes"
129
+ },
130
+ "customer_id": "cust_HKsR5se84c5LTO",
131
+ "close_by": 1681615838,
132
+ "tax_invoice": {
133
+ "number": "INV001",
134
+ "date": 1589994898,
135
+ "customer_name": "Gaurav Kumar",
136
+ "business_gstin": "06AABCU9605R1ZR",
137
+ "gst_amount": 4000,
138
+ "cess_amount": 0,
139
+ "supply_type": "interstate"
140
+ }
141
+ }
142
+ ```
143
+ -------------------------------------------------------------------------------------------------------
144
+
145
+ ### Fetch all Qr code
146
+
147
+ ```rb
148
+ para_attr = {
149
+ "count": 1
150
+ }
151
+
152
+ Razorpay::QrCode.all(para_attr)
153
+ ```
154
+
155
+ **Parameters:**
156
+
157
+ | Name | Type | Description |
158
+ |-----------------|---------|------------------------------------------------------------------------------|
159
+ | from | timestamp | timestamp after which the payments were created |
160
+ | to | timestamp | timestamp before which the payments were created |
161
+ | count | integer | number of payments to fetch (default: 10) |
162
+ | skip | integer | number of payments to be skipped (default: 0) |
163
+
164
+ **Response:**
165
+ ```json
166
+ {
167
+ "entity": "collection",
168
+ "count": 1,
169
+ "items": [
170
+ {
171
+ "id": "qr_HO2jGkWReVBMNu",
172
+ "entity": "qr_code",
173
+ "created_at": 1623914648,
174
+ "name": "Store_1",
175
+ "usage": "single_use",
176
+ "type": "upi_qr",
177
+ "image_url": "https://rzp.io/i/w2CEwYmkAu",
178
+ "payment_amount": 300,
179
+ "status": "active",
180
+ "description": "For Store 1",
181
+ "fixed_amount": true,
182
+ "payments_amount_received": 0,
183
+ "payments_count_received": 0,
184
+ "notes": {
185
+ "purpose": "Test UPI QR code notes"
186
+ },
187
+ "customer_id": "cust_HKsR5se84c5LTO",
188
+ "close_by": 1681615838,
189
+ "closed_at": null,
190
+ "close_reason": null
191
+ }
192
+ ]
193
+ }
194
+ ```
195
+
196
+ -------------------------------------------------------------------------------------------------------
197
+
198
+ ### Fetch a Qr code
199
+
200
+ ```rb
201
+
202
+ qrCodeId = "qr_HO2r1MDprYtWRT"
203
+
204
+ Razorpay::QrCode.fetch(qrCodeId)
205
+ ```
206
+
207
+ **Parameters:**
208
+
209
+ | Name | Type | Description |
210
+ |-----------------|---------|------------------------------------------------------------------------------|
211
+ | qrCodeId* | string | The id of the qr code to be fetched |
212
+
213
+ **Response:**
214
+ ```json
215
+ {
216
+ "id": "qr_HO2r1MDprYtWRT",
217
+ "entity": "qr_code",
218
+ "created_at": 1623915088,
219
+ "name": "Store_1",
220
+ "usage": "single_use",
221
+ "type": "upi_qr",
222
+ "image_url": "https://rzp.io/i/oCswTOcCo",
223
+ "payment_amount": 300,
224
+ "status": "active",
225
+ "description": "For Store 1",
226
+ "fixed_amount": true,
227
+ "payments_amount_received": 0,
228
+ "payments_count_received": 0,
229
+ "notes": {
230
+ "purpose": "Test UPI QR code notes"
231
+ },
232
+ "customer_id": "cust_HKsR5se84c5LTO",
233
+ "close_by": 1681615838,
234
+ "closed_at": null,
235
+ "close_reason": null
236
+ }
237
+ ```
238
+ -------------------------------------------------------------------------------------------------------
239
+
240
+ ### Fetch a Qr code for customer id
241
+
242
+ ```rb
243
+ para_attr = {"customer_id":customerId}
244
+
245
+ Razorpay::QrCode.all(para_attr)
246
+ ```
247
+
248
+ **Parameters:**
249
+
250
+ | Name | Type | Description |
251
+ |-----------------|---------|------------------------------------------------------------------------------|
252
+ | customerId* | string | The id of the customer to which qr code need to be fetched |
253
+
254
+ **Response:**
255
+ ```json
256
+ {
257
+ "entity": "collection",
258
+ "count": 1,
259
+ "items": [
260
+ {
261
+ "id": "qr_HMsqRoeVwKbwAF",
262
+ "entity": "qr_code",
263
+ "created_at": 1623661499,
264
+ "name": "Fresh Groceries",
265
+ "usage": "multiple_use",
266
+ "type": "upi_qr",
267
+ "image_url": "https://rzp.io/i/eI9XD54Q",
268
+ "payment_amount": null,
269
+ "status": "active",
270
+ "description": "Buy fresh groceries",
271
+ "fixed_amount": false,
272
+ "payments_amount_received": 1000,
273
+ "payments_count_received": 1,
274
+ "notes": [],
275
+ "customer_id": "cust_HKsR5se84c5LTO",
276
+ "close_by": 1624472999,
277
+ "close_reason": "paid",
278
+ "tax_invoice": null
279
+ }
280
+ ]
281
+ }
282
+ ```
283
+ -------------------------------------------------------------------------------------------------------
284
+
285
+ ### Fetch a Qr code for payment id
286
+
287
+ ```rb
288
+
289
+ para_attr = {"payment_id":paymentId}
290
+
291
+ Razorpay::QrCode.all(para_attr)
292
+ ```
293
+
294
+ **Parameters:**
295
+
296
+ | Name | Type | Description |
297
+ |-----------------|---------|------------------------------------------------------------------------------|
298
+ | paymentId* | string | The id of the payment to which qr code need to be fetched |
299
+
300
+ **Response:**
301
+ ```json
302
+ {
303
+ "entity": "collection",
304
+ "count": 1,
305
+ "items": [
306
+ {
307
+ "id": "qr_HMsqRoeVwKbwAF",
308
+ "entity": "qr_code",
309
+ "created_at": 1623661499,
310
+ "name": "Fresh Groceries",
311
+ "usage": "multiple_use",
312
+ "type": "upi_qr",
313
+ "image_url": "https://rzp.io/i/eI9XD54Q",
314
+ "payment_amount": null,
315
+ "status": "active",
316
+ "description": "Buy fresh groceries",
317
+ "fixed_amount": false,
318
+ "payments_amount_received": 1000,
319
+ "payments_count_received": 1,
320
+ "notes": [],
321
+ "customer_id": "cust_HKsR5se84c5LTO",
322
+ "close_by": 1624472999,
323
+ "close_reason": null
324
+ }
325
+ ]
326
+ }
327
+ ```
328
+ -------------------------------------------------------------------------------------------------------
329
+
330
+ ### Fetch Payments for a QR Code
331
+
332
+ ```rb
333
+ para_attr = {
334
+ "count" : 1
335
+ }
336
+ Razorpay::QrCode.fetch(qrCodeId).fetch_payments(para_attr)
337
+ ```
338
+
339
+ **Parameters:**
340
+
341
+ | Name | Type | Description |
342
+ |-----------------|---------|------------------------------------------------------------------------------|
343
+ | qrCodeID* | string | The id of the qr code to which payment where made |
344
+ | from | timestamp | timestamp after which the payments were created |
345
+ | to | timestamp | timestamp before which the payments were created |
346
+ | count | integer | number of payments to fetch (default: 10) |
347
+ | skip | integer | number of payments to be skipped (default: 0) |
348
+
349
+ **Response:**
350
+ ```json
351
+ {
352
+ "entity": "collection",
353
+ "count": 1,
354
+ "items": [
355
+ {
356
+ "id": "pay_HMtDKn3TnF4D8x",
357
+ "entity": "payment",
358
+ "amount": 500,
359
+ "currency": "INR",
360
+ "status": "captured",
361
+ "order_id": null,
362
+ "invoice_id": null,
363
+ "international": false,
364
+ "method": "upi",
365
+ "amount_refunded": 0,
366
+ "refund_status": null,
367
+ "captured": true,
368
+ "description": "QRv2 Payment",
369
+ "card_id": null,
370
+ "bank": null,
371
+ "wallet": null,
372
+ "vpa": "gauri.kumari@okhdfcbank",
373
+ "email": "gauri.kumari@example.com",
374
+ "contact": "+919999999999",
375
+ "customer_id": "cust_HKsR5se84c5LTO",
376
+ "notes": [],
377
+ "fee": 0,
378
+ "tax": 0,
379
+ "error_code": null,
380
+ "error_description": null,
381
+ "error_source": null,
382
+ "error_step": null,
383
+ "error_reason": null,
384
+ "acquirer_data": {
385
+ "rrn": "116514257019"
386
+ },
387
+ "created_at": 1623662800
388
+ }
389
+ ]
390
+ }
391
+ ```
392
+ -------------------------------------------------------------------------------------------------------
393
+
394
+ ### Close a QR Code
395
+
396
+ ```rb
397
+ qrCodeId = "qr_HMsVL8HOpbMcjU"
398
+
399
+ Razorpay::QrCode.fetch(qrCodeId).close
400
+ ```
401
+
402
+ **Parameters:**
403
+
404
+ | Name | Type | Description |
405
+ |-----------------|---------|------------------------------------------------------------------------------|
406
+ | qrCodeID* | string | The id of the qr code to be closed |
407
+
408
+ **Response:**
409
+ ```json
410
+ {
411
+ "id": "qr_HMsVL8HOpbMcjU",
412
+ "entity": "qr_code",
413
+ "created_at": 1623660301,
414
+ "name": "Store_1",
415
+ "usage": "single_use",
416
+ "type": "upi_qr",
417
+ "image_url": "https://rzp.io/i/BWcUVrLp",
418
+ "payment_amount": 300,
419
+ "status": "closed",
420
+ "description": "For Store 1",
421
+ "fixed_amount": true,
422
+ "payments_amount_received": 0,
423
+ "payments_count_received": 0,
424
+ "notes": {
425
+ "purpose": "Test UPI QR code notes"
426
+ },
427
+ "customer_id": "cust_HKsR5se84c5LTO",
428
+ "close_by": 1681615838,
429
+ "closed_at": 1623660445,
430
+ "close_reason": "on_demand"
431
+ }
432
+ ```
433
+ -------------------------------------------------------------------------------------------------------
434
+
435
+
436
+ **PN: * indicates mandatory fields**
437
+ <br>
438
+ <br>
439
+ **For reference click [here](https://razorpay.com/docs/qr-codes/)**