razorpay 3.0.0 → 3.0.1

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.
@@ -43,31 +43,37 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr)
43
43
  **Response:**
44
44
  ```json
45
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
- ]
46
+ "id": "pay_DJiaO3iqUZaZrO",
47
+ "entity": "payment",
48
+ "amount": 5000,
49
+ "currency": "INR",
50
+ "status": "captured",
51
+ "order_id": null,
52
+ "invoice_id": null,
53
+ "international": false,
54
+ "method": "netbanking",
55
+ "amount_refunded": 0,
56
+ "refund_status": null,
57
+ "captured": true,
58
+ "description": "Credits towards consultation",
59
+ "card_id": null,
60
+ "bank": "UTIB",
61
+ "wallet": null,
62
+ "vpa": null,
63
+ "email": "void@razorpay.com",
64
+ "contact": "+919191919191",
65
+ "notes": [],
66
+ "fee": 171,
67
+ "tax": 26,
68
+ "error_code": null,
69
+ "error_description": null,
70
+ "error_source": null,
71
+ "error_step": null,
72
+ "error_reason": null,
73
+ "acquirer_data": {
74
+ "bank_transaction_id": "7909502"
75
+ },
76
+ "created_at": 1568822005
71
77
  }
72
78
  ```
73
79
  -------------------------------------------------------------------------------------------------------
@@ -119,59 +125,60 @@ Razorpay::Order.create(para_attr)
119
125
  | amount* | integer | The transaction amount, in paise |
120
126
  | currency* | string | The currency of the payment (defaults to INR) |
121
127
  | 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 |
128
+ | transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#create-transfers-from-orders) are supported |
129
129
 
130
130
  **Response:**
131
131
  ```json
132
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
- ]
133
+ "id": "order_Jhf1Sn06my7AUb",
134
+ "entity": "order",
135
+ "amount": 2000,
136
+ "amount_paid": 0,
137
+ "amount_due": 2000,
138
+ "currency": "INR",
139
+ "receipt": null,
140
+ "offer_id": "offer_JGQvQtvJmVDRIA",
141
+ "offers": [
142
+ "offer_JGQvQtvJmVDRIA"
143
+ ],
144
+ "status": "created",
145
+ "attempts": 0,
146
+ "notes": [],
147
+ "created_at": 1655272138,
148
+ "transfers": [
149
+ {
150
+ "id": "trf_Jhf1SpAYVIeRoP",
151
+ "entity": "transfer",
152
+ "status": "created",
153
+ "source": "order_Jhf1Sn06my7AUb",
154
+ "recipient": "acc_HjVXbtpSCIxENR",
155
+ "amount": 1000,
156
+ "currency": "INR",
157
+ "amount_reversed": 0,
158
+ "notes": {
159
+ "branch": "Acme Corp Bangalore North",
160
+ "name": "Gaurav Kumar"
161
+ },
162
+ "linked_account_notes": [
163
+ "branch"
164
+ ],
165
+ "on_hold": true,
166
+ "on_hold_until": 1671222870,
167
+ "recipient_settlement_id": null,
168
+ "created_at": 1655272138,
169
+ "processed_at": null,
170
+ "error": {
171
+ "code": null,
172
+ "description": null,
173
+ "reason": null,
174
+ "field": null,
175
+ "step": null,
176
+ "id": "trf_Jhf1SpAYVIeRoP",
177
+ "source": null,
178
+ "metadata": null
179
+ }
180
+ }
181
+ ]
175
182
  }
176
183
  ```
177
184
  -------------------------------------------------------------------------------------------------------
@@ -195,26 +202,41 @@ Razorpay::Transfer.create(para_attr)
195
202
  | accountId* | string | The id of the account to be fetched |
196
203
  | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
197
204
  | currency* | string | The currency of the payment (defaults to INR) |
205
+ | notes | object | | A key-value pair |
198
206
 
199
207
  **Response:**
200
208
  ```json
201
209
  {
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
210
+ "id":"trf_E9utgtfGTcpcmm",
211
+ "entity":"transfer",
212
+ "transfer_status":"pending",
213
+ "settlement_status":null,
214
+ "source":"acc_CJoeHMNpi0nC7k",
215
+ "recipient":"acc_CPRsN1LkFccllA",
216
+ "amount":100,
217
+ "currency":"INR",
218
+ "amount_reversed":0,
219
+ "notes":[
220
+
221
+ ],
222
+ "fees":1,
223
+ "tax":0,
224
+ "on_hold":false,
225
+ "on_hold_until":null,
226
+ "recipient_settlement_id":null,
227
+ "created_at":1580219046,
228
+ "linked_account_notes":[
229
+
230
+ ],
231
+ "processed_at":null,
232
+ "error":{
233
+ "code":null,
234
+ "description":null,
235
+ "field":null,
236
+ "source":null,
237
+ "step":null,
238
+ "reason":null
239
+ }
218
240
  }
219
241
  ```
