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.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +8 -0
- data/.github/workflows/ci.yml +79 -0
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/documents/Invoice.md +11 -3
- data/documents/addon.md +23 -1
- data/documents/card.md +30 -31
- 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 +204 -14
- data/documents/paymentLink.md +37 -19
- data/documents/plan.md +3 -3
- 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/subscriptions.md +3 -1
- data/documents/tokens.md +55 -1
- data/documents/transfers.md +292 -195
- data/documents/upi.md +25 -28
- data/documents/virtualAccount.md +18 -13
- data/lib/razorpay/addon.rb +4 -0
- data/lib/razorpay/constants.rb +1 -1
- data/lib/razorpay/payment.rb +8 -0
- data/lib/razorpay/payment_method.rb +17 -0
- data/lib/razorpay.rb +1 -0
- data/razorpay-ruby.gemspec +2 -1
- data/test/fixtures/fake_create_upi_payment.json +3 -0
- data/test/fixtures/fake_validate_vpa.json +5 -0
- data/test/fixtures/payment_methods_collection.json +149 -0
- data/test/razorpay/test_addon.rb +6 -2
- data/test/razorpay/test_payment.rb +46 -2
- data/test/test_helper.rb +2 -0
- metadata +30 -7
data/documents/qrcode.md
CHANGED
@@ -37,7 +37,7 @@ Razorpay::QrCode.create(para_attr)
|
|
37
37
|
| customer_id | string | Unique identifier of the customer the QR code is linked with |
|
38
38
|
| description | string | A brief description about the QR code. |
|
39
39
|
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
|
40
|
-
| notes |
|
40
|
+
| notes | object | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
41
41
|
|
42
42
|
**Response:**
|
43
43
|
```json
|
@@ -105,8 +105,8 @@ Razorpay::QrCode.create(para_attr)
|
|
105
105
|
| customer_id | string | Unique identifier of the customer the QR code is linked with |
|
106
106
|
| description | string | A brief description about the QR code. |
|
107
107
|
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
|
108
|
-
| notes |
|
109
|
-
| tax_invoice |
|
108
|
+
| notes | object | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
109
|
+
| tax_invoice | object | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. |
|
110
110
|
|
111
111
|
**Response:**
|
112
112
|
```json
|
@@ -258,26 +258,24 @@ Razorpay::QrCode.all(para_attr)
|
|
258
258
|
"count": 1,
|
259
259
|
"items": [
|
260
260
|
{
|
261
|
-
"id": "
|
261
|
+
"id": "qr_HMsqRoeVwKbwAF",
|
262
262
|
"entity": "qr_code",
|
263
|
-
"created_at":
|
264
|
-
"name": "
|
265
|
-
"usage": "
|
263
|
+
"created_at": 1623661499,
|
264
|
+
"name": "Fresh Groceries",
|
265
|
+
"usage": "multiple_use",
|
266
266
|
"type": "upi_qr",
|
267
|
-
"image_url": "https://rzp.io/i/
|
268
|
-
"payment_amount":
|
267
|
+
"image_url": "https://rzp.io/i/eI9XD54Q",
|
268
|
+
"payment_amount": null,
|
269
269
|
"status": "active",
|
270
|
-
"description": "
|
271
|
-
"fixed_amount":
|
272
|
-
"payments_amount_received":
|
273
|
-
"payments_count_received":
|
274
|
-
"notes":
|
275
|
-
"purpose": "Test UPI QR code notes"
|
276
|
-
},
|
270
|
+
"description": "Buy fresh groceries",
|
271
|
+
"fixed_amount": false,
|
272
|
+
"payments_amount_received": 1000,
|
273
|
+
"payments_count_received": 1,
|
274
|
+
"notes": [],
|
277
275
|
"customer_id": "cust_HKsR5se84c5LTO",
|
278
|
-
"close_by":
|
279
|
-
"
|
280
|
-
"
|
276
|
+
"close_by": 1624472999,
|
277
|
+
"close_reason": "paid",
|
278
|
+
"tax_invoice": null
|
281
279
|
}
|
282
280
|
]
|
283
281
|
}
|
data/documents/refund.md
CHANGED
@@ -31,7 +31,7 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr)
|
|
31
31
|
| paymentId* | string | The id of the payment |
|
32
32
|
| amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) | |
|
33
33
|
| speed | string | Here, it must be normal |
|
34
|
-
| notes |
|
34
|
+
| notes | object | A key-value pair |
|
35
35
|
| receipt | string | A unique identifier provided by you for your internal reference. |
|
36
36
|
|
37
37
|
**Response:**
|
@@ -50,7 +50,8 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr)
|
|
50
50
|
"created_at": 1597078866,
|
51
51
|
"batch_id": null,
|
52
52
|
"status": "processed",
|
53
|
-
"speed_processed": "normal"
|
53
|
+
"speed_processed": "normal",
|
54
|
+
"speed_requested": "normal"
|
54
55
|
}
|
55
56
|
```
|
56
57
|
-------------------------------------------------------------------------------------------------------
|
@@ -115,11 +116,11 @@ Razorpay::Payment.fetch_multiple_refund(paymentId,option)
|
|
115
116
|
|
116
117
|
| Name | Type | Description |
|
117
118
|
|-------|-----------|--------------------------------------------------|
|
118
|
-
| paymentId* | string
|
119
|
-
| from | timestamp | timestamp
|
120
|
-
| to | timestamp | timestamp
|
121
|
-
| count | integer | number of
|
122
|
-
| skip | integer | number of
|
119
|
+
| paymentId* | string | The id of the payment for which refund has been requested. |
|
120
|
+
| from | timestamp | UNIX timestamp at which the refunds were created. |
|
121
|
+
| to | timestamp | UNIX timestamp till which the refunds were created. |
|
122
|
+
| count | integer | The number of refunds to fetch for the payment. |
|
123
|
+
| skip | integer | The number of refunds to be skipped for the payment. |
|
123
124
|
|
124
125
|
**Refund:**
|
125
126
|
```json
|
@@ -164,8 +165,8 @@ Razorpay::Payment.fetch(paymentId).fetch_refund(refundId)
|
|
164
165
|
|
165
166
|
| Name | Type | Description |
|
166
167
|
|---------------|-------------|---------------------------------------------|
|
167
|
-
| paymentId* | string |
|
168
|
-
| refundId* | string |
|
168
|
+
| paymentId* | string | Unique identifier of the payment for which the refund has been made.|
|
169
|
+
| refundId* | string | Unique identifier of the refund to be retrieved. |
|
169
170
|
|
170
171
|
**Response:**
|
171
172
|
```json
|
@@ -291,7 +292,7 @@ Razorpay::Refund.fetch(refundId).edit(para_attr)
|
|
291
292
|
| Name | Type | Description |
|
292
293
|
|-------|-----------|--------------------------------------------------|
|
293
294
|
| refundId* | string | The id of the refund to be fetched |
|
294
|
-
| notes* |
|
295
|
+
| notes* | object | A key-value pair |
|
295
296
|
|
296
297
|
**Response:**
|
297
298
|
```json
|
@@ -53,31 +53,33 @@ Razorpay::Customer.create(para_attr)
|
|
53
53
|
|
54
54
|
```rb
|
55
55
|
para_attr = {
|
56
|
-
"amount":
|
56
|
+
"amount": 0,
|
57
57
|
"currency": "INR",
|
58
58
|
"method": "emandate",
|
59
|
-
"
|
59
|
+
"customer_id": "cust_1Aa00000000001",
|
60
|
+
"receipt": "Receipt No. 1",
|
60
61
|
"notes": {
|
61
|
-
"
|
62
|
-
"
|
62
|
+
"notes_key_1": "Beam me up Scotty",
|
63
|
+
"notes_key_2": "Engage"
|
63
64
|
},
|
64
65
|
"token": {
|
65
|
-
"first_payment_amount":
|
66
|
+
"first_payment_amount": 100,
|
66
67
|
"auth_type": "netbanking",
|
67
68
|
"max_amount": 9999900,
|
68
69
|
"expire_at": 4102444799,
|
69
70
|
"notes": {
|
70
|
-
"
|
71
|
-
"
|
71
|
+
"notes_key_1": "Tea, Earl Grey, Hot",
|
72
|
+
"notes_key_2": "Tea, Earl Grey… decaf."
|
72
73
|
},
|
73
74
|
"bank_account": {
|
74
75
|
"beneficiary_name": "Gaurav Kumar",
|
75
|
-
"account_number":
|
76
|
+
"account_number": "1121431121541121",
|
76
77
|
"account_type": "savings",
|
77
|
-
"ifsc_code": "
|
78
|
+
"ifsc_code": "HDFC0000001"
|
78
79
|
}
|
79
80
|
}
|
80
81
|
}
|
82
|
+
|
81
83
|
Razorpay::Order.create(para_attr)
|
82
84
|
```
|
83
85
|
|
@@ -147,7 +149,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
|
|
147
149
|
|
148
150
|
| Name | Type | Description |
|
149
151
|
|-----------------|---------|---------------------------------------------------------------|
|
150
|
-
| customer | object
|
152
|
+
| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link) are supported |
|
151
153
|
| type* | object | the value is `link`. |
|
152
154
|
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
153
155
|
| currency* | string | The currency of the payment (defaults to INR) |
|
@@ -161,6 +163,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
|
|
161
163
|
|
162
164
|
**Response:**
|
163
165
|
For create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link)
|
166
|
+
|
164
167
|
-------------------------------------------------------------------------------------------------------
|
165
168
|
|
166
169
|
## Create an order to charge the customer
|
@@ -170,6 +173,7 @@ para_attr ={
|
|
170
173
|
"amount": "100",
|
171
174
|
"currency": "INR",
|
172
175
|
"receipt": "Receipt No. 1",
|
176
|
+
"payment_capture": true,
|
173
177
|
"notes": {
|
174
178
|
"key1": "value3",
|
175
179
|
"key2": "value2"
|
@@ -214,17 +218,20 @@ Razorpay::Order.create(para_attr)
|
|
214
218
|
```rb
|
215
219
|
para_attr = {
|
216
220
|
"email": "gaurav.kumar@example.com",
|
217
|
-
"contact": 9123456789,
|
221
|
+
"contact": "9123456789",
|
218
222
|
"amount": 1000,
|
219
223
|
"currency": "INR",
|
220
|
-
"
|
224
|
+
"order_id": "order_1Aa00000000002",
|
225
|
+
"customer_id": "cust_1Aa00000000001",
|
226
|
+
"token": "token_1Aa00000000001",
|
227
|
+
"recurring": "1",
|
221
228
|
"description": "Creating recurring payment for Gaurav Kumar",
|
222
229
|
"notes": {
|
223
|
-
"
|
224
|
-
"
|
230
|
+
"note_key 1": "Beam me up Scotty",
|
231
|
+
"note_key 2": "Tea. Earl Gray. Hot."
|
225
232
|
}
|
226
233
|
}
|
227
|
-
Razorpay::Payment.
|
234
|
+
Razorpay::Payment.create_recurring_payment(para_attr)
|
228
235
|
```
|
229
236
|
**Parameters:**
|
230
237
|
|
@@ -258,7 +265,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
|
|
258
265
|
|
259
266
|
medium = "email"
|
260
267
|
|
261
|
-
Razorpay::Invoice.
|
268
|
+
Razorpay::Invoice.notify_by(invoiceId, medium)
|
262
269
|
```
|
263
270
|
**Parameters:**
|
264
271
|
|
@@ -369,7 +376,7 @@ For fetch token by payment id response please click [here](https://razorpay.com/
|
|
369
376
|
```rb
|
370
377
|
customerId = "cust_1Aa00000000004"
|
371
378
|
|
372
|
-
Razorpay::Customer.
|
379
|
+
Razorpay::Customer.fetch(customerId).fetchTokens
|
373
380
|
```
|
374
381
|
**Parameters:**
|
375
382
|
|
@@ -422,7 +429,7 @@ customerId = "cust_1Aa00000000004"
|
|
422
429
|
|
423
430
|
tokenId = "token_Hxe0skTXLeg9pF"
|
424
431
|
|
425
|
-
Razorpay::fetch(customerId).deleteToken(tokenId)
|
432
|
+
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
|
426
433
|
```
|
427
434
|
**Parameters:**
|
428
435
|
|
data/documents/registerNach.md
CHANGED
@@ -6,8 +6,7 @@ para_attr = {
|
|
6
6
|
"name": "Gaurav Kumar",
|
7
7
|
"contact": 9123456780,
|
8
8
|
"email": "gaurav.kumar@example.com",
|
9
|
-
"fail_existing": 0,
|
10
|
-
"gstin": "29XAbbA4369J1PA",
|
9
|
+
"fail_existing": "0",
|
11
10
|
"notes": {
|
12
11
|
"notes_key_1": "Tea, Earl Grey, Hot",
|
13
12
|
"notes_key_2": "Tea, Earl Grey… decaf."
|
@@ -48,30 +47,31 @@ Razorpay::Customer.create(para_attr)
|
|
48
47
|
|
49
48
|
```rb
|
50
49
|
para_attr = {
|
51
|
-
"amount":
|
50
|
+
"amount":0,
|
52
51
|
"currency": "INR",
|
53
52
|
"method": "nach",
|
54
|
-
"
|
53
|
+
"customer_id": "cust_1Aa00000000001",
|
54
|
+
"receipt": "Receipt No. 1",
|
55
55
|
"notes": {
|
56
|
-
"
|
57
|
-
"
|
56
|
+
"notes_key_1": "Beam me up Scotty",
|
57
|
+
"notes_key_2": "Engage"
|
58
58
|
},
|
59
|
-
"token":
|
59
|
+
"token":{
|
60
60
|
"first_payment_amount": 10000,
|
61
61
|
"auth_type": "physical",
|
62
|
-
"max_amount":
|
63
|
-
"expire_at":
|
62
|
+
"max_amount":10000000,
|
63
|
+
"expire_at":1580480689,
|
64
64
|
"notes": {
|
65
|
-
"
|
66
|
-
"
|
65
|
+
"notes_key_1": "Tea, Earl Grey, Hot",
|
66
|
+
"notes_key_2": "Tea, Earl Grey… decaf."
|
67
67
|
},
|
68
|
-
"bank_account":
|
68
|
+
"bank_account":{
|
69
|
+
"account_number": "11214311215411",
|
70
|
+
"ifsc_code": "HDFC0000001",
|
69
71
|
"beneficiary_name": "Gaurav Kumar",
|
70
|
-
"
|
71
|
-
"account_type": "savings",
|
72
|
-
"ifsc_code": "HDFC0001233"
|
72
|
+
"account_type": "savings"
|
73
73
|
},
|
74
|
-
"nach":
|
74
|
+
"nach":{
|
75
75
|
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
76
76
|
"form_reference2": "Method Paper NACH",
|
77
77
|
"description": "Paper NACH Gaurav Kumar"
|
@@ -85,22 +85,12 @@ Razorpay.Order.create(para_attr)
|
|
85
85
|
|
86
86
|
| Name | Type | Description |
|
87
87
|
|-----------------|---------|------------------------------------------------------------------------------|
|
88
|
-
| amount* | integer |
|
88
|
+
| amount* | integer | Amount in currency subunits. For Paper NACH, the amount has to be `0` |
|
89
89
|
| currency* | string | The currency of the payment (defaults to INR) |
|
90
90
|
| customerId* | string | The id of the customer to be fetched |
|
91
91
|
| method* | string | Payment method used to make the registration transaction. Possible value is `nach`. |
|
92
92
|
| receipt | string | Your system order reference id. |
|
93
|
-
| token
|
94
|
-
| token.max_amount | integer | Use to set the maximum amount per debit request. The value can range from `500` - `1000000000` (1cr, default value) |
|
95
|
-
| token.expire_at | integer | The timestamp, in Unix format, till when the registration link should expire |
|
96
|
-
| token.notes | object | A key-value pair |
|
97
|
-
| bank.account_number* | string | Customer's bank account number. |
|
98
|
-
| bank.ifsc_code* | string | Customer's bank IFSC |
|
99
|
-
| bank.beneficiary_name* | string | Customer's name |
|
100
|
-
| bank.account_type* | string | Customer's bank account. Possible value is `saving`(default), `current`, `cc`, `nre`, `nro` |
|
101
|
-
| nach.form_reference1 | string | A user-entered reference that appears on the NACH form |
|
102
|
-
| nach.form_reference2 | string | A user-entered reference that appears on the NACH form |
|
103
|
-
| nach.description | string | All keys listed |
|
93
|
+
| token | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported |
|
104
94
|
| notes | object | A key-value pair |
|
105
95
|
|
106
96
|
**Response:**
|
@@ -171,37 +161,36 @@ Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-n
|
|
171
161
|
|
172
162
|
```rb
|
173
163
|
para_attr = {
|
174
|
-
"customer":
|
164
|
+
"customer":{
|
175
165
|
"name": "Gaurav Kumar",
|
176
166
|
"email": "gaurav.kumar@example.com",
|
177
|
-
"contact": 9123456780
|
167
|
+
"contact": "9123456780"
|
178
168
|
},
|
179
|
-
"amount":
|
180
|
-
"type": "link",
|
169
|
+
"amount":0,
|
181
170
|
"currency": "INR",
|
182
|
-
"
|
183
|
-
"
|
184
|
-
|
171
|
+
"type": "link",
|
172
|
+
"description": "12 p.m. Meals",
|
173
|
+
"subscription_registration":{
|
185
174
|
"method": "nach",
|
186
175
|
"auth_type": "physical",
|
187
|
-
"
|
188
|
-
"expire_at": 1634215992,
|
189
|
-
"bank_account": {
|
176
|
+
"bank_account":{
|
190
177
|
"beneficiary_name": "Gaurav Kumar",
|
191
|
-
"account_number": 11214311215411,
|
178
|
+
"account_number": "11214311215411",
|
192
179
|
"account_type": "savings",
|
193
180
|
"ifsc_code": "HDFC0001233"
|
194
181
|
},
|
195
|
-
"nach":
|
182
|
+
"nach":{
|
196
183
|
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
197
184
|
"form_reference2": "Method Paper NACH"
|
198
|
-
}
|
185
|
+
},
|
186
|
+
"expire_at":1947483647,
|
187
|
+
"max_amount":50000
|
199
188
|
},
|
200
|
-
"receipt": "Receipt No.
|
201
|
-
"
|
202
|
-
"
|
203
|
-
"expire_by":
|
204
|
-
"notes":
|
189
|
+
"receipt": "Receipt No. 1",
|
190
|
+
"sms_notify":1,
|
191
|
+
"email_notify":1,
|
192
|
+
"expire_by":1647483647,
|
193
|
+
"notes":{
|
205
194
|
"note_key 1": "Beam me up Scotty",
|
206
195
|
"note_key 2": "Tea. Earl Gray. Hot."
|
207
196
|
}
|
@@ -213,8 +202,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
|
|
213
202
|
|
214
203
|
| Name | Type | Description |
|
215
204
|
|-----------------|---------|---------------------------------------------------------------|
|
216
|
-
| customer | object
|
217
|
-
| type* | object | the value is `link`. |
|
205
|
+
| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#121-create-a-registration-link) are supported |
|
218
206
|
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
219
207
|
| currency* | string | The currency of the payment (defaults to INR) |
|
220
208
|
| description* | string | A brief description of the payment. |
|
@@ -340,7 +328,7 @@ Razorpay::Order.create(para_attr)
|
|
340
328
|
| currency* | string | The currency of the payment (defaults to INR) |
|
341
329
|
| receipt | string | Your system order reference id. |
|
342
330
|
| notes | object | A key-value pair |
|
343
|
-
| 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. |
|
331
|
+
| 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. |
|
344
332
|
|
345
333
|
**Response:**
|
346
334
|
```json
|
@@ -372,14 +360,18 @@ para_attr = {
|
|
372
360
|
"contact": "9123456789",
|
373
361
|
"amount": 1000,
|
374
362
|
"currency": "INR",
|
363
|
+
"order_id": "order_1Aa00000000002",
|
364
|
+
"customer_id": "cust_1Aa00000000001",
|
365
|
+
"token": "token_1Aa00000000001",
|
375
366
|
"recurring": "1",
|
376
367
|
"description": "Creating recurring payment for Gaurav Kumar",
|
377
368
|
"notes": {
|
378
|
-
"
|
379
|
-
"
|
369
|
+
"note_key 1": "Beam me up Scotty",
|
370
|
+
"note_key 2": "Tea. Earl Gray. Hot."
|
380
371
|
}
|
381
372
|
}
|
382
|
-
|
373
|
+
|
374
|
+
Razorpay::Payment.create_recurring_payment(para_attr)
|
383
375
|
```
|
384
376
|
**Parameters:**
|
385
377
|
|
@@ -413,7 +405,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
|
|
413
405
|
|
414
406
|
medium = "email"
|
415
407
|
|
416
|
-
Razorpay::Invoice.
|
408
|
+
Razorpay::Invoice.notify_by(invoiceId, medium)
|
417
409
|
```
|
418
410
|
**Parameters:**
|
419
411
|
|
@@ -537,9 +529,9 @@ Razorpay::Invoice.cancel(invoiceId);
|
|
537
529
|
## Fetch token by payment id
|
538
530
|
|
539
531
|
```rb
|
540
|
-
|
532
|
+
paymentId = "pay_EnLNTjINiPkMEZ"
|
541
533
|
|
542
|
-
Razorpay::
|
534
|
+
Razorpay::Payment.fetch(paymentId)
|
543
535
|
```
|
544
536
|
**Parameters:**
|
545
537
|
|
@@ -593,7 +585,7 @@ Razorpay::Customer.fetchTokens(customerId)
|
|
593
585
|
```rb
|
594
586
|
customerId = "cust_1Aa00000000004"
|
595
587
|
|
596
|
-
Razorpay::Customer.
|
588
|
+
Razorpay::Customer.fetch(customerId).fetchTokens
|
597
589
|
```
|
598
590
|
**Parameters:**
|
599
591
|
|
@@ -638,7 +630,7 @@ customerId = "cust_1Aa00000000004"
|
|
638
630
|
|
639
631
|
tokenId = "token_Hxe0skTXLeg9pF"
|
640
632
|
|
641
|
-
Razorpay::fetch(customerId).deleteToken(tokenId)
|
633
|
+
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
|
642
634
|
```
|
643
635
|
**Parameters:**
|
644
636
|
|
data/documents/settlement.md
CHANGED
@@ -441,6 +441,7 @@ Razorpay::Settlement.fetch_all_ondemand_settlement(para_attr)
|
|
441
441
|
| to | timestamp | timestamp before which the payments were created |
|
442
442
|
| count | integer | number of payments to fetch (default: 10) |
|
443
443
|
| skip | integer | number of payments to be skipped (default: 0) |
|
444
|
+
| expand[] | string | Possible value is `ondemand_payouts`|
|
444
445
|
|
445
446
|
**Response:**<br>
|
446
447
|
For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements)
|
data/documents/subscriptions.md
CHANGED
@@ -44,6 +44,7 @@ Razorpay::Subscription.create(para_attr)
|
|
44
44
|
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
45
45
|
| addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. |
|
46
46
|
| notes | object | Notes you can enter for the contact for future reference. |
|
47
|
+
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
|
47
48
|
|
48
49
|
**Response:**
|
49
50
|
```json
|
@@ -123,6 +124,7 @@ Razorpay::Subscription.create(para_attr)
|
|
123
124
|
| addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. |
|
124
125
|
| notes | object | Notes you can enter for the contact for future reference. |
|
125
126
|
| notify_info | object | The customer's email and phone number to which notifications are to be sent. (PN: Use this object only if you have set the `customer_notify` parameter to 1. That is, Razorpay sends notifications to the customer.) |
|
127
|
+
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
|
126
128
|
|
127
129
|
**Response:**
|
128
130
|
```json
|
@@ -484,7 +486,7 @@ Razorpay::Subscription.cancel_scheduled_changes(subscriptionId)
|
|
484
486
|
```rb
|
485
487
|
subscriptionId = "sub_00000000000001"
|
486
488
|
|
487
|
-
options = {
|
489
|
+
options = {"pause_at": "now"}
|
488
490
|
|
489
491
|
Razorpay::Subscription.pause(subscriptionId,options)
|
490
492
|
```
|
data/documents/tokens.md
CHANGED
@@ -184,7 +184,7 @@ customerId = "cust_1Aa00000000004"
|
|
184
184
|
|
185
185
|
tokenId = "token_Hxe0skTXLeg9pF"
|
186
186
|
|
187
|
-
Razorpay::fetch(customerId).deleteToken(tokenId)
|
187
|
+
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
|
188
188
|
```
|
189
189
|
|
190
190
|
**Parameters:**
|
@@ -201,6 +201,60 @@ Razorpay::fetch(customerId).deleteToken(tokenId)
|
|
201
201
|
}
|
202
202
|
```
|
203
203
|
-------------------------------------------------------------------------------------------------------
|
204
|
+
### Fetch VPA tokens of a customer id
|
205
|
+
|
206
|
+
```rb
|
207
|
+
Razorpay::Customer.fetch(customerId).fetchTokens
|
208
|
+
```
|
209
|
+
|
210
|
+
**Parameters:**
|
211
|
+
|
212
|
+
| Name | Type | Description |
|
213
|
+
|---------------|-------------|---------------------------------------------|
|
214
|
+
| customerId* | string | The id of the customer to be fetched |
|
215
|
+
|
216
|
+
**Response:**
|
217
|
+
```json
|
218
|
+
{
|
219
|
+
"entity": "collection",
|
220
|
+
"count": 1,
|
221
|
+
"items": [
|
222
|
+
{
|
223
|
+
"id": "token_EeroOjvOvorT5L",
|
224
|
+
"entity": "token",
|
225
|
+
"token": "4ydxm47GQjrIEx",
|
226
|
+
"bank": null,
|
227
|
+
"wallet": null,
|
228
|
+
"method": "card",
|
229
|
+
"card": {
|
230
|
+
"entity": "card",
|
231
|
+
"name": "Gaurav Kumar",
|
232
|
+
"last4": "8430",
|
233
|
+
"network": "Visa",
|
234
|
+
"type": "credit",
|
235
|
+
"issuer": "HDFC",
|
236
|
+
"international": false,
|
237
|
+
"emi": true,
|
238
|
+
"expiry_month": 12,
|
239
|
+
"expiry_year": 2022,
|
240
|
+
"flows": {
|
241
|
+
"otp": true,
|
242
|
+
"recurring": true
|
243
|
+
}
|
244
|
+
},
|
245
|
+
"vpa": null,
|
246
|
+
"recurring": false,
|
247
|
+
"auth_type": null,
|
248
|
+
"mrn": null,
|
249
|
+
"used_at": 1586976724,
|
250
|
+
"created_at": 1586976724,
|
251
|
+
"expired_at": 1672511399,
|
252
|
+
"dcc_enabled": false
|
253
|
+
}
|
254
|
+
]
|
255
|
+
}
|
256
|
+
```
|
257
|
+
-------------------------------------------------------------------------------------------------------
|
204
258
|
|
205
259
|
**PN: * indicates mandatory fields**
|
206
260
|
<br>
|