-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d899315
commit 779d137
Showing
13 changed files
with
449 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## Document | ||
|
||
### Create a Document | ||
|
||
```java | ||
JSONObject request = new JSONObject(); | ||
request.put("file","/Users/your_name/Downloads/sample_uploaded.jpeg"); | ||
request.put("purpose","dispute_evidence"); | ||
|
||
Document document = instance.document.create(request); | ||
``` | ||
|
||
**Parameters:** | ||
|
||
| Name | Type | Description | | ||
|----------|-----------|-----------------------------------------------------------------| | ||
| file* | string | The URL generated once the business proof document is uploaded. | | ||
| purpose | string | Possible value is `dispute_evidence` | | ||
|
||
**Response:** | ||
```json | ||
{ | ||
"id": "doc_EsyWjHrfzb59Re", | ||
"entity": "document", | ||
"purpose": "dispute_evidence", | ||
"name": "doc_19_12_2020.jpg", | ||
"mime_type": "image/png", | ||
"size": 2863, | ||
"created_at": 1590604200 | ||
} | ||
``` | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
### Fetch Document Information | ||
|
||
```java | ||
String documentId = "doc_EsyWjHrfzb59Re"; | ||
|
||
Document document = instance.document.fetch(documentId); | ||
``` | ||
|
||
**Parameters:** | ||
|
||
| Name | Type | Description | | ||
|-------------|--------|--------------------------------------------------| | ||
| documentId | string | The unique identifier of the document. | | ||
|
||
**Response:** | ||
```json | ||
{ | ||
"entity": "document", | ||
"id": "doc_00000000000000", | ||
"purpose": "dispute_evidence", | ||
"created_at": 1701701378, | ||
"mime_type": "application/pdf", | ||
"display_name": "ppm_00000000000000", | ||
"size": 404678, | ||
"url": "" | ||
} | ||
``` | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
**PN: * indicates mandatory fields** | ||
<br> | ||
<br> | ||
**For reference click [here](https://razorpay.com/docs/api/documents)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.razorpay; | ||
|
||
import org.json.JSONObject; | ||
|
||
public class Document extends Entity { | ||
|
||
public Document(JSONObject jsonObject) { | ||
super(jsonObject); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.razorpay; | ||
|
||
import org.json.JSONObject; | ||
|
||
public class DocumentClient extends ApiClient { | ||
|
||
DocumentClient(String auth) {super(auth);} | ||
|
||
public Document create(JSONObject request) throws RazorpayException { | ||
return post(Constants.VERSION, Constants.DOCUMENTS, request); | ||
} | ||
|
||
public Document fetch(String id) throws RazorpayException { | ||
return get(Constants.VERSION, String.format(Constants.DOCUMENT_FETCH, id), null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.