razorpay 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +8 -0
  3. data/.github/workflows/ci.yml +79 -0
  4. data/CHANGELOG.md +21 -0
  5. data/README.md +5 -1
  6. data/documents/Invoice.md +11 -3
  7. data/documents/account.md +449 -0
  8. data/documents/addon.md +23 -1
  9. data/documents/card.md +73 -29
  10. data/documents/customer.md +2 -0
  11. data/documents/emandate.md +20 -12
  12. data/documents/fund.md +19 -17
  13. data/documents/items.md +65 -41
  14. data/documents/order.md +51 -0
  15. data/documents/papernach.md +40 -20
  16. data/documents/payment.md +247 -14
  17. data/documents/paymentLink.md +37 -19
  18. data/documents/plan.md +3 -3
  19. data/documents/productConfiguration.md +444 -0
  20. data/documents/qrcode.md +17 -19
  21. data/documents/refund.md +11 -10
  22. data/documents/registerEmandate.md +25 -18
  23. data/documents/registerNach.md +49 -57
  24. data/documents/settlement.md +1 -0
  25. data/documents/stakeholder.md +334 -0
  26. data/documents/subscriptions.md +3 -1
  27. data/documents/tokens.md +201 -2
  28. data/documents/transfers.md +292 -195
  29. data/documents/upi.md +25 -28
  30. data/documents/virtualAccount.md +18 -13
  31. data/documents/webhook.md +224 -0
  32. data/lib/razorpay/account.rb +39 -0
  33. data/lib/razorpay/addon.rb +5 -1
  34. data/lib/razorpay/card.rb +4 -0
  35. data/lib/razorpay/constants.rb +2 -2
  36. data/lib/razorpay/iin.rb +15 -0
  37. data/lib/razorpay/order.rb +1 -1
  38. data/lib/razorpay/payment.rb +8 -0
  39. data/lib/razorpay/payment_method.rb +17 -0
  40. data/lib/razorpay/product.rb +37 -0
  41. data/lib/razorpay/request.rb +16 -16
  42. data/lib/razorpay/stakeholder.rb +39 -0
  43. data/lib/razorpay/token.rb +28 -0
  44. data/lib/razorpay/virtual_account.rb +1 -1
  45. data/lib/razorpay/webhook.rb +50 -0
  46. data/lib/razorpay.rb +7 -0
  47. data/razorpay-ruby.gemspec +2 -1
  48. data/test/fixtures/fake_account.json +78 -0
  49. data/test/fixtures/fake_card_reference.json +5 -0
  50. data/test/fixtures/fake_create_upi_payment.json +3 -0
  51. data/test/fixtures/fake_iin_token.json +23 -0
  52. data/test/fixtures/fake_product.json +138 -0
  53. data/test/fixtures/fake_stakeholder.json +29 -0
  54. data/test/fixtures/fake_tokenise_customer.json +40 -0
  55. data/test/fixtures/fake_validate_vpa.json +5 -0
  56. data/test/fixtures/fake_webhook.json +79 -0
  57. data/test/fixtures/fake_webhook_by_account_id.json +22 -0
  58. data/test/fixtures/fetch_tnc.json +11 -0
  59. data/test/fixtures/payment_methods_collection.json +149 -0
  60. data/test/fixtures/stakeholder_collection.json +35 -0
  61. data/test/fixtures/webhook_by_account_collection.json +35 -0
  62. data/test/fixtures/webhook_collection.json +85 -0
  63. data/test/razorpay/test_account.rb +134 -0
  64. data/test/razorpay/test_addon.rb +6 -2
  65. data/test/razorpay/test_card.rb +6 -0
  66. data/test/razorpay/test_customer.rb +8 -8
  67. data/test/razorpay/test_iin.rb +23 -0
  68. data/test/razorpay/test_order.rb +1 -1
  69. data/test/razorpay/test_payment.rb +46 -2
  70. data/test/razorpay/test_product.rb +67 -0
  71. data/test/razorpay/test_settlement.rb +1 -1
  72. data/test/razorpay/test_stakeholder.rb +87 -0
  73. data/test/razorpay/test_token.rb +66 -0
  74. data/test/razorpay/test_transfer.rb +1 -1
  75. data/test/razorpay/test_webhook.rb +132 -0
  76. data/test/test_helper.rb +2 -0
  77. metadata +76 -7
