razorruby 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.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.editorconfig +12 -0
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/ruby.yml +38 -0
- data/.gitignore +23 -0
- data/.rubocop.yml +22 -0
- data/.simplecov +3 -0
- data/CHANGELOG.md +168 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +102 -0
- data/Rakefile +26 -0
- data/documents/Invoice.md +539 -0
- data/documents/addon.md +191 -0
- data/documents/card.md +610 -0
- data/documents/customer.md +163 -0
- data/documents/emandate.md +492 -0
- data/documents/fund.md +89 -0
- data/documents/items.md +208 -0
- data/documents/order.md +281 -0
- data/documents/papernach.md +738 -0
- data/documents/payment.md +826 -0
- data/documents/paymentLink.md +1063 -0
- data/documents/paymentVerification.md +79 -0
- data/documents/plan.md +184 -0
- data/documents/qrcode.md +439 -0
- data/documents/refund.md +325 -0
- data/documents/registerEmandate.md +452 -0
- data/documents/registerNach.md +653 -0
- data/documents/settlement.md +478 -0
- data/documents/subscriptions.md +752 -0
- data/documents/tokens.md +262 -0
- data/documents/transfers.md +781 -0
- data/documents/upi.md +545 -0
- data/documents/virtualAccount.md +591 -0
- data/lib/ca-bundle.crt +3988 -0
- data/lib/extensions/httparty/hash_conversions.rb +44 -0
- data/lib/razorpay/addon.rb +32 -0
- data/lib/razorpay/card.rb +17 -0
- data/lib/razorpay/collection.rb +6 -0
- data/lib/razorpay/constants.rb +6 -0
- data/lib/razorpay/customer.rb +42 -0
- data/lib/razorpay/entity.rb +46 -0
- data/lib/razorpay/errors/bad_request_error.rb +14 -0
- data/lib/razorpay/errors/gateway_error.rb +7 -0
- data/lib/razorpay/errors/razorpay_error.rb +11 -0
- data/lib/razorpay/errors/server_error.rb +7 -0
- data/lib/razorpay/errors.rb +4 -0
- data/lib/razorpay/fund_account.rb +19 -0
- data/lib/razorpay/invoice.rb +68 -0
- data/lib/razorpay/item.rb +34 -0
- data/lib/razorpay/order.rb +39 -0
- data/lib/razorpay/payment.rb +116 -0
- data/lib/razorpay/payment_link.rb +36 -0
- data/lib/razorpay/payment_method.rb +17 -0
- data/lib/razorpay/plan.rb +24 -0
- data/lib/razorpay/qr_code.rb +34 -0
- data/lib/razorpay/refund.rb +27 -0
- data/lib/razorpay/request.rb +119 -0
- data/lib/razorpay/settlement.rb +39 -0
- data/lib/razorpay/subscription.rb +60 -0
- data/lib/razorpay/subscription_registration.rb +16 -0
- data/lib/razorpay/transfer.rb +35 -0
- data/lib/razorpay/utility.rb +57 -0
- data/lib/razorpay/virtual_account.rb +49 -0
- data/lib/razorpay.rb +37 -0
- data/razorpay-ruby.gemspec +36 -0
- data/test/fixtures/addon_collection.json +60 -0
- data/test/fixtures/bad_request_error.json +7 -0
- data/test/fixtures/cancel_invoice.json +44 -0
- data/test/fixtures/cancel_subscription.json +20 -0
- data/test/fixtures/create_json_payment.json +13 -0
- data/test/fixtures/customer_collection.json +22 -0
- data/test/fixtures/delete_token.json +3 -0
- data/test/fixtures/downtimes_collection.json +21 -0
- data/test/fixtures/empty.json +2 -0
- data/test/fixtures/fake_addon.json +24 -0
- data/test/fixtures/fake_captured_payment.json +13 -0
- data/test/fixtures/fake_card.json +9 -0
- data/test/fixtures/fake_create_upi_payment.json +3 -0
- data/test/fixtures/fake_customer.json +8 -0
- data/test/fixtures/fake_customer_edited.json +8 -0
- data/test/fixtures/fake_direct_transfer.json +32 -0
- data/test/fixtures/fake_downtime.json +14 -0
- data/test/fixtures/fake_fund_account.json +18 -0
- data/test/fixtures/fake_instant_settlement.json +19 -0
- data/test/fixtures/fake_invoice.json +30 -0
- data/test/fixtures/fake_item.json +9 -0
- data/test/fixtures/fake_order.json +10 -0
- data/test/fixtures/fake_order_transfers.json +88 -0
- data/test/fixtures/fake_otp_generate.json +19 -0
- data/test/fixtures/fake_otp_resend.json +7 -0
- data/test/fixtures/fake_otp_submit.json +5 -0
- data/test/fixtures/fake_payment.json +14 -0
- data/test/fixtures/fake_payment_authorized_webhook.json +40 -0
- data/test/fixtures/fake_payment_bank_transfer.json +12 -0
- data/test/fixtures/fake_payment_link.json +40 -0
- data/test/fixtures/fake_pending_update.json +30 -0
- data/test/fixtures/fake_plan.json +26 -0
- data/test/fixtures/fake_qrcode.json +20 -0
- data/test/fixtures/fake_qrcode_close.json +22 -0
- data/test/fixtures/fake_recurring.json +5 -0
- data/test/fixtures/fake_refund.json +8 -0
- data/test/fixtures/fake_refunded_payment.json +14 -0
- data/test/fixtures/fake_settlement.json +11 -0
- data/test/fixtures/fake_settlement_on_demand.json +39 -0
- data/test/fixtures/fake_subscription.json +20 -0
- data/test/fixtures/fake_subscription_pause.json +19 -0
- data/test/fixtures/fake_subscription_registration.json +91 -0
- data/test/fixtures/fake_subscription_resume.json +19 -0
- data/test/fixtures/fake_token.json +31 -0
- data/test/fixtures/fake_transfer.json +18 -0
- data/test/fixtures/fake_transfer_reverse.json +15 -0
- data/test/fixtures/fake_update_payment.json +39 -0
- data/test/fixtures/fake_validate_vpa.json +5 -0
- data/test/fixtures/fake_virtual_account.json +21 -0
- data/test/fixtures/fake_virtual_account_allowed.json +46 -0
- data/test/fixtures/fake_virtual_account_closed.json +21 -0
- data/test/fixtures/fake_virtual_account_collection.json +48 -0
- data/test/fixtures/fake_virtual_account_receiver.json +46 -0
- data/test/fixtures/fund_collection.json +20 -0
- data/test/fixtures/hello_response.json +3 -0
- data/test/fixtures/invoice_collection.json +93 -0
- data/test/fixtures/issue_invoice.json +44 -0
- data/test/fixtures/item_collection.json +24 -0
- data/test/fixtures/order_collection.json +36 -0
- data/test/fixtures/order_payments.json +29 -0
- data/test/fixtures/payment_collection.json +32 -0
- data/test/fixtures/payment_collection_with_one_payment.json +19 -0
- data/test/fixtures/payment_link_collection.json +43 -0
- data/test/fixtures/payment_link_response.json +3 -0
- data/test/fixtures/payment_methods_collection.json +149 -0
- data/test/fixtures/plan_collection.json +32 -0
- data/test/fixtures/qrcode_collection.json +50 -0
- data/test/fixtures/qrcode_payments_collection.json +74 -0
- data/test/fixtures/refund_collection.json +30 -0
- data/test/fixtures/refund_collection_for_payment.json +22 -0
- data/test/fixtures/settlement_collection.json +26 -0
- data/test/fixtures/settlement_instant_collection.json +84 -0
- data/test/fixtures/settlement_report_collection.json +117 -0
- data/test/fixtures/subscription_collection.json +26 -0
- data/test/fixtures/success.json +3 -0
- data/test/fixtures/tokens_collection.json +36 -0
- data/test/fixtures/transfer_settlements_collection.json +38 -0
- data/test/fixtures/transfers_collection.json +41 -0
- data/test/fixtures/update_invoice.json +44 -0
- data/test/fixtures/welcome.json +3 -0
- data/test/razorpay/test_addon.rb +76 -0
- data/test/razorpay/test_card.rb +23 -0
- data/test/razorpay/test_customer.rb +69 -0
- data/test/razorpay/test_entity.rb +55 -0
- data/test/razorpay/test_fund_account.rb +42 -0
- data/test/razorpay/test_invoice.rb +143 -0
- data/test/razorpay/test_item.rb +66 -0
- data/test/razorpay/test_order.rb +71 -0
- data/test/razorpay/test_payment.rb +303 -0
- data/test/razorpay/test_payment_link.rb +83 -0
- data/test/razorpay/test_plan.rb +65 -0
- data/test/razorpay/test_qr_code.rb +63 -0
- data/test/razorpay/test_razorpay.rb +53 -0
- data/test/razorpay/test_refund.rb +56 -0
- data/test/razorpay/test_request.rb +15 -0
- data/test/razorpay/test_settlement.rb +76 -0
- data/test/razorpay/test_subscription.rb +190 -0
- data/test/razorpay/test_subscription_registration.rb +58 -0
- data/test/razorpay/test_transfer.rb +77 -0
- data/test/razorpay/test_utility.rb +84 -0
- data/test/razorpay/test_virtual_account.rb +135 -0
- data/test/test_helper.rb +54 -0
- metadata +400 -0
data/documents/fund.md
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
## Funds
|
2
|
+
|
3
|
+
```rb
|
4
|
+
require "razorpay"
|
5
|
+
Razorpay.setup('key_id', 'key_secret')
|
6
|
+
```
|
7
|
+
|
8
|
+
### Create a fund account
|
9
|
+
```rb
|
10
|
+
para_attr = {
|
11
|
+
"customer_id": "cust_Aa000000000001",
|
12
|
+
"account_type": "bank_account",
|
13
|
+
"bank_account":{
|
14
|
+
"name": "Gaurav Kumar",
|
15
|
+
"account_number": "11214311215411",
|
16
|
+
"ifsc": "HDFC0000053"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
Razorpay::FundAccount.create(para_attr)
|
21
|
+
```
|
22
|
+
|
23
|
+
**Parameters:**
|
24
|
+
|
25
|
+
| Name | Type | Description |
|
26
|
+
|---------------|-------------|---------------------------------------------|
|
27
|
+
| customerId* | string | The id of the customer to be fetched |
|
28
|
+
| account_type* | string | The bank_account to be linked to the customer ID |
|
29
|
+
| bank_account* | object | A key-value pair |
|
30
|
+
|
31
|
+
**Response:**
|
32
|
+
```json
|
33
|
+
{
|
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"
|
44
|
+
},
|
45
|
+
"batch_id": null,
|
46
|
+
"active": true,
|
47
|
+
"created_at": 1654154246
|
48
|
+
}
|
49
|
+
```
|
50
|
+
-------------------------------------------------------------------------------------------------------
|
51
|
+
|
52
|
+
### Fetch all fund accounts
|
53
|
+
|
54
|
+
```rb
|
55
|
+
para_attr = {
|
56
|
+
"customer_id": "cust_I3FToKbnExwDLu"
|
57
|
+
}
|
58
|
+
Razorpay::FundAccount.all(para_attr)
|
59
|
+
```
|
60
|
+
|
61
|
+
**Parameters:**
|
62
|
+
|
63
|
+
| Name | Type | Description |
|
64
|
+
|---------------|-------------|---------------------------------------------|
|
65
|
+
| customerId* | string | The id of the customer to be fetched |
|
66
|
+
|
67
|
+
**Response:**
|
68
|
+
```json
|
69
|
+
{
|
70
|
+
"id":"fa_Aa00000000001",
|
71
|
+
"entity":"fund_account",
|
72
|
+
"customer_id":"cust_Aa000000000001",
|
73
|
+
"account_type":"bank_account",
|
74
|
+
"bank_account":{
|
75
|
+
"name":"Gaurav Kumar",
|
76
|
+
"account_number":"11214311215411",
|
77
|
+
"ifsc":"HDFC0000053",
|
78
|
+
"bank_name":"HDFC Bank"
|
79
|
+
},
|
80
|
+
"active":true,
|
81
|
+
"created_at":1543650891
|
82
|
+
}
|
83
|
+
```
|
84
|
+
-------------------------------------------------------------------------------------------------------
|
85
|
+
|
86
|
+
**PN: * indicates mandatory fields**
|
87
|
+
<br>
|
88
|
+
<br>
|
89
|
+
**For reference click [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/)**
|
data/documents/items.md
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
## items
|
2
|
+
|
3
|
+
```rb
|
4
|
+
require "razorpay"
|
5
|
+
Razorpay.setup('key_id', 'key_secret')
|
6
|
+
```
|
7
|
+
|
8
|
+
### Create item
|
9
|
+
|
10
|
+
```rb
|
11
|
+
Razorpay::Item.create({
|
12
|
+
"name": "Book / English August",
|
13
|
+
"description": "An indian story, Booker prize winner.",
|
14
|
+
"amount": 20000,
|
15
|
+
"currency": "INR"
|
16
|
+
});
|
17
|
+
```
|
18
|
+
|
19
|
+
**Parameters:**
|
20
|
+
|
21
|
+
| Name | Type | Description |
|
22
|
+
|-----------------|---------|------------------------------------------------------------------------------|
|
23
|
+
| name* | string | Name of the item. |
|
24
|
+
| description | string | A brief description of the item. |
|
25
|
+
| amount | integer | Amount of the order to be paid |
|
26
|
+
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
27
|
+
|
28
|
+
**Response:**
|
29
|
+
```json
|
30
|
+
{
|
31
|
+
"id": "item_Jf5MlwKlPMOKBV",
|
32
|
+
"active": true,
|
33
|
+
"name": "Book / English August",
|
34
|
+
"description": "An indian story, Booker prize winner.",
|
35
|
+
"amount": 20000,
|
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
|
47
|
+
}
|
48
|
+
```
|
49
|
+
|
50
|
+
-------------------------------------------------------------------------------------------------------
|
51
|
+
|
52
|
+
### Fetch all items
|
53
|
+
|
54
|
+
```rb
|
55
|
+
options = {"count":1}
|
56
|
+
|
57
|
+
Razorpay::Item.all(options)
|
58
|
+
```
|
59
|
+
**Parameters:**
|
60
|
+
|
61
|
+
| Name | Type | Description |
|
62
|
+
|-------|-----------|--------------------------------------------------|
|
63
|
+
| from | timestamp | timestamp after which the item were created |
|
64
|
+
| to | timestamp | timestamp before which the item were created |
|
65
|
+
| count | integer | number of item to fetch (default: 10) |
|
66
|
+
| skip | integer | number of item to be skipped (default: 0) |
|
67
|
+
| name | string | Name of the item. |
|
68
|
+
| description | string | A brief description of the item. |
|
69
|
+
| amount | integer | Amount of the order to be paid |
|
70
|
+
| currency | string | Currency of the order. Currently only `INR` is supported. |
|
71
|
+
| active | boolean | Possible values is `0` or `1` |
|
72
|
+
|
73
|
+
**Response:**
|
74
|
+
```json
|
75
|
+
{
|
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
|
+
]
|
98
|
+
}
|
99
|
+
```
|
100
|
+
-------------------------------------------------------------------------------------------------------
|
101
|
+
### Fetch particular item
|
102
|
+
|
103
|
+
```rb
|
104
|
+
itemId = "item_7Oxp4hmm6T4SCn"
|
105
|
+
|
106
|
+
Razorpay::Item.fetch(itemId)
|
107
|
+
```
|
108
|
+
**Parameters**
|
109
|
+
|
110
|
+
| Name | Type | Description |
|
111
|
+
|----------|--------|-------------------------------------|
|
112
|
+
| itemId* | string | The id of the item to be fetched |
|
113
|
+
|
114
|
+
**Response:**
|
115
|
+
```json
|
116
|
+
{
|
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
|
133
|
+
}
|
134
|
+
```
|
135
|
+
|
136
|
+
-------------------------------------------------------------------------------------------------------
|
137
|
+
|
138
|
+
### Update item
|
139
|
+
|
140
|
+
```rb
|
141
|
+
itemId = "item_JDcbIdX9xojCje"
|
142
|
+
|
143
|
+
para_attr = {
|
144
|
+
"name": "Book / Ignited Minds - Updated name!",
|
145
|
+
"description": "New descirption too. :).",
|
146
|
+
"amount": 20000,
|
147
|
+
"currency": "INR",
|
148
|
+
"active": true
|
149
|
+
}
|
150
|
+
|
151
|
+
Razorpay::Item.edit(itemId,para_attr)
|
152
|
+
```
|
153
|
+
**Parameters**
|
154
|
+
|
155
|
+
| Name | Type | Description |
|
156
|
+
|----------|--------|-------------------------------------|
|
157
|
+
| itemId* | string | The id of the item to be fetched |
|
158
|
+
| name | string | Name of the item. |
|
159
|
+
| description | string | A brief description of the item. |
|
160
|
+
| amount | integer | Amount of the order to be paid |
|
161
|
+
| currency | string | Currency of the order. Currently only `INR` is supported. |
|
162
|
+
| active | boolean | Possible values is `0` or `1` |
|
163
|
+
|
164
|
+
**Response:**
|
165
|
+
```json
|
166
|
+
{
|
167
|
+
"id": "item_JInaSLODeDUQiQ",
|
168
|
+
"active": true,
|
169
|
+
"name": "Book / Ignited Minds - Updated name!",
|
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
|
183
|
+
}
|
184
|
+
```
|
185
|
+
-------------------------------------------------------------------------------------------------------
|
186
|
+
### Delete item
|
187
|
+
|
188
|
+
```rb
|
189
|
+
itemId = "item_Jc7wDjjQ4x305A"
|
190
|
+
|
191
|
+
Razorpay::Item.delete(itemId)
|
192
|
+
```
|
193
|
+
**Parameters**
|
194
|
+
|
195
|
+
| Name | Type | Description |
|
196
|
+
|----------|--------|-------------------------------------|
|
197
|
+
| itemId* | string | The id of the item to be fetched |
|
198
|
+
|
199
|
+
**Response:**
|
200
|
+
```json
|
201
|
+
[]
|
202
|
+
```
|
203
|
+
-------------------------------------------------------------------------------------------------------
|
204
|
+
|
205
|
+
**PN: * indicates mandatory fields**
|
206
|
+
<br>
|
207
|
+
<br>
|
208
|
+
**For reference click [here](https://razorpay.com/docs/api/items)**
|
data/documents/order.md
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
## Orders
|
2
|
+
|
3
|
+
```rb
|
4
|
+
require "razorpay"
|
5
|
+
Razorpay.setup('key_id', 'key_secret')
|
6
|
+
```
|
7
|
+
|
8
|
+
### Create order
|
9
|
+
|
10
|
+
```rb
|
11
|
+
|
12
|
+
para_attr = {
|
13
|
+
"amount": 50000,
|
14
|
+
"currency": "INR",
|
15
|
+
"receipt": "receipt#1",
|
16
|
+
"notes": {
|
17
|
+
"key1": "value3",
|
18
|
+
"key2": "value2"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
Razorpay::Order.create(para_attr)
|
23
|
+
```
|
24
|
+
|
25
|
+
**Parameters:**
|
26
|
+
|
27
|
+
| Name | Type | Description |
|
28
|
+
|-----------------|---------|------------------------------------------------------------------------------|
|
29
|
+
| amount* | integer | Amount of the order to be paid |
|
30
|
+
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
31
|
+
| receipt | string | Your system order reference id. |
|
32
|
+
| notes | object | A key-value pair |
|
33
|
+
|
34
|
+
**Response:**
|
35
|
+
|
36
|
+
```json
|
37
|
+
{
|
38
|
+
"id": "order_EKwxwAgItmmXdp",
|
39
|
+
"entity": "order",
|
40
|
+
"amount": 50000,
|
41
|
+
"amount_paid": 0,
|
42
|
+
"amount_due": 50000,
|
43
|
+
"currency": "INR",
|
44
|
+
"receipt": "receipt#1",
|
45
|
+
"offer_id": null,
|
46
|
+
"status": "created",
|
47
|
+
"attempts": 0,
|
48
|
+
"notes": [],
|
49
|
+
"created_at": 1582628071
|
50
|
+
}
|
51
|
+
```
|
52
|
+
|
53
|
+
-------------------------------------------------------------------------------------------------------
|
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
|
+
|
105
|
+
### Fetch all orders
|
106
|
+
|
107
|
+
```rb
|
108
|
+
option = {"count":1}
|
109
|
+
|
110
|
+
Razorpay::Order.all(option)
|
111
|
+
```
|
112
|
+
|
113
|
+
**Parameters**
|
114
|
+
|
115
|
+
| Name | Type | Description |
|
116
|
+
|------------|-----------|--------------------------------------------------------------|
|
117
|
+
| from | timestamp | timestamp after which the orders were created |
|
118
|
+
| to | timestamp | timestamp before which the orders were created |
|
119
|
+
| count | integer | number of orders to fetch (default: 10) |
|
120
|
+
| skip | integer | number of orders to be skipped (default: 0) |
|
121
|
+
| authorized | boolean | Orders for which orders are currently in authorized state. |
|
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` |
|
124
|
+
|
125
|
+
**Response:**
|
126
|
+
|
127
|
+
```json
|
128
|
+
{
|
129
|
+
"entity": "collection",
|
130
|
+
"count": 1,
|
131
|
+
"items": [
|
132
|
+
{
|
133
|
+
"id": "order_EKzX2WiEWbMxmx",
|
134
|
+
"entity": "order",
|
135
|
+
"amount": 1234,
|
136
|
+
"amount_paid": 0,
|
137
|
+
"amount_due": 1234,
|
138
|
+
"currency": "INR",
|
139
|
+
"receipt": "Receipt No. 1",
|
140
|
+
"offer_id": null,
|
141
|
+
"status": "created",
|
142
|
+
"attempts": 0,
|
143
|
+
"notes": [],
|
144
|
+
"created_at": 1582637108
|
145
|
+
}
|
146
|
+
]
|
147
|
+
}
|
148
|
+
```
|
149
|
+
-------------------------------------------------------------------------------------------------------
|
150
|
+
|
151
|
+
### Fetch particular order
|
152
|
+
|
153
|
+
```rb
|
154
|
+
orderId = "order_DaaS6LOUAASb7Y"
|
155
|
+
|
156
|
+
Razorpay::Order.fetch(orderId)
|
157
|
+
```
|
158
|
+
**Parameters**
|
159
|
+
|
160
|
+
| Name | Type | Description |
|
161
|
+
|----------|--------|-------------------------------------|
|
162
|
+
| orderId* | string | The id of the order to be fetched |
|
163
|
+
|
164
|
+
**Response:**
|
165
|
+
|
166
|
+
```json
|
167
|
+
{
|
168
|
+
"id":"order_DaaS6LOUAASb7Y",
|
169
|
+
"entity":"order",
|
170
|
+
"amount":2200,
|
171
|
+
"amount_paid":0,
|
172
|
+
"amount_due":2200,
|
173
|
+
"currency":"INR",
|
174
|
+
"receipt":"Receipt #211",
|
175
|
+
"status":"attempted",
|
176
|
+
"attempts":1,
|
177
|
+
"notes":[],
|
178
|
+
"created_at":1572505143
|
179
|
+
}
|
180
|
+
```
|
181
|
+
-------------------------------------------------------------------------------------------------------
|
182
|
+
|
183
|
+
### Fetch payments for an order
|
184
|
+
|
185
|
+
```rb
|
186
|
+
orderId = "order_DaaS6LOUAASb7Y"
|
187
|
+
|
188
|
+
Razorpay::Order.fetch("order_JCRhAvzvZQPkwT").payments
|
189
|
+
```
|
190
|
+
**Parameters**
|
191
|
+
|
192
|
+
| Name | Type | Description |
|
193
|
+
|----------|--------|-------------------------------------|
|
194
|
+
| orderId* | string | The id of the order to be retrieve payment info |
|
195
|
+
|
196
|
+
**Response:**
|
197
|
+
```json
|
198
|
+
{
|
199
|
+
"entity":"collection",
|
200
|
+
"count":1,
|
201
|
+
"items":[
|
202
|
+
{
|
203
|
+
"id":"pay_DaaSOvhgcOfzgR",
|
204
|
+
"entity":"payment",
|
205
|
+
"amount":2200,
|
206
|
+
"currency":"INR",
|
207
|
+
"status":"captured",
|
208
|
+
"order_id":"order_DaaS6LOUAASb7Y",
|
209
|
+
"invoice_id":null,
|
210
|
+
"international":false,
|
211
|
+
"method":"card",
|
212
|
+
"amount_refunded":0,
|
213
|
+
"refund_status":null,
|
214
|
+
"captured":true,
|
215
|
+
"description":"Beans in every imaginable flavour",
|
216
|
+
"card_id":"card_DZon6fd8J3IcA2",
|
217
|
+
"bank":null,
|
218
|
+
"wallet":null,
|
219
|
+
"vpa":null,
|
220
|
+
"email":"gaurav.kumar@example.com",
|
221
|
+
"contact":"+919999999988",
|
222
|
+
"notes":[],
|
223
|
+
"fee":44,
|
224
|
+
"tax":0,
|
225
|
+
"error_code":null,
|
226
|
+
"error_description":null,
|
227
|
+
"created_at":1572505160
|
228
|
+
}
|
229
|
+
]
|
230
|
+
}
|
231
|
+
```
|
232
|
+
-------------------------------------------------------------------------------------------------------
|
233
|
+
|
234
|
+
### Update order
|
235
|
+
|
236
|
+
```rb
|
237
|
+
orderId = "order_DaaS6LOUAASb7Y"
|
238
|
+
|
239
|
+
para_attr = {
|
240
|
+
"notes": {
|
241
|
+
"key1": "value3",
|
242
|
+
"key2": "value2"
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
Razorpay::Order.edit(orderId,para_attr)
|
247
|
+
```
|
248
|
+
**Parameters**
|
249
|
+
|
250
|
+
| Name | Type | Description |
|
251
|
+
|----------|--------|-------------------------------------|
|
252
|
+
| orderId* | string | The id of the order to be retrieve payment info |
|
253
|
+
| notes* | object | A key-value pair |
|
254
|
+
|
255
|
+
**Response:**
|
256
|
+
```json
|
257
|
+
{
|
258
|
+
"id":"order_DaaS6LOUAASb7Y",
|
259
|
+
"entity":"order",
|
260
|
+
"amount":2200,
|
261
|
+
"amount_paid":0,
|
262
|
+
"amount_due":2200,
|
263
|
+
"currency":"INR",
|
264
|
+
"receipt":"Receipt #211",
|
265
|
+
"offer_id":null,
|
266
|
+
"status":"attempted",
|
267
|
+
"attempts":1,
|
268
|
+
"notes":{
|
269
|
+
"notes_key_1":"Tea, Earl Grey, Hot",
|
270
|
+
"notes_key_2":"Tea, Earl Grey… decaf."
|
271
|
+
},
|
272
|
+
"created_at":1572505143
|
273
|
+
}
|
274
|
+
```
|
275
|
+
-------------------------------------------------------------------------------------------------------
|
276
|
+
|
277
|
+
|
278
|
+
**PN: * indicates mandatory fields**
|
279
|
+
<br>
|
280
|
+
<br>
|
281
|
+
**For reference click [here](https://razorpay.com/docs/api/orders/)**
|