razorpay 3.2.2 → 3.2.4
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/.cursorignore +174 -0
- data/.github/workflows/ci.yml +8 -7
- data/CHANGELOG.md +16 -0
- data/README.md +2 -0
- data/documents/customer.md +242 -0
- data/documents/dispute.md +301 -0
- data/documents/documents.md +65 -0
- data/documents/order.md +71 -0
- data/documents/payment.md +253 -0
- data/documents/transfers.md +40 -0
- data/lib/razorpay/constants.rb +1 -1
- data/lib/razorpay/customer.rb +16 -0
- data/lib/razorpay/dispute.rb +26 -0
- data/lib/razorpay/document.rb +19 -0
- data/lib/razorpay/order.rb +8 -0
- data/lib/razorpay/payment.rb +4 -0
- data/lib/razorpay/transfer.rb +4 -0
- data/lib/razorpay/utility.rb +8 -3
- data/lib/razorpay.rb +2 -0
- data/test/fixtures/dispute_collection.json +67 -0
- data/test/fixtures/dispute_error.json +10 -0
- data/test/fixtures/document_error.json +10 -0
- data/test/fixtures/error_customer.json +10 -0
- data/test/fixtures/error_eligibility.json +10 -0
- data/test/fixtures/error_eligibility_check.json +10 -0
- data/test/fixtures/fake_bank_account.json +9 -0
- data/test/fixtures/fake_dispute.json +29 -0
- data/test/fixtures/fake_document.json +9 -0
- data/test/fixtures/fake_eligiblity.json +79 -0
- data/test/fixtures/fake_fulfillment.json +10 -0
- data/test/fixtures/fake_payment_expanded_details.json +38 -0
- data/test/fixtures/fake_payment_expanded_details_card.json +50 -0
- data/test/fixtures/fake_rto.json +15 -0
- data/test/fixtures/order_error.json +10 -0
- data/test/fixtures/payment_error.json +10 -0
- data/test/fixtures/reversals_collection.json +22 -0
- data/test/fixtures/transfer_error.json +10 -0
- data/test/razorpay/test_customer.rb +105 -0
- data/test/razorpay/test_dispute.rb +98 -0
- data/test/razorpay/test_document.rb +27 -0
- data/test/razorpay/test_order.rb +43 -1
- data/test/razorpay/test_payment.rb +23 -1
- data/test/razorpay/test_transfer.rb +17 -0
- data/test/razorpay/test_utility.rb +2 -2
- metadata +51 -6
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
## Document
|
|
2
|
+
|
|
3
|
+
### Fetch All Disputes
|
|
4
|
+
|
|
5
|
+
```rb
|
|
6
|
+
Razorpay::Dispute.all()
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
**Response:**
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"entity": "collection",
|
|
13
|
+
"count": 1,
|
|
14
|
+
"items": [
|
|
15
|
+
{
|
|
16
|
+
"id": "disp_Esz7KAitoYM7PJ",
|
|
17
|
+
"entity": "dispute",
|
|
18
|
+
"payment_id": "pay_EsyWjHrfzb59eR",
|
|
19
|
+
"amount": 10000,
|
|
20
|
+
"currency": "INR",
|
|
21
|
+
"amount_deducted": 0,
|
|
22
|
+
"reason_code": "pre_arbitration",
|
|
23
|
+
"respond_by": 1590604200,
|
|
24
|
+
"status": "open",
|
|
25
|
+
"phase": "pre_arbitration",
|
|
26
|
+
"created_at": 1590059211,
|
|
27
|
+
"evidence": {
|
|
28
|
+
"amount": 10000,
|
|
29
|
+
"summary": null,
|
|
30
|
+
"shipping_proof": null,
|
|
31
|
+
"billing_proof": null,
|
|
32
|
+
"cancellation_proof": null,
|
|
33
|
+
"customer_communication": null,
|
|
34
|
+
"proof_of_service": null,
|
|
35
|
+
"explanation_letter": null,
|
|
36
|
+
"refund_confirmation": null,
|
|
37
|
+
"access_activity_log": null,
|
|
38
|
+
"refund_cancellation_policy": null,
|
|
39
|
+
"term_and_conditions": null,
|
|
40
|
+
"others": null,
|
|
41
|
+
"submitted_at": null
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
-------------------------------------------------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
### Fetch a Dispute
|
|
50
|
+
|
|
51
|
+
```rb
|
|
52
|
+
disputeId = "disp_0000000000000"
|
|
53
|
+
|
|
54
|
+
Razorpay::Dispute.fetch(disputeId)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Parameters:**
|
|
58
|
+
|
|
59
|
+
| Name | Type | Description |
|
|
60
|
+
|-------------|--------|--------------------------------------------------|
|
|
61
|
+
| disputeId* | string | The unique identifier of the dispute. |
|
|
62
|
+
|
|
63
|
+
**Response:**
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"id": "disp_AHfqOvkldwsbqt",
|
|
67
|
+
"entity": "dispute",
|
|
68
|
+
"payment_id": "pay_EsyWjHrfzb59eR",
|
|
69
|
+
"amount": 10000,
|
|
70
|
+
"currency": "INR",
|
|
71
|
+
"amount_deducted": 0,
|
|
72
|
+
"reason_code": "pre_arbitration",
|
|
73
|
+
"respond_by": 1590604200,
|
|
74
|
+
"status": "open",
|
|
75
|
+
"phase": "pre_arbitration",
|
|
76
|
+
"created_at": 1590059211,
|
|
77
|
+
"evidence": {
|
|
78
|
+
"amount": 10000,
|
|
79
|
+
"summary": "goods delivered",
|
|
80
|
+
"shipping_proof": null,
|
|
81
|
+
"billing_proof": null,
|
|
82
|
+
"cancellation_proof": null,
|
|
83
|
+
"customer_communication": null,
|
|
84
|
+
"proof_of_service": null,
|
|
85
|
+
"explanation_letter": null,
|
|
86
|
+
"refund_confirmation": null,
|
|
87
|
+
"access_activity_log": null,
|
|
88
|
+
"refund_cancellation_policy": null,
|
|
89
|
+
"term_and_conditions": null,
|
|
90
|
+
"others": null,
|
|
91
|
+
"submitted_at": null
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
-------------------------------------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
### Accept a Dispute
|
|
98
|
+
|
|
99
|
+
```rb
|
|
100
|
+
disputeId = "disp_0000000000000"
|
|
101
|
+
|
|
102
|
+
Razorpay::Dispute.accept(disputeId)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Parameters:**
|
|
106
|
+
|
|
107
|
+
| Name | Type | Description |
|
|
108
|
+
|-------------|--------|--------------------------------------------------|
|
|
109
|
+
| disputeId* | string | The unique identifier of the dispute. |
|
|
110
|
+
|
|
111
|
+
**Response:**
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"id": "disp_AHfqOvkldwsbqt",
|
|
115
|
+
"entity": "dispute",
|
|
116
|
+
"payment_id": "pay_EsyWjHrfzb59eR",
|
|
117
|
+
"amount": 10000,
|
|
118
|
+
"currency": "INR",
|
|
119
|
+
"amount_deducted": 10000,
|
|
120
|
+
"reason_code": "pre_arbitration",
|
|
121
|
+
"respond_by": 1590604200,
|
|
122
|
+
"status": "lost",
|
|
123
|
+
"phase": "pre_arbitration",
|
|
124
|
+
"created_at": 1590059211,
|
|
125
|
+
"evidence": {
|
|
126
|
+
"amount": 10000,
|
|
127
|
+
"summary": null,
|
|
128
|
+
"shipping_proof": null,
|
|
129
|
+
"billing_proof": null,
|
|
130
|
+
"cancellation_proof": null,
|
|
131
|
+
"customer_communication": null,
|
|
132
|
+
"proof_of_service": null,
|
|
133
|
+
"explanation_letter": null,
|
|
134
|
+
"refund_confirmation": null,
|
|
135
|
+
"access_activity_log": null,
|
|
136
|
+
"refund_cancellation_policy": null,
|
|
137
|
+
"term_and_conditions": null,
|
|
138
|
+
"others": null,
|
|
139
|
+
"submitted_at": null
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
-------------------------------------------------------------------------------------------------------
|
|
144
|
+
### Contest a Dispute (Draft)
|
|
145
|
+
|
|
146
|
+
```rb
|
|
147
|
+
# Use this API sample code for draft
|
|
148
|
+
|
|
149
|
+
disputeId = "disp_0000000000000"
|
|
150
|
+
|
|
151
|
+
Razorpay::Dispute.contest(disputeId,{
|
|
152
|
+
"amount": 5000,
|
|
153
|
+
"summary": "goods delivered",
|
|
154
|
+
"shipping_proof": [
|
|
155
|
+
"doc_EFtmUsbwpXwBH9",
|
|
156
|
+
"doc_EFtmUsbwpXwBH8"
|
|
157
|
+
],
|
|
158
|
+
"others": [
|
|
159
|
+
{
|
|
160
|
+
"type": "receipt_signed_by_customer",
|
|
161
|
+
"document_ids": [
|
|
162
|
+
"doc_EFtmUsbwpXwBH1",
|
|
163
|
+
"doc_EFtmUsbwpXwBH7"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"action": "draft"
|
|
168
|
+
})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Parameters:**
|
|
172
|
+
|
|
173
|
+
| Name | Type | Description |
|
|
174
|
+
|-----------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
175
|
+
| disputeId* | string | The unique identifier of the dispute. |
|
|
176
|
+
| amount | integer | The amount being contested. If the contest amount is not mentioned, we will assume it to be a full dispute contest. |
|
|
177
|
+
| summary | string | The explanation provided by you for contesting the dispute. It can have a maximum length of 1000 characters. |
|
|
178
|
+
| shipping_proof | array | List of document ids which serves as proof that the product was shipped to the customer at their provided address. It should show their complete shipping address, if possible. |
|
|
179
|
+
| others | array | All keys listed [here](https://razorpay.com/docs/api/disputes/contest) are supported |
|
|
180
|
+
| action | string | Possible value is `draft` or `submit` |
|
|
181
|
+
|
|
182
|
+
**Response:**
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"id": "disp_AHfqOvkldwsbqt",
|
|
186
|
+
"entity": "dispute",
|
|
187
|
+
"payment_id": "pay_EsyWjHrfzb59eR",
|
|
188
|
+
"amount": 10000,
|
|
189
|
+
"currency": "INR",
|
|
190
|
+
"amount_deducted": 0,
|
|
191
|
+
"reason_code": "chargeback",
|
|
192
|
+
"respond_by": 1590604200,
|
|
193
|
+
"status": "open",
|
|
194
|
+
"phase": "chargeback",
|
|
195
|
+
"created_at": 1590059211,
|
|
196
|
+
"evidence": {
|
|
197
|
+
"amount": 5000,
|
|
198
|
+
"summary": "goods delivered",
|
|
199
|
+
"shipping_proof": [
|
|
200
|
+
"doc_EFtmUsbwpXwBH9",
|
|
201
|
+
"doc_EFtmUsbwpXwBH8"
|
|
202
|
+
],
|
|
203
|
+
"billing_proof": null,
|
|
204
|
+
"cancellation_proof": null,
|
|
205
|
+
"customer_communication": null,
|
|
206
|
+
"proof_of_service": null,
|
|
207
|
+
"explanation_letter": null,
|
|
208
|
+
"refund_confirmation": null,
|
|
209
|
+
"access_activity_log": null,
|
|
210
|
+
"refund_cancellation_policy": null,
|
|
211
|
+
"term_and_conditions": null,
|
|
212
|
+
"others": [
|
|
213
|
+
{
|
|
214
|
+
"type": "receipt_signed_by_customer",
|
|
215
|
+
"document_ids": [
|
|
216
|
+
"doc_EFtmUsbwpXwBH1",
|
|
217
|
+
"doc_EFtmUsbwpXwBH7"
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"submitted_at": null
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
-------------------------------------------------------------------------------------------------------
|
|
227
|
+
### Contest a Dispute (Submit)
|
|
228
|
+
|
|
229
|
+
```rb
|
|
230
|
+
# Use this API sample code for submit
|
|
231
|
+
|
|
232
|
+
disputeId = "disp_0000000000000"
|
|
233
|
+
|
|
234
|
+
Razorpay::Dispute.contest(disputeId, {
|
|
235
|
+
"billing_proof": [
|
|
236
|
+
"doc_EFtmUsbwpXwBG9",
|
|
237
|
+
"doc_EFtmUsbwpXwBG8"
|
|
238
|
+
],
|
|
239
|
+
"action": "submit"
|
|
240
|
+
})
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Parameters:**
|
|
244
|
+
|
|
245
|
+
| Name | Type | Description |
|
|
246
|
+
|-----------------|---------|--------------------------------------------------------------------------------------|
|
|
247
|
+
| disputeId* | string | The unique identifier of the dispute. |
|
|
248
|
+
| billing_proof | integer | List of document ids which serves as proof of order confirmation, such as a receipt. |
|
|
249
|
+
| action | string | Possible value is `draft` or `submit` |
|
|
250
|
+
|
|
251
|
+
**Response:**
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"id": "disp_AHfqOvkldwsbqt",
|
|
255
|
+
"entity": "dispute",
|
|
256
|
+
"payment_id": "pay_EsyWjHrfzb59eR",
|
|
257
|
+
"amount": 10000,
|
|
258
|
+
"currency": "INR",
|
|
259
|
+
"amount_deducted": 0,
|
|
260
|
+
"reason_code": "chargeback",
|
|
261
|
+
"respond_by": 1590604200,
|
|
262
|
+
"status": "under_review",
|
|
263
|
+
"phase": "chargeback",
|
|
264
|
+
"created_at": 1590059211,
|
|
265
|
+
"evidence": {
|
|
266
|
+
"amount": 5000,
|
|
267
|
+
"summary": "goods delivered",
|
|
268
|
+
"shipping_proof": [
|
|
269
|
+
"doc_EFtmUsbwpXwBH9",
|
|
270
|
+
"doc_EFtmUsbwpXwBH8"
|
|
271
|
+
],
|
|
272
|
+
"billing_proof": [
|
|
273
|
+
"doc_EFtmUsbwpXwBG9",
|
|
274
|
+
"doc_EFtmUsbwpXwBG8"
|
|
275
|
+
],
|
|
276
|
+
"cancellation_proof": null,
|
|
277
|
+
"customer_communication": null,
|
|
278
|
+
"proof_of_service": null,
|
|
279
|
+
"explanation_letter": null,
|
|
280
|
+
"refund_confirmation": null,
|
|
281
|
+
"access_activity_log": null,
|
|
282
|
+
"refund_cancellation_policy": null,
|
|
283
|
+
"term_and_conditions": null,
|
|
284
|
+
"others": [
|
|
285
|
+
{
|
|
286
|
+
"type": "receipt_signed_by_customer",
|
|
287
|
+
"document_ids": [
|
|
288
|
+
"doc_EFtmUsbwpXwBH1",
|
|
289
|
+
"doc_EFtmUsbwpXwBH7"
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"submitted_at": 1590603200
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
-------------------------------------------------------------------------------------------------------
|
|
298
|
+
**PN: * indicates mandatory fields**
|
|
299
|
+
<br>
|
|
300
|
+
<br>
|
|
301
|
+
**For reference click [here](https://razorpay.com/docs/api/documents)**
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
## Document
|
|
2
|
+
|
|
3
|
+
### Create a Document
|
|
4
|
+
|
|
5
|
+
```rb
|
|
6
|
+
Razorpay::Document.create({
|
|
7
|
+
"file": File.new("/Users/your_name/Downloads/sample_uploaded.jpeg"),
|
|
8
|
+
"purpose": "dispute_evidence"
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Parameters:**
|
|
13
|
+
|
|
14
|
+
| Name | Type | Description |
|
|
15
|
+
|---------|-----------|-----------------------------------------------------------------|
|
|
16
|
+
| file* | string | The URL generated once the business proof document is uploaded. |
|
|
17
|
+
| purpose | string | Possible value is `dispute_evidence` |
|
|
18
|
+
|
|
19
|
+
**Response:**
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"id": "doc_EsyWjHrfzb59Re",
|
|
23
|
+
"entity": "document",
|
|
24
|
+
"purpose": "dispute_evidence",
|
|
25
|
+
"name": "doc_19_12_2020.jpg",
|
|
26
|
+
"mime_type": "image/png",
|
|
27
|
+
"size": 2863,
|
|
28
|
+
"created_at": 1590604200
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
-------------------------------------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
### Fetch Document Information
|
|
34
|
+
|
|
35
|
+
```rb
|
|
36
|
+
documentId = "doc_NiyXWXXXXXXXXX"
|
|
37
|
+
|
|
38
|
+
Razorpay::Document.fetch(documentId)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Parameters:**
|
|
42
|
+
|
|
43
|
+
| Name | Type | Description |
|
|
44
|
+
|-------------|-----------|--------------------------------------------------|
|
|
45
|
+
| documentId | string | The unique identifier of the document. |
|
|
46
|
+
|
|
47
|
+
**Response:**
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"entity": "document",
|
|
51
|
+
"id": "doc_00000000000000",
|
|
52
|
+
"purpose": "dispute_evidence",
|
|
53
|
+
"created_at": 1701701378,
|
|
54
|
+
"mime_type": "application/pdf",
|
|
55
|
+
"display_name": "ppm_00000000000000",
|
|
56
|
+
"size": 404678,
|
|
57
|
+
"url": ""
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
-------------------------------------------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
**PN: * indicates mandatory fields**
|
|
63
|
+
<br>
|
|
64
|
+
<br>
|
|
65
|
+
**For reference click [here](https://razorpay.com/docs/api/documents)**
|
data/documents/order.md
CHANGED
|
@@ -275,6 +275,77 @@ Razorpay::Order.edit(orderId,para_attr)
|
|
|
275
275
|
-------------------------------------------------------------------------------------------------------
|
|
276
276
|
|
|
277
277
|
|
|
278
|
+
### View RTO/Risk Reasons
|
|
279
|
+
|
|
280
|
+
```go
|
|
281
|
+
orderId = "order_XXXXXXXXXXXXX1"
|
|
282
|
+
|
|
283
|
+
Razorpay::Order.view_rto(orderId)
|
|
284
|
+
```
|
|
285
|
+
**Parameters**
|
|
286
|
+
|
|
287
|
+
| Name | Type | Description |
|
|
288
|
+
|----------|--------|------------------------------------- |
|
|
289
|
+
| orderId* | string | The unique identifier of an order to access the fulfillment information. |
|
|
290
|
+
|
|
291
|
+
**Response:**
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"risk_tier": "high",
|
|
295
|
+
"rto_reasons": [
|
|
296
|
+
{
|
|
297
|
+
"reason": "short_shipping_address",
|
|
298
|
+
"description": "Short shipping address",
|
|
299
|
+
"bucket": "address"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"reason": "address_pincode_state_mismatch",
|
|
303
|
+
"description": "Incorrect pincode state entered",
|
|
304
|
+
"bucket": "address"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
-------------------------------------------------------------------------------------------------------
|
|
310
|
+
|
|
311
|
+
### Update the Fulfillment Details
|
|
312
|
+
|
|
313
|
+
```rb
|
|
314
|
+
order_id = "order_XXXXXXXXXXXXX1"
|
|
315
|
+
|
|
316
|
+
para_attr = {
|
|
317
|
+
"payment_method": "upi",
|
|
318
|
+
"shipping": {
|
|
319
|
+
"waybill": "123456789",
|
|
320
|
+
"status": "rto",
|
|
321
|
+
"provider": "Bluedart"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
Razorpay::Order.edit_fulfillment(order_id, para_attr)
|
|
326
|
+
```
|
|
327
|
+
**Parameters**
|
|
328
|
+
|
|
329
|
+
| Name | Type | Description |
|
|
330
|
+
|----------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
331
|
+
| orderId* | string | The unique identifier of an order to access the fulfillment information. |
|
|
332
|
+
| payment_method | string | Payment Method opted by the customer to complete the payment. Possible values is `upi`, `card`, `wallet`, `netbanking`, `cod`, `emi`, `cardless_emi`, `paylater`, `recurring`, `other`. |
|
|
333
|
+
| shipping | object | Contains the shipping data. [here](https://razorpay.com/docs/payments/magic-checkout/rto-intelligence/#step-3-update-the-fulfillment-details) are supported |
|
|
334
|
+
|
|
335
|
+
**Response:**
|
|
336
|
+
```json
|
|
337
|
+
{
|
|
338
|
+
"entity": "order.fulfillment",
|
|
339
|
+
"order_id": "EKwxwAgItXXXX",
|
|
340
|
+
"payment_method": "upi",
|
|
341
|
+
"shipping": {
|
|
342
|
+
"waybill": "123456789",
|
|
343
|
+
"status": "rto",
|
|
344
|
+
"provider": "Bluedart"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
-------------------------------------------------------------------------------------------------------
|
|
278
349
|
**PN: * indicates mandatory fields**
|
|
279
350
|
<br>
|
|
280
351
|
<br>
|
data/documents/payment.md
CHANGED
|
@@ -863,6 +863,259 @@ Razorpay::Iin.fetch(tokenIin);
|
|
|
863
863
|
}
|
|
864
864
|
```
|
|
865
865
|
-------------------------------------------------------------------------------------------------------
|
|
866
|
+
-------------------------------------------------------------------------------------------------------
|
|
867
|
+
|
|
868
|
+
### Fetch a Payment (With Expanded EMI Details)
|
|
869
|
+
|
|
870
|
+
```rb
|
|
871
|
+
Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX",{"expand[]": "emi"})
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
**Parameters:**
|
|
875
|
+
|
|
876
|
+
| Name | Type | Description |
|
|
877
|
+
|-------------|---------|------------------------------------------------------------------|
|
|
878
|
+
| paymentId* | integer | Unique identifier of the payment |
|
|
879
|
+
| expand[] | string | Use to expand the `emi` details when the payment method is emi. |
|
|
880
|
+
|
|
881
|
+
**Response:** <br>
|
|
882
|
+
|
|
883
|
+
```json
|
|
884
|
+
{
|
|
885
|
+
"id": "pay_DG4ZdRK8ZnXC3k",
|
|
886
|
+
"entity": "payment",
|
|
887
|
+
"amount": 200000,
|
|
888
|
+
"currency": "INR",
|
|
889
|
+
"status": "authorized",
|
|
890
|
+
"order_id": null,
|
|
891
|
+
"invoice_id": null,
|
|
892
|
+
"international": false,
|
|
893
|
+
"method": "emi",
|
|
894
|
+
"amount_refunded": 0,
|
|
895
|
+
"refund_status": null,
|
|
896
|
+
"captured": false,
|
|
897
|
+
"description": null,
|
|
898
|
+
"card_id": "card_DG4ZdUO3xABb20",
|
|
899
|
+
"bank": "ICIC",
|
|
900
|
+
"wallet": null,
|
|
901
|
+
"vpa": null,
|
|
902
|
+
"email": "gaurav@example.com",
|
|
903
|
+
"contact": "+919972000005",
|
|
904
|
+
"notes": [],
|
|
905
|
+
"fee": null,
|
|
906
|
+
"tax": null,
|
|
907
|
+
"error_code": null,
|
|
908
|
+
"error_description": null,
|
|
909
|
+
"error_source": null,
|
|
910
|
+
"error_step": null,
|
|
911
|
+
"error_reason": null,
|
|
912
|
+
"emi": {
|
|
913
|
+
"issuer": "ICIC",
|
|
914
|
+
"rate": 1300,
|
|
915
|
+
"duration": 6
|
|
916
|
+
},
|
|
917
|
+
"acquirer_data": {
|
|
918
|
+
"auth_code": "828553"
|
|
919
|
+
},
|
|
920
|
+
"created_at": 1568026077
|
|
921
|
+
}
|
|
922
|
+
```
|
|
923
|
+
-------------------------------------------------------------------------------------------------------
|
|
924
|
+
|
|
925
|
+
### Fetch a Payment (With Expanded Card Details)
|
|
926
|
+
|
|
927
|
+
```rb
|
|
928
|
+
Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "card"})
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
**Parameters:**
|
|
932
|
+
|
|
933
|
+
| Name | Type | Description |
|
|
934
|
+
|-------------|---------|---------------------------------------------------------------------|
|
|
935
|
+
| paymentId* | integer | Unique identifier of the payment |
|
|
936
|
+
| expand[] | string | Use to expand the card details when the payment method is `card`. |
|
|
937
|
+
|
|
938
|
+
**Response:** <br>
|
|
939
|
+
|
|
940
|
+
```json
|
|
941
|
+
{
|
|
942
|
+
"id": "pay_H9oR0gLCaVlV6m",
|
|
943
|
+
"entity": "payment",
|
|
944
|
+
"amount": 100,
|
|
945
|
+
"currency": "INR",
|
|
946
|
+
"status": "failed",
|
|
947
|
+
"order_id": "order_H9o58N6qmLYQKC",
|
|
948
|
+
"invoice_id": null,
|
|
949
|
+
"terminal_id": "term_G5kJnYM9GhhLYT",
|
|
950
|
+
"international": false,
|
|
951
|
+
"method": "card",
|
|
952
|
+
"amount_refunded": 0,
|
|
953
|
+
"refund_status": null,
|
|
954
|
+
"captured": false,
|
|
955
|
+
"description": null,
|
|
956
|
+
"card_id": "card_H9oR0ocen1cmZq",
|
|
957
|
+
"card": {
|
|
958
|
+
"id": "card_H9oR0ocen1cmZq",
|
|
959
|
+
"entity": "card",
|
|
960
|
+
"name": "Gaurav",
|
|
961
|
+
"last4": "1213",
|
|
962
|
+
"network": "RuPay",
|
|
963
|
+
"type": "credit",
|
|
964
|
+
"issuer": "UTIB",
|
|
965
|
+
"international": false,
|
|
966
|
+
"emi": false,
|
|
967
|
+
"sub_type": "business"
|
|
968
|
+
},
|
|
969
|
+
"bank": null,
|
|
970
|
+
"wallet": null,
|
|
971
|
+
"vpa": null,
|
|
972
|
+
"email": "gaurav.kumar@example.com",
|
|
973
|
+
"contact": "+919000090000",
|
|
974
|
+
"notes": {
|
|
975
|
+
"email": "gaurav.kumar@example.com",
|
|
976
|
+
"phone": "09000090000"
|
|
977
|
+
},
|
|
978
|
+
"fee": null,
|
|
979
|
+
"tax": null,
|
|
980
|
+
"error_code": "BAD_REQUEST_ERROR",
|
|
981
|
+
"error_description": "Card issuer is invalid",
|
|
982
|
+
"error_source": "customer",
|
|
983
|
+
"error_step": "payment_authentication",
|
|
984
|
+
"error_reason": "incorrect_card_details",
|
|
985
|
+
"acquirer_data": {
|
|
986
|
+
"auth_code": null,
|
|
987
|
+
"authentication_reference_number": "100222021120200000000742753928"
|
|
988
|
+
},
|
|
989
|
+
"created_at": 1620807547
|
|
990
|
+
}
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
-------------------------------------------------------------------------------------------------------
|
|
994
|
+
|
|
995
|
+
### Fetch a Payment (With Expanded Offers Details)
|
|
996
|
+
|
|
997
|
+
```rb
|
|
998
|
+
Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "offers"})
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
**Parameters:**
|
|
1002
|
+
|
|
1003
|
+
| Name | Type | Description |
|
|
1004
|
+
|-------------|---------|----------------------------------------------------------------|
|
|
1005
|
+
| paymentId* | integer | Unique identifier of the payment |
|
|
1006
|
+
| expand[] | string | Use to expand the offers applied to a payment. |
|
|
1007
|
+
|
|
1008
|
+
**Response:** <br>
|
|
1009
|
+
|
|
1010
|
+
```json
|
|
1011
|
+
{
|
|
1012
|
+
"id": "pay_G8VaL2Z68LRtDs",
|
|
1013
|
+
"entity": "payment",
|
|
1014
|
+
"amount": 900,
|
|
1015
|
+
"currency": "INR",
|
|
1016
|
+
"status": "captured",
|
|
1017
|
+
"order_id": "order_G8VXfKDWDEOHHd",
|
|
1018
|
+
"invoice_id": null,
|
|
1019
|
+
"international": false,
|
|
1020
|
+
"method": "netbanking",
|
|
1021
|
+
"amount_refunded": 0,
|
|
1022
|
+
"refund_status": null,
|
|
1023
|
+
"captured": true,
|
|
1024
|
+
"offers": {
|
|
1025
|
+
"entity": "collection",
|
|
1026
|
+
"count": 1,
|
|
1027
|
+
"items": [
|
|
1028
|
+
{
|
|
1029
|
+
"id": "offer_G8VXOp0qNuEXzh"
|
|
1030
|
+
}
|
|
1031
|
+
]
|
|
1032
|
+
},
|
|
1033
|
+
"description": "Purchase Shoes",
|
|
1034
|
+
"card_id": null,
|
|
1035
|
+
"bank": "KKBK",
|
|
1036
|
+
"wallet": null,
|
|
1037
|
+
"vpa": null,
|
|
1038
|
+
"email": "gaurav.kumar@example.com",
|
|
1039
|
+
"contact": "+919000090000",
|
|
1040
|
+
"customer_id": "cust_DitrYCFtCIokBO",
|
|
1041
|
+
"notes": [],
|
|
1042
|
+
"fee": 22,
|
|
1043
|
+
"tax": 4,
|
|
1044
|
+
"error_code": null,
|
|
1045
|
+
"error_description": null,
|
|
1046
|
+
"error_source": null,
|
|
1047
|
+
"error_step": null,
|
|
1048
|
+
"error_reason": null,
|
|
1049
|
+
"acquirer_data": {
|
|
1050
|
+
"bank_transaction_id": "0125836177",
|
|
1051
|
+
"authentication_reference_number": "100222021120200000000742753928"
|
|
1052
|
+
},
|
|
1053
|
+
"created_at": 1606985740
|
|
1054
|
+
}
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
-------------------------------------------------------------------------------------------------------
|
|
1058
|
+
|
|
1059
|
+
### Fetch a Payment (With Expanded UPI Details)
|
|
1060
|
+
|
|
1061
|
+
```rb
|
|
1062
|
+
Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "upi"})
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
**Parameters:**
|
|
1066
|
+
|
|
1067
|
+
| Name | Type | Description |
|
|
1068
|
+
|-------------|---------|---------------------------------------------------------------|
|
|
1069
|
+
| paymentId* | integer | Unique identifier of the payment |
|
|
1070
|
+
| expand[] | string | Use to expand the UPI details when the payment method is upi. |
|
|
1071
|
+
|
|
1072
|
+
**Response:** <br>
|
|
1073
|
+
|
|
1074
|
+
```json
|
|
1075
|
+
{
|
|
1076
|
+
"id": "pay_DG4ZdRK8ZnXC3k",
|
|
1077
|
+
"entity": "payment",
|
|
1078
|
+
"amount": 100,
|
|
1079
|
+
"currency": "INR",
|
|
1080
|
+
"status": "captured",
|
|
1081
|
+
"order_id": "order_GjCr5oKh4AVC51",
|
|
1082
|
+
"invoice_id": null,
|
|
1083
|
+
"international": false,
|
|
1084
|
+
"method": "upi",
|
|
1085
|
+
"amount_refunded": 0,
|
|
1086
|
+
"refund_status": null,
|
|
1087
|
+
"captured": true,
|
|
1088
|
+
"description": "Payment for Adidas shoes",
|
|
1089
|
+
"card_id": null,
|
|
1090
|
+
"bank": null,
|
|
1091
|
+
"wallet": null,
|
|
1092
|
+
"vpa": "gaurav.kumar@upi",
|
|
1093
|
+
"email": "gaurav.kumar@example.com",
|
|
1094
|
+
"contact": "9000090000",
|
|
1095
|
+
"customer_id": "cust_K6fNE0WJZWGqtN",
|
|
1096
|
+
"token_id": "token_KOdY$DBYQOv08n",
|
|
1097
|
+
"notes": [],
|
|
1098
|
+
"fee": 1,
|
|
1099
|
+
"tax": 0,
|
|
1100
|
+
"error_code": null,
|
|
1101
|
+
"error_description": null,
|
|
1102
|
+
"error_source": null,
|
|
1103
|
+
"error_step": null,
|
|
1104
|
+
"error_reason": null,
|
|
1105
|
+
"acquirer_data": {
|
|
1106
|
+
"rrn": "303107535132"
|
|
1107
|
+
},
|
|
1108
|
+
"created_at": 1605871409,
|
|
1109
|
+
"upi": {
|
|
1110
|
+
"payer_account_type": "credit_card",
|
|
1111
|
+
"vpa": "gaurav.kumar@upi",
|
|
1112
|
+
"flow": "in_app" // appears only for Turbo UPI Payments.
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
```
|
|
1116
|
+
|
|
1117
|
+
-------------------------------------------------------------------------------------------------------
|
|
1118
|
+
|
|
866
1119
|
**PN: * indicates mandatory fields**
|
|
867
1120
|
<br>
|
|
868
1121
|
<br>
|