razorpay 2.4.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,684 @@
1
+ ## Transfers
2
+
3
+ ```rb
4
+ require "razorpay"
5
+ Razorpay.setup('key_id', 'key_secret')
6
+ ```
7
+
8
+ ### Create transfers from payment
9
+
10
+ ```rb
11
+
12
+ paymentId = "pay_E8JR8E0XyjUSZd"
13
+
14
+ para_attr = {
15
+ "transfers": [
16
+ {
17
+ "account": 'acc_HgzcrXeSLfNP9U',
18
+ "amount": 100,
19
+ "currency": "INR",
20
+ "notes": {
21
+ "name": "Gaurav Kumar",
22
+ "roll_no": "IEC2011025"
23
+ },
24
+ "linked_account_notes": [
25
+ "branch"
26
+ ],
27
+ "on_hold": 1,
28
+ "on_hold_until": 1671222870
29
+ }
30
+ ]
31
+ }
32
+
33
+ Razorpay::Payment.fetch(paymentId).transfer(para_attr)
34
+ ```
35
+
36
+ **Parameters:**
37
+
38
+ | Name | Type | Description |
39
+ |---------------|-------------|---------------------------------------------|
40
+ | paymentId* | string | The id of the payment to be fetched |
41
+ | transfers | object | All parameters listed [here](https://razorpay.com/docs/api/route/#create-transfers-from-payments) are supported |
42
+
43
+ **Response:**
44
+ ```json
45
+ {
46
+ "entity": "collection",
47
+ "count": 1,
48
+ "items": [
49
+ {
50
+ "id": "trf_E9uhYLFLLZ2pks",
51
+ "entity": "transfer",
52
+ "source": "pay_E8JR8E0XyjUSZd",
53
+ "recipient": "acc_CPRsN1LkFccllA",
54
+ "amount": 100,
55
+ "currency": "INR",
56
+ "amount_reversed": 0,
57
+ "notes": {
58
+ "name": "Gaurav Kumar",
59
+ "roll_no": "IEC2011025"
60
+ },
61
+ "on_hold": true,
62
+ "on_hold_until": 1671222870,
63
+ "recipient_settlement_id": null,
64
+ "created_at": 1580218356,
65
+ "linked_account_notes": [
66
+ "roll_no"
67
+ ],
68
+ "processed_at": 1580218357
69
+ }
70
+ ]
71
+ }
72
+ ```
73
+ -------------------------------------------------------------------------------------------------------
74
+
75
+ ### Create transfers from order
76
+
77
+ ```rb
78
+ para_attr = {
79
+ "amount": 2000,
80
+ "currency": "INR",
81
+ "transfers": [
82
+ {
83
+ "account": "acc_CPRsN1LkFccllA",
84
+ "amount": 1000,
85
+ "currency": "INR",
86
+ "notes": {
87
+ "branch": "Acme Corp Bangalore North",
88
+ "name": "Gaurav Kumar"
89
+ },
90
+ "linked_account_notes": [
91
+ "branch"
92
+ ],
93
+ "on_hold": 1,
94
+ "on_hold_until": 1671222870
95
+ },
96
+ {
97
+ "account": "acc_CNo3jSI8OkFJJJ",
98
+ "amount": 1000,
99
+ "currency": "INR",
100
+ "notes": {
101
+ "branch": "Acme Corp Bangalore South",
102
+ "name": "Saurav Kumar"
103
+ },
104
+ "linked_account_notes": [
105
+ "branch"
106
+ ],
107
+ "on_hold": 0
108
+ }
109
+ ]
110
+ }
111
+
112
+ Razorpay::Order.create(para_attr)
113
+ ```
114
+
115
+ **Parameters:**
116
+
117
+ | Name | Type | Description |
118
+ |---------------|-------------|---------------------------------------------|
119
+ | amount* | integer | The transaction amount, in paise |
120
+ | currency* | string | The currency of the payment (defaults to INR) |
121
+ | receipt | string | A unique identifier provided by you for your internal reference. |
122
+ | transfers["account"]* | string | The id of the account to be fetched |
123
+ | transfers["amount"]* | integer | The transaction amount, in paise |
124
+ | transfers["currency"]* | string | The currency of the payment (defaults to INR) |
125
+ | transfers["notes"] | object | Key-value pair that can be used to store additional |
126
+ | transfers["linked_account_notes"] | array | A key-value pair |
127
+ | transfers["on_hold"]* | boolean | Possible values is `0` or `1` |
128
+ | transfers["on_hold_until"] | integer | Timestamp, in Unix, that indicates until when the settlement of the transfer must be put on hold |
129
+
130
+ **Response:**
131
+ ```json
132
+ {
133
+ "id": "order_E9uTczH8uWPCyQ",
134
+ "entity": "order",
135
+ "amount": 2000,
136
+ "amount_paid": 0,
137
+ "amount_due": 2000,
138
+ "currency": "INR",
139
+ "receipt": null,
140
+ "offer_id": null,
141
+ "status": "created",
142
+ "attempts": 0,
143
+ "notes": [],
144
+ "created_at": 1580217565,
145
+ "transfers": [
146
+ {
147
+ "recipient": "acc_CPRsN1LkFccllA",
148
+ "amount": 1000,
149
+ "currency": "INR",
150
+ "notes": {
151
+ "branch": "Acme Corp Bangalore North",
152
+ "name": "Gaurav Kumar"
153
+ },
154
+ "linked_account_notes": [
155
+ "branch"
156
+ ],
157
+ "on_hold": true,
158
+ "on_hold_until": 1671222870
159
+ },
160
+ {
161
+ "recipient": "acc_CNo3jSI8OkFJJJ",
162
+ "amount": 1000,
163
+ "currency": "INR",
164
+ "notes": {
165
+ "branch": "Acme Corp Bangalore South",
166
+ "name": "Saurav Kumar"
167
+ },
168
+ "linked_account_notes": [
169
+ "branch"
170
+ ],
171
+ "on_hold": false,
172
+ "on_hold_until": null
173
+ }
174
+ ]
175
+ }
176
+ ```
177
+ -------------------------------------------------------------------------------------------------------
178
+
179
+ ### Direct transfers
180
+
181
+ ```rb
182
+ para_attr = {
183
+ "account": accountId,
184
+ "amount": 500,
185
+ "currency": "INR"
186
+ }
187
+
188
+ Razorpay::Transfer.create(para_attr)
189
+ ```
190
+
191
+ **Parameters:**
192
+
193
+ | Name | Type | Description |
194
+ |---------------|-------------|---------------------------------------------|
195
+ | accountId* | string | The id of the account to be fetched |
196
+ | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
197
+ | currency* | string | The currency of the payment (defaults to INR) |
198
+
199
+ **Response:**
200
+ ```json
201
+ {
202
+ "id": "trf_E9utgtfGTcpcmm",
203
+ "entity": "transfer",
204
+ "source": "acc_CJoeHMNpi0nC7k",
205
+ "recipient": "acc_CPRsN1LkFccllA",
206
+ "amount": 100,
207
+ "currency": "INR",
208
+ "amount_reversed": 0,
209
+ "notes": [],
210
+ "fees": 1,
211
+ "tax": 0,
212
+ "on_hold": false,
213
+ "on_hold_until": null,
214
+ "recipient_settlement_id": null,
215
+ "created_at": 1580219046,
216
+ "linked_account_notes": [],
217
+ "processed_at": 1580219046
218
+ }
219
+ ```
220
+ -------------------------------------------------------------------------------------------------------
221
+
222
+ ### Fetch transfer for a payment
223
+
224
+ ```rb
225
+ paymentId = "pay_E8JR8E0XyjUSZd"
226
+
227
+ Razorpay::Payment.fetch_transfer(paymentId)
228
+ ```
229
+
230
+ **Parameters:**
231
+
232
+ | Name | Type | Description |
233
+ |---------------|-------------|---------------------------------------------|
234
+ | paymentId* | string | The id of the payment to be fetched |
235
+
236
+ **Response:**
237
+ ```json
238
+ {
239
+ "entity": "collection",
240
+ "count": 1,
241
+ "items": [
242
+ {
243
+ "id": "trf_EAznuJ9cDLnF7Y",
244
+ "entity": "transfer",
245
+ "source": "pay_E9up5WhIfMYnKW",
246
+ "recipient": "acc_CMaomTz4o0FOFz",
247
+ "amount": 1000,
248
+ "currency": "INR",
249
+ "amount_reversed": 100,
250
+ "notes": [],
251
+ "fees": 3,
252
+ "tax": 0,
253
+ "on_hold": false,
254
+ "on_hold_until": null,
255
+ "recipient_settlement_id": null,
256
+ "created_at": 1580454666,
257
+ "linked_account_notes": [],
258
+ "processed_at": 1580454666
259
+ }
260
+ ]
261
+ }
262
+ ```
263
+ -------------------------------------------------------------------------------------------------------
264
+
265
+ ### Fetch transfer for an order
266
+
267
+ ```rb
268
+ orderId = "order_DSkl2lBNvueOly"
269
+
270
+ Razorpay::Order.fetch_transfer_order(orderId)
271
+ ```
272
+
273
+ **Parameters:**
274
+
275
+ | Name | Type | Description |
276
+ |---------------|-------------|---------------------------------------------|
277
+ | orderId* | string | The id of the order to be fetched |
278
+
279
+ **Response:**
280
+ ```json
281
+ {
282
+ "id": "order_DSkl2lBNvueOly",
283
+ "entity": "order",
284
+ "amount": 1000,
285
+ "amount_paid": 1000,
286
+ "amount_due": 0,
287
+ "currency": "INR",
288
+ "receipt": null,
289
+ "offer_id": null,
290
+ "status": "paid",
291
+ "attempts": 1,
292
+ "notes": [],
293
+ "created_at": 1570794714,
294
+ "transfers": {
295
+ "entity": "collection",
296
+ "count": 1,
297
+ "items": [
298
+ {
299
+ "id": "trf_DSkl2lXWbiADZG",
300
+ "entity": "transfer",
301
+ "source": "order_DSkl2lBNvueOly",
302
+ "recipient": "acc_CNo3jSI8OkFJJJ",
303
+ "amount": 500,
304
+ "currency": "INR",
305
+ "amount_reversed": 0,
306
+ "notes": {
307
+ "branch": "Acme Corp Bangalore North",
308
+ "name": "Gaurav Kumar"
309
+ },
310
+ "fees": 2,
311
+ "tax": 0,
312
+ "on_hold": true,
313
+ "on_hold_until": 1670776632,
314
+ "recipient_settlement_id": null,
315
+ "created_at": 1570794714,
316
+ "linked_account_notes": [
317
+ "Acme Corp Bangalore North"
318
+ ],
319
+ "processed_at": 1570794772
320
+ }
321
+ ]
322
+ }
323
+ }
324
+
325
+ ```
326
+ -------------------------------------------------------------------------------------------------------
327
+
328
+ ### Fetch transfer
329
+
330
+ ```rb
331
+ transferId = "trf_E7V62rAxJ3zYMo"
332
+
333
+ Razorpay::Transfer.fetch(transferId)
334
+ ```
335
+
336
+ **Parameters:**
337
+
338
+ | Name | Type | Description |
339
+ |---------------|-------------|---------------------------------------------|
340
+ | transferId* | string | The id of the transfer to be fetched |
341
+
342
+ **Response:**
343
+ ```json
344
+ {
345
+ "id": "trf_E7V62rAxJ3zYMo",
346
+ "entity": "transfer",
347
+ "source": "pay_E6j30Iu1R7XbIG",
348
+ "recipient": "acc_CMaomTz4o0FOFz",
349
+ "amount": 100,
350
+ "currency": "INR",
351
+ "amount_reversed": 0,
352
+ "notes": [],
353
+ "fees": 1,
354
+ "tax": 0,
355
+ "on_hold": false,
356
+ "on_hold_until": null,
357
+ "recipient_settlement_id": null,
358
+ "created_at": 1579691505,
359
+ "linked_account_notes": [],
360
+ "processed_at": 1579691505
361
+ }
362
+ ```
363
+ -------------------------------------------------------------------------------------------------------
364
+
365
+ ### Fetch transfers for a settlement
366
+
367
+ ```rb
368
+ recipientSettlementId = "setl_DHYJ3dRPqQkAgV"
369
+
370
+ Razorpay::Transfer.all({
371
+ "recipient_settlement_id": recipientSettlementId
372
+ })
373
+ ```
374
+
375
+ **Parameters:**
376
+
377
+ | Name | Type | Description |
378
+ |---------------|-------------|---------------------------------------------|
379
+ | recipientSettlementId* | string | The recipient settlement id obtained from the settlement.processed webhook payload. |
380
+
381
+ **Response:**
382
+ ```json
383
+ {
384
+ "entity": "collection",
385
+ "count": 1,
386
+ "items": [
387
+ {
388
+ "id": "trf_DGSTeXzBkEVh48",
389
+ "entity": "transfer",
390
+ "source": "pay_DGSRhvMbOqeCe7",
391
+ "recipient": "acc_CMaomTz4o0FOFz",
392
+ "amount": 500,
393
+ "currency": "INR",
394
+ "amount_reversed": 0,
395
+ "notes": [],
396
+ "fees": 2,
397
+ "tax": 0,
398
+ "on_hold": false,
399
+ "on_hold_until": null,
400
+ "recipient_settlement_id": "setl_DHYJ3dRPqQkAgV",
401
+ "created_at": 1568110256,
402
+ "linked_account_notes": [],
403
+ "processed_at": null
404
+ }
405
+ ]
406
+ }
407
+ ```
408
+ -------------------------------------------------------------------------------------------------------
409
+
410
+ ### Fetch settlement details
411
+
412
+ ```rb
413
+ Razorpay::Transfer.fetch_settlements
414
+ ```
415
+
416
+ **Response:**
417
+ ```json
418
+ {
419
+ "entity": "collection",
420
+ "count": 1,
421
+ "items": [
422
+ {
423
+ "id": "trf_DGSTeXzBkEVh48",
424
+ "entity": "transfer",
425
+ "source": "pay_DGSRhvMbOqeCe7",
426
+ "recipient": "acc_CMaomTz4o0FOFz",
427
+ "amount": 500,
428
+ "currency": "INR",
429
+ "amount_reversed": 0,
430
+ "notes": [],
431
+ "fees": 2,
432
+ "tax": 0,
433
+ "on_hold": false,
434
+ "on_hold_until": null,
435
+ "recipient_settlement_id": "setl_DHYJ3dRPqQkAgV",
436
+ "recipient_settlement": {
437
+ "id": "setl_DHYJ3dRPqQkAgV",
438
+ "entity": "settlement",
439
+ "amount": 500,
440
+ "status": "failed",
441
+ "fees": 0,
442
+ "tax": 0,
443
+ "utr": "CN0038699836",
444
+ "created_at": 1568349124
445
+ },
446
+ "created_at": 1568110256,
447
+ "linked_account_notes": [],
448
+ "processed_at": null
449
+ }
450
+ ]
451
+ }
452
+ ```
453
+ -------------------------------------------------------------------------------------------------------
454
+
455
+ ### Refund payments and reverse transfer from a linked account
456
+
457
+ ```rb
458
+ paymentId = "pay_EAdwQDe4JrhOFX"
459
+
460
+ para_attr = {
461
+ "amount" : 100,
462
+ "reverse_all" : 1
463
+ }
464
+
465
+ Razorpay::Payment.fetch(paymentId).refund(para_attr)
466
+ ```
467
+
468
+ **Parameters:**
469
+
470
+ | Name | Type | Description |
471
+ |---------------|-------------|---------------------------------------------|
472
+ | paymentId* | string | The id of the payment to be fetched |
473
+ | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
474
+ | reverse_all | boolean | Reverses transfer made to a linked account. Possible values:<br> * `1` - Reverses transfer made to a linked account.<br>* `0` - Does not reverse transfer made to a linked account.|
475
+
476
+ **Response:**
477
+ ```json
478
+ {
479
+ "id": "rfnd_EAzovSwG8jBnGf",
480
+ "entity": "refund",
481
+ "amount": 100,
482
+ "currency": "INR",
483
+ "payment_id": "pay_EAdwQDe4JrhOFX",
484
+ "notes": [],
485
+ "receipt": null,
486
+ "acquirer_data": {
487
+ "rrn": null
488
+ },
489
+ "created_at": 1580454723
490
+ }
491
+ ```
492
+ -------------------------------------------------------------------------------------------------------
493
+
494
+ ### Fetch payments of a linked account
495
+
496
+ ```rb
497
+ Razorpay.headers = {"X-Razorpay-Account" => "linkedAccountId"}
498
+
499
+ Razorpay::Payment.all
500
+ ```
501
+
502
+ **Parameters:**
503
+
504
+ | Name | Type | Description |
505
+ |---------------|-------------|---------------------------------------------|
506
+ | X-Razorpay-Account | string | The linked account id to fetch the payments received by linked account |
507
+
508
+ **Response:**
509
+ ```json
510
+ {
511
+ "entity": "collection",
512
+ "count": 2,
513
+ "items": [
514
+ {
515
+ "id": "pay_E9uth3WhYbh9QV",
516
+ "entity": "payment",
517
+ "amount": 100,
518
+ "currency": "INR",
519
+ "status": "captured",
520
+ "order_id": null,
521
+ "invoice_id": null,
522
+ "international": null,
523
+ "method": "transfer",
524
+ "amount_refunded": 0,
525
+ "refund_status": null,
526
+ "captured": true,
527
+ "description": null,
528
+ "card_id": null,
529
+ "bank": null,
530
+ "wallet": null,
531
+ "vpa": null,
532
+ "email": "",
533
+ "contact": null,
534
+ "notes": [],
535
+ "fee": 0,
536
+ "tax": 0,
537
+ "error_code": null,
538
+ "error_description": null,
539
+ "created_at": 1580219046
540
+ }
541
+ ]
542
+ }
543
+ ```
544
+ -------------------------------------------------------------------------------------------------------
545
+
546
+ ### Reverse transfers from all linked accounts
547
+
548
+ ```rb
549
+ transferId = "trf_EAznuJ9cDLnF7Y"
550
+
551
+ para_attr = {
552
+ "amount":100
553
+ }
554
+
555
+ Razorpay::Transfer.fetch(transferId).reverse(para_attr)
556
+ ```
557
+
558
+ **Parameters:**
559
+
560
+ | Name | Type | Description |
561
+ |---------------|-------------|---------------------------------------------|
562
+ | transferId* | string | The id of the transfer to be fetched |
563
+ | amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
564
+
565
+ **Response:**
566
+ ```json
567
+ {
568
+ "id": "rvrsl_EB0BWgGDAu7tOz",
569
+ "entity": "reversal",
570
+ "transfer_id": "trf_EAznuJ9cDLnF7Y",
571
+ "amount": 100,
572
+ "fee": 0,
573
+ "tax": 0,
574
+ "currency": "INR",
575
+ "notes": [],
576
+ "initiator_id": "CJoeHMNpi0nC7k",
577
+ "customer_refund_id": null,
578
+ "created_at": 1580456007
579
+ }
580
+ ```
581
+ -------------------------------------------------------------------------------------------------------
582
+
583
+ ### Hold settlements for transfers
584
+ ```rb
585
+
586
+ paymentId = "pay_EB1R2s8D4vOAKG"
587
+
588
+ para_attr = {
589
+ "transfers": [
590
+ {
591
+ "amount": 100,
592
+ "account": "acc_I0QRP7PpvaHhpB",
593
+ "currency": "INR",
594
+ "on_hold": 1
595
+ }
596
+ ]
597
+ }
598
+
599
+ Razorpay::Payment.fetch(paymentId).transfer(para_attr)
600
+ ```
601
+
602
+ **Parameters:**
603
+
604
+ | Name | Type | Description |
605
+ |---------------|-------------|---------------------------------------------|
606
+ | paymentId* | string | The id of the transfer to be fetched |
607
+ | transfers | array | All parameters listed here https://razorpay.com/docs/api/route/#hold-settlements-for-transfers are supported |
608
+
609
+ **Response:**
610
+ ```json
611
+ {
612
+ "entity": "collection",
613
+ "count": 1,
614
+ "items": [
615
+ {
616
+ "id": "trf_EB1VJ4Ux4GMmxQ",
617
+ "entity": "transfer",
618
+ "source": "pay_EB1R2s8D4vOAKG",
619
+ "recipient": "acc_CMaomTz4o0FOFz",
620
+ "amount": 100,
621
+ "currency": "INR",
622
+ "amount_reversed": 0,
623
+ "notes": [],
624
+ "fees": 1,
625
+ "tax": 0,
626
+ "on_hold": true,
627
+ "on_hold_until": null,
628
+ "recipient_settlement_id": null,
629
+ "created_at": 1580460652,
630
+ "linked_account_notes": [],
631
+ "processed_at": 1580460652
632
+ }
633
+ ]
634
+ }
635
+ ```
636
+ -------------------------------------------------------------------------------------------------------
637
+
638
+ ### Modify settlement hold for transfers
639
+ ```rb
640
+ paymentId = "pay_EAeSM2Xul8xYRo"
641
+
642
+ para_attr = {
643
+ "on_hold": "1",
644
+ "on_hold_until": "1679691505"
645
+ }
646
+ Razorpay::Transfer.fetch(transferId).edit(para_attr)
647
+ ```
648
+
649
+ **Parameters:**
650
+
651
+ | Name | Type | Description |
652
+ |---------------|-------------|---------------------------------------------|
653
+ | transferId* | string | The id of the transfer to be fetched |
654
+ | on_hold* | boolean | Possible values is `0` or `1` |
655
+ | on_hold_until | integer | Timestamp, in Unix, that indicates until when the settlement of the transfer must be put on hold |
656
+
657
+ **Response:**
658
+ ```json
659
+ {
660
+ "id": "trf_EB17rqOUbzSCEE",
661
+ "entity": "transfer",
662
+ "source": "pay_EAeSM2Xul8xYRo",
663
+ "recipient": "acc_CMaomTz4o0FOFz",
664
+ "amount": 100,
665
+ "currency": "INR",
666
+ "amount_reversed": 0,
667
+ "notes": [],
668
+ "fees": 1,
669
+ "tax": 0,
670
+ "on_hold": true,
671
+ "on_hold_until": 1679691505,
672
+ "recipient_settlement_id": null,
673
+ "created_at": 1580459321,
674
+ "linked_account_notes": [],
675
+ "processed_at": 1580459321
676
+ }
677
+ ```
678
+
679
+ -------------------------------------------------------------------------------------------------------
680
+
681
+ **PN: * indicates mandatory fields**
682
+ <br>
683
+ <br>
684
+ **For reference click [here](https://razorpay.com/docs/api/route/#transfers/)**