220
242
  -------------------------------------------------------------------------------------------------------
@@ -224,7 +246,7 @@ Razorpay::Transfer.create(para_attr)
224
246
  ```rb
225
247
  paymentId = "pay_E8JR8E0XyjUSZd"
226
248
 
227
- Razorpay::Payment.fetch_transfer(paymentId)
249
+ Razorpay::Payment.fetch(paymentId).fetch_transfer
228
250
  ```
229
251
 
230
252
  **Parameters:**
@@ -279,44 +301,53 @@ Razorpay::Order.fetch_transfer_order(orderId)
279
301
  **Response:**
280
302
  ```json
281
303
  {
282
- "id": "order_DSkl2lBNvueOly",
304
+ "id": "order_I7waiV9PUGADuv",
283
305
  "entity": "order",
284
- "amount": 1000,
285
- "amount_paid": 1000,
306
+ "amount": 50000,
307
+ "amount_paid": 50000,
286
308
  "amount_due": 0,
287
309
  "currency": "INR",
288
- "receipt": null,
310
+ "receipt": "55",
289
311
  "offer_id": null,
290
312
  "status": "paid",
291
313
  "attempts": 1,
292
- "notes": [],
293
- "created_at": 1570794714,
314
+ "notes": {
315
+ "woocommerce_order_number": "55"
316
+ },
317
+ "created_at": 1633936677,
294
318
  "transfers": {
295
319
  "entity": "collection",
296
320
  "count": 1,
297
321
  "items": [
298
322
  {
299
- "id": "trf_DSkl2lXWbiADZG",
323
+ "id": "trf_I7waiajxgS5jWL",
300
324
  "entity": "transfer",
301
- "source": "order_DSkl2lBNvueOly",
302
- "recipient": "acc_CNo3jSI8OkFJJJ",
303
- "amount": 500,
325
+ "status": "processed",
326
+ "source": "order_I7waiV9PUGADuv",
327
+ "recipient": "acc_HalyQGZh9ZyiGg",
328
+ "amount": 10000,
304
329
  "currency": "INR",
305
330
  "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,
331
+ "fees": 12,
332
+ "tax": 2,
333
+ "notes": [],
334
+ "linked_account_notes": [],
335
+ "on_hold": false,
336
+ "on_hold_until": null,
337
+ "settlement_status": "pending",
314
338
  "recipient_settlement_id": null,
315
- "created_at": 1570794714,
316
- "linked_account_notes": [
317
- "Acme Corp Bangalore North"
318
- ],
319
- "processed_at": 1570794772
339
+ "created_at": 1633936677,
340
+ "processed_at": 1633936700,
341
+ "error": {
342
+ "code": null,
343
+ "description": null,
344
+ "reason": null,
345
+ "field": null,
346
+ "step": null,
347
+ "id": "trf_I7waiajxgS5jWL",
348
+ "source": null,
349
+ "metadata": null
350
+ }
320
351
  }
321
352
  ]
322
353
  }
@@ -342,22 +373,39 @@ Razorpay::Transfer.fetch(transferId)
342
373
  **Response:**
343
374
  ```json
344
375
  {
345
- "id": "trf_E7V62rAxJ3zYMo",
376
+ "id": "trf_JJD536GI6wuz3m",
346
377
  "entity": "transfer",
347
- "source": "pay_E6j30Iu1R7XbIG",
348
- "recipient": "acc_CMaomTz4o0FOFz",
349
- "amount": 100,
378
+ "status": "processed",
379
+ "source": "pay_JGmCgTEa9OTQcX",
380
+ "recipient": "acc_IRQWUleX4BqvYn",
381
+ "amount": 300,
350
382
  "currency": "INR",
351
383
  "amount_reversed": 0,
352
- "notes": [],
353
384
  "fees": 1,
354
385
  "tax": 0,
386
+ "notes": {
387
+ "name": "Saurav Kumar",
388
+ "roll_no": "IEC2011026"
389
+ },
390
+ "linked_account_notes": [
391
+ "roll_no"
392
+ ],
355
393
  "on_hold": false,
356
394
  "on_hold_until": null,
395
+ "settlement_status": "pending",
357
396
  "recipient_settlement_id": null,
358
- "created_at": 1579691505,
359
- "linked_account_notes": [],
360
- "processed_at": 1579691505
397
+ "created_at": 1649933574,
398
+ "processed_at": 1649933579,
399
+ "error": {
400
+ "code": null,
401
+ "description": null,
402
+ "reason": null,
403
+ "field": null,
404
+ "step": null,
405
+ "id": "trf_JJD536GI6wuz3m",
406
+ "source": null,
407
+ "metadata": null
408
+ }
361
409
  }
