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.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +8 -0
- data/.github/workflows/ci.yml +79 -0
- data/CHANGELOG.md +21 -0
- data/README.md +5 -1
- data/documents/Invoice.md +11 -3
- data/documents/account.md +449 -0
- data/documents/addon.md +23 -1
- data/documents/card.md +73 -29
- data/documents/customer.md +2 -0
- data/documents/emandate.md +20 -12
- data/documents/fund.md +19 -17
- data/documents/items.md +65 -41
- data/documents/order.md +51 -0
- data/documents/papernach.md +40 -20
- data/documents/payment.md +247 -14
- data/documents/paymentLink.md +37 -19
- data/documents/plan.md +3 -3
- data/documents/productConfiguration.md +444 -0
- data/documents/qrcode.md +17 -19
- data/documents/refund.md +11 -10
- data/documents/registerEmandate.md +25 -18
- data/documents/registerNach.md +49 -57
- data/documents/settlement.md +1 -0
- data/documents/stakeholder.md +334 -0
- data/documents/subscriptions.md +3 -1
- data/documents/tokens.md +201 -2
- data/documents/transfers.md +292 -195
- data/documents/upi.md +25 -28
- data/documents/virtualAccount.md +18 -13
- data/documents/webhook.md +224 -0
- data/lib/razorpay/account.rb +39 -0
- data/lib/razorpay/addon.rb +5 -1
- data/lib/razorpay/card.rb +4 -0
- data/lib/razorpay/constants.rb +2 -2
- data/lib/razorpay/iin.rb +15 -0
- data/lib/razorpay/order.rb +1 -1
- data/lib/razorpay/payment.rb +8 -0
- data/lib/razorpay/payment_method.rb +17 -0
- data/lib/razorpay/product.rb +37 -0
- data/lib/razorpay/request.rb +16 -16
- data/lib/razorpay/stakeholder.rb +39 -0
- data/lib/razorpay/token.rb +28 -0
- data/lib/razorpay/virtual_account.rb +1 -1
- data/lib/razorpay/webhook.rb +50 -0
- data/lib/razorpay.rb +7 -0
- data/razorpay-ruby.gemspec +2 -1
- data/test/fixtures/fake_account.json +78 -0
- data/test/fixtures/fake_card_reference.json +5 -0
- data/test/fixtures/fake_create_upi_payment.json +3 -0
- data/test/fixtures/fake_iin_token.json +23 -0
- data/test/fixtures/fake_product.json +138 -0
- data/test/fixtures/fake_stakeholder.json +29 -0
- data/test/fixtures/fake_tokenise_customer.json +40 -0
- data/test/fixtures/fake_validate_vpa.json +5 -0
- data/test/fixtures/fake_webhook.json +79 -0
- data/test/fixtures/fake_webhook_by_account_id.json +22 -0
- data/test/fixtures/fetch_tnc.json +11 -0
- data/test/fixtures/payment_methods_collection.json +149 -0
- data/test/fixtures/stakeholder_collection.json +35 -0
- data/test/fixtures/webhook_by_account_collection.json +35 -0
- data/test/fixtures/webhook_collection.json +85 -0
- data/test/razorpay/test_account.rb +134 -0
- data/test/razorpay/test_addon.rb +6 -2
- data/test/razorpay/test_card.rb +6 -0
- data/test/razorpay/test_customer.rb +8 -8
- data/test/razorpay/test_iin.rb +23 -0
- data/test/razorpay/test_order.rb +1 -1
- data/test/razorpay/test_payment.rb +46 -2
- data/test/razorpay/test_product.rb +67 -0
- data/test/razorpay/test_settlement.rb +1 -1
- data/test/razorpay/test_stakeholder.rb +87 -0
- data/test/razorpay/test_token.rb +66 -0
- data/test/razorpay/test_transfer.rb +1 -1
- data/test/razorpay/test_webhook.rb +132 -0
- data/test/test_helper.rb +2 -0
- 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
|
-
|
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
|
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.
|
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.
|
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.
|
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
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
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
|
-
|
609
|
+
Razorpay::Card.request_card_reference({"number":"4111111111111111"});
|
610
|
+
```
|
611
|
+
**Parameters:**
|
588
612
|
|
589
|
-
|
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
|
-
|
628
|
+
## Using Razporpay token
|
629
|
+
|
630
|
+
```rb
|
631
|
+
Razorpay::Card.requestCardReference({"token":"token_4lsdksD31GaZ09"});
|
592
632
|
```
|
593
633
|
**Parameters:**
|
594
634
|
|
595
|
-
| Name
|
596
|
-
|
597
|
-
|
|
598
|
-
|
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
|
-
|
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**
|
data/documents/customer.md
CHANGED
@@ -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:**
|
data/documents/emandate.md
CHANGED
@@ -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::
|
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
|
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
|
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
|
151
|
-
|
|
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.
|
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.
|
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.
|
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(
|
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":"
|
35
|
-
"entity":"fund_account",
|
36
|
-
"customer_id":"
|
37
|
-
"account_type":"bank_account",
|
38
|
-
"bank_account":{
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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
|
-
"
|
45
|
-
"
|
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": "
|
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
|
-
"
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
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": "
|
167
|
+
"id": "item_JInaSLODeDUQiQ",
|
154
168
|
"active": true,
|
155
169
|
"name": "Book / Ignited Minds - Updated name!",
|
156
|
-
"description": "New descirption too.
|
157
|
-
"amount":
|
158
|
-
"
|
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
|
|