data/documents/card.md CHANGED
@@ -53,7 +53,7 @@ Razorpay::Customer.create(para_attr)
53
53
  ### Create Order
54
54
 
55
55
  ```rb
56
- param_attr = {
56
+ para_attr = {
57
57
  "amount":100,
58
58
  "currency": "INR",
59
59
  "customer_id": "cust_4xbQrmEoA5WJ01",
@@ -150,8 +150,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
150
150
 
151
151
  | Name | Type | Description |
152
152
  |-----------------|---------|------------------------------------------------------------------------------|
153
- | customer | object | Details of the customer to whom the registration link will be sent. |
154
- | type* | string | the value is `link`. |
153
+ | customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#121-create-a-registration-link) are supported |
155
154
  | amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
156
155
  | currency* | string | The currency of the payment (defaults to INR) |
157
156
  | description* | string | A brief description of the payment. |
@@ -304,7 +303,7 @@ para_attr = {
304
303
  "note_key 2": "Tea. Earl Gray. Hot."
305
304
  }
306
305
  }
307
- Razorpay::Payment.createRecurringPayment(para_attr)
306
+ Razorpay::Payment.create_recurring_payment(para_attr)
308
307
  ```
309
308
  **Parameters:**
310
309
 
@@ -344,7 +343,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
344
343
 
345
344
  medium = "email"
346
345
 
347
- Razorpay::Invoice.notifyBy(invoiceId, medium)
346
+ Razorpay::Invoice.notify_by(invoiceId, medium)
348
347
  ```
349
348
  **Parameters:**
350
349
 
@@ -493,7 +492,7 @@ Razorpay::Payment.fetch(paymentId)
493
492
  ```rb
494
493
  customerId = "cust_1Aa00000000004"
495
494
 
496
- Razorpay::Customer.fetchTokens(customerId)
495
+ Razorpay::Customer.fetch(customerId).fetchTokens
497
496
  ```
498
497
  **Parameters:**
499
498
 
@@ -549,10 +548,34 @@ Razorpay::Customer.fetchTokens(customerId)
549
548
  ```
550
549
  -------------------------------------------------------------------------------------------------------
551
550
 
551
+ ## Delete tokens
552
+
553
+ ```rb
554
+ customerId = "cust_1Aa00000000004"
555
+
556
+ tokenId = "token_Hxe0skTXLeg9pF"
557
+
558
+ Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
559
+ ```
560
+ **Parameters:**
561
+
562
+ | Name | Type | Description |
563
+ |-----------------|---------|------------------------------------------------------------------------------|
564
+ | customerId* | string | The id of the customer to be fetched |
565
+ | tokenId* | string | The id of the token to be fetched |
566
+
567
+ **Response:**
568
+ ```json
569
+ {
570
+ "deleted": true
571
+ }
572
+ ```
573
+ -------------------------------------------------------------------------------------------------------
574
+
552
575
  ### Fetch card
553
576
 
554
577
  ```rb
555
- cardId = ""
578
+ cardId = "card_JXPULjlKqC5j0i"
556
579
 
557
580
  Razorpay::Card.fetch(cardId)
558
581
  ```
@@ -566,43 +589,64 @@ Razorpay::Card.fetch(cardId)
566
589
  **Response:**
567
590
  ```json
568
591
  {
569
- "id": "card_JXPULjlKqC5j0i",
570
- "entity": "card",
571
- "name": "gaurav.kumar",
572
- "last4": "4366",
573
- "network": "Visa",
574
- "type": "credit",
575
- "issuer": "UTIB",
576
- "international": false,
577
- "emi": true,
578
- "sub_type": "consumer",
579
- "token_iin": null
592
+ "id": "card_JXPULjlKqC5j0i",
593
+ "entity": "card",
594
+ "name": "Gaurav",
595
+ "last4": "4366",
596
+ "network": "Visa",
597
+ "type": "credit",
598
+ "issuer": "UTIB",
599
+ "international": false,
600
+ "emi": true,
601
+ "sub_type": "consumer",
602
+ "token_iin": null
580
603
  }
581
-
604
+ ```
582
605
  -------------------------------------------------------------------------------------------------------
583
-
584
- ## Delete tokens
606
+ ## Using Card Number/ Tokenised Card Number
585
607
 
586
608
  ```rb
587
- customerId = "cust_1Aa00000000004"
609
+ Razorpay::Card.request_card_reference({"number":"4111111111111111"});
610
+ ```
611
+ **Parameters:**
588
612
 
