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/addon.md
ADDED
@@ -0,0 +1,191 @@
|
|
1
|
+
## Addons
|
2
|
+
|
3
|
+
```rb
|
4
|
+
require "razorpay"
|
5
|
+
|
6
|
+
Razorpay.setup('key_id', 'key_secret')
|
7
|
+
```
|
8
|
+
|
9
|
+
### Create an addon
|
10
|
+
|
11
|
+
```rb
|
12
|
+
subscriptionId = "sub_JBELhNBHtTCyhh"
|
13
|
+
|
14
|
+
Razorpay::Addon.create(subscriptionId,{
|
15
|
+
"item":{
|
16
|
+
"name":"Extra appala (papadum)",
|
17
|
+
"amount":30000,
|
18
|
+
"currency":"INR",
|
19
|
+
"description":"1 extra oil fried appala with meals"
|
20
|
+
},
|
21
|
+
"quantity":2
|
22
|
+
})
|
23
|
+
```
|
24
|
+
|
25
|
+
**Parameters:**
|
26
|
+
|
27
|
+
| Name | Type | Description |
|
28
|
+
|-------|-----------|--------------------------------------------------|
|
29
|
+
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
|
30
|
+
| items* | object | Details of the add-on you want to create. |
|
31
|
+
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |
|
32
|
+
|
33
|
+
**Response:**
|
34
|
+
```json
|
35
|
+
{
|
36
|
+
"id":"ao_00000000000001",
|
37
|
+
"entity":"addon",
|
38
|
+
"item":{
|
39
|
+
"id":"item_00000000000001",
|
40
|
+
"active":true,
|
41
|
+
"name":"Extra appala (papadum)",
|
42
|
+
"description":"1 extra oil fried appala with meals",
|
43
|
+
"amount":30000,
|
44
|
+
"unit_amount":30000,
|
45
|
+
"currency":"INR",
|
46
|
+
"type":"addon",
|
47
|
+
"unit":null,
|
48
|
+
"tax_inclusive":false,
|
49
|
+
"hsn_code":null,
|
50
|
+
"sac_code":null,
|
51
|
+
"tax_rate":null,
|
52
|
+
"tax_id":null,
|
53
|
+
"tax_group_id":null,
|
54
|
+
"created_at":1581597318,
|
55
|
+
"updated_at":1581597318
|
56
|
+
},
|
57
|
+
"quantity":2,
|
58
|
+
"created_at":1581597318,
|
59
|
+
"subscription_id":"sub_00000000000001",
|
60
|
+
"invoice_id":null
|
61
|
+
}
|
62
|
+
```
|
63
|
+
-------------------------------------------------------------------------------------------------------
|
64
|
+
|
65
|
+
### Fetch all addons
|
66
|
+
|
67
|
+
```rb
|
68
|
+
options = {"count": 2}
|
69
|
+
|
70
|
+
Razorpay::Addon.all(options)
|
71
|
+
```
|
72
|
+
|
73
|
+
**Parameters:**
|
74
|
+
|
75
|
+
| Name | Type | Description |
|
76
|
+
|-------|-----------|--------------------------------------------------|
|
77
|
+
| from | timestamp | timestamp after which the payments were created |
|
78
|
+
| to | timestamp | timestamp before which the payments were created |
|
79
|
+
| count | integer | number of payments to fetch (default: 10) |
|
80
|
+
| skip | integer | number of payments to be skipped (default: 0) |
|
81
|
+
|
82
|
+
**Response:**
|
83
|
+
```json
|
84
|
+
{
|
85
|
+
"entity": "collection",
|
86
|
+
"count": 1,
|
87
|
+
"items": [
|
88
|
+
{
|
89
|
+
"id": "ao_00000000000002",
|
90
|
+
"entity": "addon",
|
91
|
+
"item": {
|
92
|
+
"id": "item_00000000000002",
|
93
|
+
"active": true,
|
94
|
+
"name": "Extra sweet",
|
95
|
+
"description": "1 extra sweet of the day with meals",
|
96
|
+
"amount": 90000,
|
97
|
+
"unit_amount": 90000,
|
98
|
+
"currency": "INR",
|
99
|
+
"type": "addon",
|
100
|
+
"unit": null,
|
101
|
+
"tax_inclusive": false,
|
102
|
+
"hsn_code": null,
|
103
|
+
"sac_code": null,
|
104
|
+
"tax_rate": null,
|
105
|
+
"tax_id": null,
|
106
|
+
"tax_group_id": null,
|
107
|
+
"created_at": 1581597318,
|
108
|
+
"updated_at": 1581597318
|
109
|
+
},
|
110
|
+
"quantity": 1,
|
111
|
+
"created_at": 1581597318,
|
112
|
+
"subscription_id": "sub_00000000000001",
|
113
|
+
"invoice_id": "inv_00000000000001"
|
114
|
+
}
|
115
|
+
]
|
116
|
+
}
|
117
|
+
```
|
118
|
+
-------------------------------------------------------------------------------------------------------
|
119
|
+
|
120
|
+
### Fetch an addon
|
121
|
+
|
122
|
+
```rb
|
123
|
+
addonId = "ao_IrSY3UIqDRx7df"
|
124
|
+
|
125
|
+
Razorpay::Addon.fetch(addonId)
|
126
|
+
```
|
127
|
+
|
128
|
+
**Parameters:**
|
129
|
+
|
130
|
+
| Name | Type | Description |
|
131
|
+
|-----------------|---------|------------------------------------|
|
132
|
+
| addonId* | string | addon id to be fetched |
|
133
|
+
|
134
|
+
**Response:**
|
135
|
+
```json
|
136
|
+
{
|
137
|
+
"id":"ao_IrSY3UIqDRx7df",
|
138
|
+
"entity":"addon",
|
139
|
+
"item":{
|
140
|
+
"id":"item_00000000000001",
|
141
|
+
"active":true,
|
142
|
+
"name":"Extra appala (papadum)",
|
143
|
+
"description":"1 extra oil fried appala with meals",
|
144
|
+
"amount":30000,
|
145
|
+
"unit_amount":30000,
|
146
|
+
"currency":"INR",
|
147
|
+
"type":"addon",
|
148
|
+
"unit":null,
|
149
|
+
"tax_inclusive":false,
|
150
|
+
"hsn_code":null,
|
151
|
+
"sac_code":null,
|
152
|
+
"tax_rate":null,
|
153
|
+
"tax_id":null,
|
154
|
+
"tax_group_id":null,
|
155
|
+
"created_at":1581597318,
|
156
|
+
"updated_at":1581597318
|
157
|
+
},
|
158
|
+
"quantity":2,
|
159
|
+
"created_at":1581597318,
|
160
|
+
"subscription_id":"sub_00000000000001",
|
161
|
+
"invoice_id":null
|
162
|
+
}
|
163
|
+
```
|
164
|
+
----------------------------------------------------------------------------------------------------
|
165
|
+
|
166
|
+
### Delete an addon
|
167
|
+
|
168
|
+
```rb
|
169
|
+
addonId = "ao_IrSY3UIqDRx7df"
|
170
|
+
|
171
|
+
Razorpay::Addon.delete(addonId)
|
172
|
+
```
|
173
|
+
|
174
|
+
|
175
|
+
**Parameters:**
|
176
|
+
|
177
|
+
| Name | Type | Description |
|
178
|
+
|-----------------|---------|------------------------------------------------------------------------------|
|
179
|
+
| addonId* | string | addon id to be deleted |
|
180
|
+
|
181
|
+
**Response:**
|
182
|
+
|
183
|
+
```json
|
184
|
+
[]
|
185
|
+
```
|
186
|
+
-------------------------------------------------------------------------------------------------------
|
187
|
+
|
188
|
+
**PN: * indicates mandatory fields**
|
189
|
+
<br>
|
190
|
+
<br>
|
191
|
+
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#add-ons)**
|