362
410
  ```
363
411
  -------------------------------------------------------------------------------------------------------
@@ -385,22 +433,34 @@ Razorpay::Transfer.all({
385
433
  "count": 1,
386
434
  "items": [
387
435
  {
388
- "id": "trf_DGSTeXzBkEVh48",
436
+ "id": "trf_HWjmkReRGPhguR",
389
437
  "entity": "transfer",
390
- "source": "pay_DGSRhvMbOqeCe7",
391
- "recipient": "acc_CMaomTz4o0FOFz",
392
- "amount": 500,
438
+ "status": "processed",
439
+ "source": "pay_HWjY9DZSMsbm5E",
440
+ "recipient": "acc_HWjl1kqobJzf4i",
441
+ "amount": 1000,
393
442
  "currency": "INR",
394
443
  "amount_reversed": 0,
395
- "notes": [],
396
- "fees": 2,
444
+ "fees": 3,
397
445
  "tax": 0,
446
+ "notes": [],
447
+ "linked_account_notes": [],
398
448
  "on_hold": false,
399
449
  "on_hold_until": null,
400
- "recipient_settlement_id": "setl_DHYJ3dRPqQkAgV",
401
- "created_at": 1568110256,
402
- "linked_account_notes": [],
403
- "processed_at": null
450
+ "settlement_status": "settled",
451
+ "recipient_settlement_id": "setl_HYIIk3H0J4PYdX",
452
+ "created_at": 1625812996,
453
+ "processed_at": 1625812996,
454
+ "error": {
455
+ "code": null,
456
+ "description": null,
457
+ "reason": null,
458
+ "field": null,
459
+ "step": null,
460
+ "id": "trf_HWjmkReRGPhguR",
461
+ "source": null,
462
+ "metadata": null
463
+ }
404
464
  }
405
465
  ]
406
466
  }
@@ -420,32 +480,35 @@ Razorpay::Transfer.fetch_settlements
420
480
  "count": 1,
421
481
  "items": [
422
482
  {
423
- "id": "trf_DGSTeXzBkEVh48",
483
+ "id": "trf_JnRRvcSbZb1VHN",
424
484
  "entity": "transfer",
425
- "source": "pay_DGSRhvMbOqeCe7",
426
- "recipient": "acc_CMaomTz4o0FOFz",
485
+ "status": "processed",
486
+ "source": "acc_HZbJUcl6DBDLIN",
487
+ "recipient": "acc_HjVXbtpSCIxENR",
427
488
  "amount": 500,
428
489
  "currency": "INR",
429
490
  "amount_reversed": 0,
430
- "notes": [],
431
- "fees": 2,
491
+ "fees": 1,
432
492
  "tax": 0,
493
+ "notes": [],
494
+ "linked_account_notes": [],
433
495
  "on_hold": false,
434
496
  "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
497
+ "settlement_status": null,
498
+ "recipient_settlement_id": null,
499
+ "recipient_settlement": null,
500
+ "created_at": 1656534379,
501
+ "processed_at": 1656534379,
502
+ "error": {
503
+ "code": null,
504
+ "description": null,
505
+ "reason": null,
506
+ "field": null,
507
+ "step": null,
508
+ "id": "trf_JnRRvcSbZb1VHN",
509
+ "source": null,
510
+ "metadata": null
511
+ }
449
512
  }
450
513
  ]
451
514
  }
@@ -458,8 +521,8 @@ Razorpay::Transfer.fetch_settlements
458
521
  paymentId = "pay_EAdwQDe4JrhOFX"
459
522
 
460
523
  para_attr = {
461
- "amount" : 100,
462
- "reverse_all" : 1
524
+ "amount": 100,
525
+ "reverse_all": 1
463
526
  }
464
527
 
465
528
  Razorpay::Payment.fetch(paymentId).refund(para_attr)
@@ -476,17 +539,21 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr)
476
539
  **Response:**
477
540
  ```json
478
541
  {
479
- "id": "rfnd_EAzovSwG8jBnGf",
542
+ "id": "rfnd_JJFNlNXPHY640A",
480
543
  "entity": "refund",
481
544
  "amount": 100,
482
545
  "currency": "INR",
483
- "payment_id": "pay_EAdwQDe4JrhOFX",
546
+ "payment_id": "pay_JJCqynf4fQS0N1",
484
547
  "notes": [],
485
548
  "receipt": null,
486
549
  "acquirer_data": {
487
- "rrn": null
550
+ "arn": null
488
551
  },
489
- "created_at": 1580454723
552
+ "created_at": 1649941680,
553
+ "batch_id": null,
554
+ "status": "processed",
555
+ "speed_processed": "normal",
556
+ "speed_requested": "normal"
490
557
  }
491
558
  ```
492
559
  -------------------------------------------------------------------------------------------------------
@@ -509,34 +576,40 @@ Razorpay::Payment.all
509
576
  ```json