589
- tokenId = "token_Hxe0skTXLeg9pF"
613
+ | Name | Type | Description |
614
+ |-------------|---------|------------------------------------------------------------------------------|
615
+ | number* | string | The card number whose PAR or network reference id should be retrieved. |
616
+ | tokenised | string | Determines if the card is saved as a token. Possible value is `true` or `false` |
617
+
618
+ **Response:**
619
+ ```json
620
+ {
621
+ "network": "Visa",
622
+ "payment_account_reference": "V0010013819231376539033235990",
623
+ "network_reference_id": null
624
+ }
625
+ ```
626
+ -------------------------------------------------------------------------------------------------------
590
627
 
591
- Razorpay::fetch(customerId).deleteToken(tokenId)
628
+ ## Using Razporpay token
629
+
630
+ ```rb
631
+ Razorpay::Card.requestCardReference({"token":"token_4lsdksD31GaZ09"});
592
632
  ```
593
633
  **Parameters:**
594
634
 
595
- | Name | Type | Description |
596
- |-----------------|---------|------------------------------------------------------------------------------|
597
- | customerId* | string | The id of the customer to be fetched |
598
- | tokenId* | string | The id of the token to be fetched |
635
+ | Name | Type | Description |
636
+ |-------------|---------|------------------------------------------------------------------------------|
637
+ | token* | string | The token whose PAR or network reference id should be retrieved.|
638
+
639
+
599
640
 
600
641
  **Response:**
601
642
  ```json
602
643
  {
603
- "deleted": true
644
+ "network": "Visa",
645
+ "payment_account_reference": "V0010013819231376539033235990",
646
+ "network_reference_id": null
604
647
  }
605
648
  ```
649
+
606
650
  -------------------------------------------------------------------------------------------------------
607
651
 
608
652
  **PN: * indicates mandatory fields**