510
577
  {
511
578
  "entity": "collection",
512
- "count": 2,
579
+ "count": 1,
513
580
  "items": [
514
581
  {
515
- "id": "pay_E9uth3WhYbh9QV",
582
+ "id": "pay_JJCqynf4fQS0N1",
516
583
  "entity": "payment",
517
- "amount": 100,
584
+ "amount": 10000,
518
585
  "currency": "INR",
519
586
  "status": "captured",
520
- "order_id": null,
587
+ "order_id": "order_JJCqnZG8f3754z",
521
588
  "invoice_id": null,
522
- "international": null,
523
- "method": "transfer",
589
+ "international": false,
590
+ "method": "netbanking",
524
591
  "amount_refunded": 0,
525
592
  "refund_status": null,
526
593
  "captured": true,
527
- "description": null,
594
+ "description": "#JJCqaOhFihfkVE",
528
595
  "card_id": null,
529
- "bank": null,
596
+ "bank": "YESB",
530
597
  "wallet": null,
531
598
  "vpa": null,
532
- "email": "",
533
- "contact": null,
599
+ "email": "john.example@example.com",
600
+ "contact": "+919820958250",
534
601
  "notes": [],
535
- "fee": 0,
536
- "tax": 0,
602
+ "fee": 236,
603
+ "tax": 36,
537
604
  "error_code": null,
538
605
  "error_description": null,
539
- "created_at": 1580219046
606
+ "error_source": null,
607
+ "error_step": null,
608
+ "error_reason": null,
609
+ "acquirer_data": {
610
+ "bank_transaction_id": "2118867"
611
+ },
612
+ "created_at": 1649932775
540
613
  }
541
614
  ]
542
615
  }
@@ -613,22 +686,31 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr)
613
686
  "count": 1,
614
687
  "items": [
615
688
  {
616
- "id": "trf_EB1VJ4Ux4GMmxQ",
689
+ "id": "trf_Jfm1KCF6w1oWgy",
617
690
  "entity": "transfer",
618
- "source": "pay_EB1R2s8D4vOAKG",
619
- "recipient": "acc_CMaomTz4o0FOFz",
691
+ "status": "pending",
692
+ "source": "pay_JXPULbHbkkkS8D",
693
+ "recipient": "acc_I0QRP7PpvaHhpB",
620
694
  "amount": 100,
621
695
  "currency": "INR",
622
696
  "amount_reversed": 0,
623
697
  "notes": [],
624
- "fees": 1,
625
- "tax": 0,
698
+ "linked_account_notes": [],
626
699
  "on_hold": true,
627
700
  "on_hold_until": null,
628
701
  "recipient_settlement_id": null,
629
- "created_at": 1580460652,
630
- "linked_account_notes": [],
631
- "processed_at": 1580460652
702
+ "created_at": 1654860101,
703
+ "processed_at": null,
704
+ "error": {
705
+ "code": null,
706
+ "description": null,
707
+ "reason": null,
708
+ "field": null,
709
+ "step": null,
710
+ "id": "trf_Jfm1KCF6w1oWgy",
711
+ "source": null,
712
+ "metadata": null
713
+ }
632
714
  }
633
715
  ]
634
716
  }
@@ -637,7 +719,7 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr)
637
719
 
638
720
  ### Modify settlement hold for transfers
639
721
  ```rb
640
- paymentId = "pay_EAeSM2Xul8xYRo"
722
+ transferId = "trf_JhemwjNekar9Za"
641
723
 
642
724
  para_attr = {
643
725
  "on_hold": "1",
@@ -657,22 +739,37 @@ Razorpay::Transfer.fetch(transferId).edit(para_attr)
657
739
  **Response:**
658
740
  ```json
659
741
  {
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
742
+ "entity": "collection",
743
+ "count": 1,
744
+ "items": [
745
+ {
746
+ "id": "trf_JhemwjNekar9Za",
747
+ "entity": "transfer",
748
+ "status": "pending",
749
+ "source": "pay_I7watngocuEY4P",
750
+ "recipient": "acc_HjVXbtpSCIxENR",
751
+ "amount": 100,
752
+ "currency": "INR",
753
+ "amount_reversed": 0,
754
+ "notes": [],
755
+ "linked_account_notes": [],
756
+ "on_hold": true,
757
+ "on_hold_until": null,
758
+ "recipient_settlement_id": null,
759
+ "created_at": 1655271313,
760
+ "processed_at": null,
761
+ "error": {
762
+ "code": null,
763
+ "description": null,
764
+ "reason": null,
765
+ "field": null,
766
+ "step": null,
767
+ "id": "trf_JhemwjNekar9Za",
768
+ "source": null,
769
+ "metadata": null
770
+ }
771
+ }
772
+ ]
676
773
  }
677
774
  ```
678
775