@@ -28,6 +28,8 @@ Razorpay::Customer.create({
28
28
  | name* | string | Name of the customer |
29
29
  | email | string | Email of the customer |
30
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` |
31
33
  | notes | object | A key-value pair |
32
34
 
33
35
  **Response:**
@@ -12,7 +12,6 @@ Razorpay::Customer.create({
12
12
  "contact": 9123456780,
13
13
  "email": "gaurav.kumar@example.com",
14
14
  "fail_existing": 0,
15
- "gstin": "29XAbbA4369J1PA",
16
15
  "notes": {
17
16
  "notes_key_1": "Tea, Earl Grey, Hot",
18
17
  "notes_key_2": "Tea, Earl Grey… decaf."
@@ -28,6 +27,7 @@ Razorpay::Customer.create({
28
27
  | email | string | Email of the customer |
29
28
  | contact | string | Contact number of the customer |
30
29
  | notes | object | A key-value pair |
30
+ | 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`|
31
31
 
32
32
  **Response:**
33
33
  ```json
@@ -50,9 +50,10 @@ Razorpay::Customer.create({
50
50
  ### Create order
51
51
 
52
52
  ```rb
53
- Razorpay::Customer.create({
53
+ Razorpay::Order.create({
54
54
  "amount": 0,
55
55
  "currency": "INR",
56
+ "payment_capture": true,
56
57
  "method": "emandate",
57
58
  "customer_id": "cust_1Aa00000000001",
58
59
  "receipt": "Receipt No. 1",
@@ -70,7 +71,7 @@ Razorpay::Customer.create({
70
71
  },
71
72
  "bank_account": {
72
73
  "beneficiary_name": "Gaurav Kumar",
73
- "account_number": 1121431121541121,
74
+ "account_number": "1121431121541121",
74
75
  "account_type": "savings",
75
76
  "ifsc_code": "HDFC0000001"
76
77
  }
@@ -86,12 +87,14 @@ Razorpay::Customer.create({
86
87
  | currency* | string | Currency of the order. Currently only `INR` is supported. |
87
88
  | method* | string | The authorization method. In this case the value will be `emandate` |
88
89
  | receipt | string | Your system order reference id. |
90
+ | customer_id* | string | The `customer_id` for the customer you want to charge.|
89
91
  | payment_capture | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
90
- | notes | object | A key-value pair |
91
- | token | object | A key-value pair |
92
+ | notes | object | A key-value pair |
93
+ | token | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|
92
94
 
93
95
  **Response:**
94
96
  Create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#112-create-an-order)
97
+
95
98
  -------------------------------------------------------------------------------------------------------
96
99
 
97
100
  ### Create an Authorization Payment
@@ -142,16 +145,20 @@ Razorpay::SubscriptionRegistration.create(para_attr)
142
145
 
143
146
  | Name | Type | Description |
144
147
  |-----------------|---------|------------------------------------------------------------------------------|
145
- | customer | object | Details of the customer to whom the registration link will be sent. |
148
+ | customer* | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
146
149
  | type* | string | In this case, the value is `link`. |
147
150
  | currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
148
151
  | amount* | integer | The payment amount in the smallest currency sub-unit. |
149
152
  | description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
150
- | subscription_registration | object | Details of the authorization payment. |
151
- | notes | object | A key-value pair |
153
+ | subscription_registration | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
154
+ | email_notify | boolean | Email notifications are to be sent by Razorpay (default : 1) |
155
+ | expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
156
+ | receipt | string | Your system order reference id. |
157
+ | notes | object | A key-value pair |
152
158
 
153
159
  **Response:**
154
160
  Create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#121-create-a-registration-link)
161
+
155
162
  -------------------------------------------------------------------------------------------------------
156
163
 
157
164
  ### Send/Resend notifications
@@ -161,7 +168,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
161
168
 
162
169
  medium = "email"
163
170
 
164
- Razorpay::Invoice.notifyBy(invoiceId, medium)
171
+ Razorpay::Invoice.notify_by(invoiceId, medium)
165
172
  ```
166
173
 
167
174
  **Parameters:**
@@ -313,7 +320,7 @@ Razorpay::Payment.fetch(paymentId)
313
320
  ```rb
314
321
  customerId = "cust_1Aa00000000004"
315
322
 
316
- Razorpay::Customer.fetchTokens(customerId)
323
+ Razorpay::Customer.fetch(customerId).fetchTokens
317
324
  ```
318
325
 
319
326
  **Parameters:**
@@ -367,7 +374,7 @@ customerId = "cust_1Aa00000000004"
367
374
 
368
375
  tokenId = "token_Hxe0skTXLeg9pF"
369
376
 
370
- Razorpay::fetch(customerId).deleteToken(tokenId)
377
+ Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
371
378
  ```
372
379
 
373
380
  **Parameters:**
@@ -409,6 +416,7 @@ Razorpay::Order.create(para_attr)
409
416
  | currency* | string | Currency of the order. Currently only `INR` is supported. |
410
417
  | receipt | string | Your system order reference id. |
411
418
  | notes | object | A key-value pair |
419
+ | payment_capture* | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
412
420
 
413
421
  **Response:**
414
422
  ```json
@@ -450,7 +458,7 @@ para_attr = {
450
458
  "note_key 2": "Tea. Earl Gray. Hot."
451
459
  }
452
460
  }
453
- Razorpay::Payment.createRecurringPayment(para_attr)
461
+ Razorpay::Payment.create_recurring_payment(para_attr)
454
462
  ```
455
463
 
456
464
  **Parameters:**
data/documents/fund.md CHANGED
@@ -8,16 +8,16 @@ Razorpay.setup('key_id', 'key_secret')
8
8
  ### Create a fund account
9
9
  ```rb
10
10
  para_attr = {
11
- "customer_id":"cust_Aa000000000001",
12
- "account_type":"bank_account",
11
+ "customer_id": "cust_Aa000000000001",
12
+ "account_type": "bank_account",
13
13
  "bank_account":{
14
- "name":"Gaurav Kumar",
15
- "account_number":"11214311215411",
16
- "ifsc":"HDFC0000053"
14
+ "name": "Gaurav Kumar",
15
+ "account_number": "11214311215411",
16
+ "ifsc": "HDFC0000053"
17
17
  }
18
18
  }
19
19
 
20
- Razorpay::FundAccount.create(data)
20
+ Razorpay::FundAccount.create(para_attr)
21
21
  ```
22
22
 
23
23
  **Parameters:**
@@ -31,18 +31,20 @@ Razorpay::FundAccount.create(data)
31
31
  **Response:**
32
32
  ```json
33
33
  {
34
- "id":"fa_Aa00000000001",
35
- "entity":"fund_account",
36
- "customer_id":"cust_Aa000000000001",
37
- "account_type":"bank_account",
38
- "bank_account":{
39
- "name":"Gaurav Kumar",
40
- "account_number":"11214311215411",
41
- "ifsc":"HDFC0000053",
42
- "bank_name":"HDFC Bank"
34
+ "id": "fa_JcXaLomo4ck5IY",
35
+ "entity": "fund_account",
36
+ "customer_id": "cust_JZse2vlC5nK9AQ",
37
+ "account_type": "bank_account",
38
+ "bank_account": {
39
+ "ifsc": "HDFC0000053",
40
+ "bank_name": "HDFC Bank",
41
+ "name": "Gaurav Kumar",
42
+ "notes": [],
43
+ "account_number": "11214311215411"
43
44
  },
44
- "active":true,
45
- "created_at":1543650891
45
+ "batch_id": null,
46
+ "active": true,
47
+ "created_at": 1654154246
46
48
  }
47
49
  ```
48
50
  -------------------------------------------------------------------------------------------------------
data/documents/items.md CHANGED
@@ -23,17 +23,27 @@ Razorpay::Item.create({
23
23
  | name* | string | Name of the item. |
24
24
  | description | string | A brief description of the item. |
25
25
  | amount | integer | Amount of the order to be paid |
26
- | currency | string | Currency of the order. Currently only `INR` is supported. |
26
+ | currency* | string | Currency of the order. Currently only `INR` is supported. |
27
27
 
28
28
  **Response:**
29
29
  ```json
30
30
  {
31
- "id": "item_7Oxp4hmm6T4SCn",
31
+ "id": "item_Jf5MlwKlPMOKBV",
32
32
  "active": true,
33
33
  "name": "Book / English August",
34
34
  "description": "An indian story, Booker prize winner.",
35
35
  "amount": 20000,
36
- "currency": "INR"
36
+ "unit_amount": 20000,
37
+ "currency": "INR",
38
+ "type": "invoice",
39
+ "unit": null,
40
+ "tax_inclusive": false,
41
+ "hsn_code": null,
42
+ "sac_code": null,
43
+ "tax_rate": null,
44
+ "tax_id": null,
45
+ "tax_group_id": null,
46
+ "created_at": 1654709890
37
47
  }
38
48
  ```
39
49
 
@@ -63,34 +73,28 @@ Razorpay::Item.all(options)
63
73
  **Response:**
64
74
  ```json
65
75
  {
66
- "entity": "collection",
67
- "count": 3,
68
- "items": [
69
- {
70
- "id": "item_7Oy8OMV6BdEAac",
71
- "active": true,
72
- "name": "Book / Ignited Minds",
73
- "description": null,
74
- "amount": 15000,
75
- "currency": "INR"
76
- },
77
- {
78
- "id": "item_7Oxp4hmm6T4SCn",
79
- "active": true,
80
- "name": "Book / English August",
81
- "description": "An indian story, Booker prize winner.",
82
- "amount": 20000,
83
- "currency": "INR"
84
- },
85
- {
86
- "id": "item_7OxoGnoxCuUKbo",
87
- "active": true,
88
- "name": "Book / English August",
89
- "description": null,
90
- "amount": 20000,
91
- "currency": "INR"
92
- }
93
- ]
76
+ "entity": "collection",
77
+ "count": 1,
78
+ "items": [
79
+ {
80
+ "id": "item_JnjKnSWxjILdWu",
81
+ "active": true,
82
+ "name": "Book / English August",
83
+ "description": "An indian story, Booker prize winner.",
84
+ "amount": 20000,
85
+ "unit_amount": 20000,
86
+ "currency": "INR",
87
+ "type": "invoice",
88
+ "unit": null,
89
+ "tax_inclusive": false,
90
+ "hsn_code": null,
91
+ "sac_code": null,
92
+ "tax_rate": null,
93
+ "tax_id": null,
94
+ "tax_group_id": null,
95
+ "created_at": 1656597363
96
+ }
97
+ ]
94
98
  }
95
99
  ```
96
100
  -------------------------------------------------------------------------------------------------------
@@ -110,12 +114,22 @@ Razorpay::Item.fetch(itemId)
110
114
  **Response:**
111
115
  ```json
112
116
  {
113
- "id": "item_7Oxp4hmm6T4SCn",
114
- "active": true,
115
- "name": "Book / English August",
116
- "description": "An indian story, Booker prize winner.",
117
- "amount": 20000,
118
- "currency": "INR"
117
+ "id": "item_JnjKnSWxjILdWu",
118
+ "active": true,
119
+ "name": "Book / English August",
120
+ "description": "An indian story, Booker prize winner.",
121
+ "amount": 20000,
122
+ "unit_amount": 20000,
123
+ "currency": "INR",
124
+ "type": "invoice",
125
+ "unit": null,
126
+ "tax_inclusive": false,
127
+ "hsn_code": null,
128
+ "sac_code": null,
129
+ "tax_rate": null,
130
+ "tax_id": null,
131
+ "tax_group_id": null,
132
+ "created_at": 1656597363
119
133
  }
120
134
  ```
121
135
 
@@ -150,12 +164,22 @@ Razorpay::Item.edit(itemId,para_attr)
150
164
  **Response:**
151
165
  ```json
152
166
  {
153
- "id": "item_7Oy8OMV6BdEAac",
167
+ "id": "item_JInaSLODeDUQiQ",
154
168
  "active": true,
155
169
  "name": "Book / Ignited Minds - Updated name!",
156
- "description": "New descirption too. :)",
157
- "amount": 15000,
158
- "currency": "INR"
170
+ "description": "New descirption too.",
171
+ "amount": 20000,
172
+ "unit_amount": 20000,
173
+ "currency": "INR",
174
+ "type": "invoice",
175
+ "unit": null,
176
+ "tax_inclusive": false,
177
+ "hsn_code": null,
178
+ "sac_code": null,
179
+ "tax_rate": null,
180
+ "tax_id": null,
181
+ "tax_group_id": null,
182
+ "created_at": 1649843796
159
183
  }
160
184
  ```
161
185
  -------------------------------------------------------------------------------------------------------
data/documents/order.md CHANGED
@@ -52,6 +52,56 @@ Razorpay::Order.create(para_attr)
52
52
 
53
53
  -------------------------------------------------------------------------------------------------------
54
54
 
55
+ ### Create order (Third party validation)
56
+
57
+ ```rb
58
+ para_attr = {
59
+ "amount": 500,
60
+ "method": "netbanking",
61
+ "receipt": "BILL13375649",
62
+ "currency": "INR",
63
+ "bank_account": {
64
+ "account_number": "765432123456789",
65
+ "name": "Gaurav Kumar",
66
+ "ifsc": "HDFC0000053"
67
+ }
68
+ }
69
+
70
+ Razorpay::Order.create(para_attr)
71
+ ```
72
+
73
+ **Parameters:**
74
+
75
+ | Name | Type | Description |
76
+ |-----------------|---------|------------------------------------------------------------------------------|
77
+ | amount* | integer | Amount of the order to be paid |
78
+ | method | string | The payment method used to make the payment. If this parameter is not passed, customers will be able to make payments using both netbanking and UPI payment methods. Possible values is `netbanking` or `upi`|
79
+ | currency* | string | Currency of the order. Currently only `INR` is supported. |
80
+ | receipt | string | Your system order reference id. |
81
+ |bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/#step-2-create-an-order) are supported |
82
+ | notes | object | A key-value pair |
83
+
84
+ **Response:**
85
+
86
+ ```json
87
+ {
88
+ "id": "order_GAWN9beXgaqRyO",
89
+ "entity": "order",
90
+ "amount": 500,
91
+ "amount_paid": 0,
92
+ "amount_due": 500,
93
+ "currency": "INR",
94
+ "receipt": "BILL13375649",
95
+ "offer_id": null,
96
+ "status": "created",
97
+ "attempts": 0,
98
+ "notes": [],
99
+ "created_at": 1573044247
100
+ }
101
+ ```
102
+
103
+ -------------------------------------------------------------------------------------------------------
104
+
55
105
  ### Fetch all orders
56
106
 
57
107
  ```rb
@@ -70,6 +120,7 @@ Razorpay::Order.all(option)
70
120
  | skip | integer | number of orders to be skipped (default: 0) |
71
121
  | authorized | boolean | Orders for which orders are currently in authorized state. |
72
122
  | receipt | string | Orders with the provided value for receipt. |
123
+ | expand[] | string | Used to retrieve additional information about the payment. Possible value is `payments`,`payments.card`,`transfers` or `virtual_account` |
73
124
 
74
125
  **Response:**
75
126