Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed unused import from test.py #238

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
066f721
semgrep integration
javeeth Feb 22, 2022
f2ff14a
changes
thotakartheek004 Mar 7, 2022
d69ba9f
nosemgrep
thotakartheek004 Mar 7, 2022
fff9839
nosemgrep
thotakartheek004 Mar 7, 2022
6d7f4fa
nosemgrep
thotakartheek004 Mar 7, 2022
83f3013
changes
thotakartheek004 Mar 7, 2022
5dcf626
changes
thotakartheek004 Mar 7, 2022
12b73b7
changes
thotakartheek004 Mar 7, 2022
0352f2d
Merge pull request #186 from razorpay/semgrep_integration
thotakartheek004 Mar 7, 2022
a214b89
otp implement
ankitdas13 May 20, 2022
35fb125
customer doc correction
ankitdas13 Jun 14, 2022
27eb2ed
order doc correction
ankitdas13 Jun 14, 2022
ecd194f
fund doc correction
ankitdas13 Jun 14, 2022
6b0c8c1
token doc correction
ankitdas13 Jun 14, 2022
4744454
add fund link param
ankitdas13 Jun 14, 2022
75792d9
payment doc correction
ankitdas13 Jun 14, 2022
dc2ae1f
settlement doc correction
ankitdas13 Jun 15, 2022
a4b3cb8
refund doc correction
ankitdas13 Jun 15, 2022
ce6936d
fixed invoice doc
ankitdas13 Jun 17, 2022
7fa65e4
added tpv order
ankitdas13 Jun 20, 2022
364b2f7
added tpv payment
ankitdas13 Jun 20, 2022
a03715d
added tpv token
ankitdas13 Jun 20, 2022
a051d9b
fixed accourding comment
ankitdas13 Jun 28, 2022
f902b05
fixed according comments
ankitdas13 Jun 28, 2022
5e7d0ce
create order update parameter
ankitdas13 Jun 28, 2022
6239273
fixed according comments
ankitdas13 Jun 28, 2022
d993031
fixed according doc
ankitdas13 Jun 28, 2022
3d8286e
fixed according doc
ankitdas13 Jun 28, 2022
f238092
fixing according doc
ankitdas13 Jun 28, 2022
554eb55
update paramter & response
ankitdas13 Jun 29, 2022
1180fcc
fixed according sdkaudit doc
ankitdas13 Jun 29, 2022
deb969e
subscription doc correction
ankitdas13 Jun 29, 2022
b142989
addon doc correction
ankitdas13 Jun 29, 2022
06d0cf2
item doc correction
ankitdas13 Jun 29, 2022
3cb6e1b
paymentlink doc correction
ankitdas13 Jun 29, 2022
d56d973
smartcollect doc correction
ankitdas13 Jun 29, 2022
38e4081
update params in readme
ankitdas13 Jun 30, 2022
e719dca
transfer doc correction
ankitdas13 Jun 30, 2022
37dfc1c
create upi link update params
ankitdas13 Jun 30, 2022
f343ff0
added active param
ankitdas13 Jun 30, 2022
996d6fa
update delete addon
ankitdas13 Jun 30, 2022
5763be4
add double quotes
ankitdas13 Jun 30, 2022
aa8a5f7
added notes param
ankitdas13 Jun 30, 2022
89680fc
added partial payment param
ankitdas13 Jun 30, 2022
b6f225a
update response parameter
ankitdas13 Jul 1, 2022
3c1cad1
added notes param
ankitdas13 Jul 1, 2022
8689216
update param
ankitdas13 Jul 1, 2022
3d33bcd
update response and parameter
ankitdas13 Jul 1, 2022
ed24dd5
fixed according comments
ankitdas13 Jul 1, 2022
8008079
added fail_existing param
ankitdas13 Jul 1, 2022
14a6957
fixed according comments
ankitdas13 Jul 1, 2022
70050f0
fixed according comments
ankitdas13 Jul 1, 2022
e6fa144
response param change
ankitdas13 Jul 1, 2022
fede84e
add mandatory
ankitdas13 Jul 1, 2022
45aac00
response param update
ankitdas13 Jul 1, 2022
2391c11
Merge pull request #196 from razorpay/customer_doc_correction
ankitdas13 Jul 1, 2022
7c9d6bc
Merge pull request #194 from razorpay/otp_api
ankitdas13 Jul 1, 2022
62472d0
Merge pull request #198 from razorpay/settlement_doc_correction
ankitdas13 Jul 1, 2022
9c1f2a2
Merge pull request #197 from razorpay/refund_doc_correction
ankitdas13 Jul 1, 2022
cc30566
Merge pull request #201 from razorpay/invoice_doc_correction
ankitdas13 Jul 1, 2022
baf0188
Merge pull request #202 from razorpay/payment_doc_correction
ankitdas13 Jul 1, 2022
5ae88a2
Merge pull request #203 from razorpay/fund_doc_correction
ankitdas13 Jul 1, 2022
10afe36
Merge pull request #204 from razorpay/token_doc_correction
ankitdas13 Jul 1, 2022
8201891
Merge pull request #205 from razorpay/order_doc_correction
ankitdas13 Jul 1, 2022
2f6b6be
Merge pull request #208 from razorpay/qr_doc_correction
ankitdas13 Jul 1, 2022
fbbaca9
Merge pull request #209 from razorpay/emandate_doc_correction
ankitdas13 Jul 1, 2022
2585bf8
Merge pull request #210 from razorpay/card_doc_correction
ankitdas13 Jul 1, 2022
c2dfd57
Merge pull request #211 from razorpay/papernach_doc_correction
ankitdas13 Jul 1, 2022
9509b12
Merge pull request #212 from razorpay/registernach_doc_correction
ankitdas13 Jul 1, 2022
6f1d209
Merge pull request #213 from razorpay/upi_doc_correction
ankitdas13 Jul 1, 2022
b4fd63f
Merge pull request #214 from razorpay/registerEmandate_doc_correction
ankitdas13 Jul 1, 2022
7b1fd09
Merge pull request #217 from razorpay/item_doc_correction
ankitdas13 Jul 1, 2022
2cb9fb4
Merge pull request #218 from razorpay/subscription_doc_correction
ankitdas13 Jul 1, 2022
26ff1ca
Merge pull request #219 from razorpay/paymentlink_doc_correction
ankitdas13 Jul 1, 2022
3b6b884
Merge pull request #220 from razorpay/smartcollect_doc_correction
ankitdas13 Jul 1, 2022
17eb991
Merge pull request #221 from razorpay/transfer_doc_correction
ankitdas13 Jul 1, 2022
53d3755
Merge pull request #200 from razorpay/third_party_validation_payment
ankitdas13 Jul 1, 2022
c6dec90
Merge branch 'doc_api_correction' into third_party_validation
ankitdas13 Jul 1, 2022
53a8bb4
Merge pull request #199 from razorpay/third_party_validation
ankitdas13 Jul 1, 2022
af83bd7
Merge pull request #216 from razorpay/addon_api_correction
ankitdas13 Jul 1, 2022
da7e26c
update version
ankitdas13 Jul 1, 2022
912da6a
Merge pull request #193 from razorpay/doc_api_correction
ankitdas13 Jul 1, 2022
1da7ed3
create order params updated
ankitdas13 Jul 6, 2022
bd024a6
Merge pull request #222 from razorpay/papernach_param
ankitdas13 Jul 7, 2022
ce7d0a6
Update test.py
xeon-zolt Oct 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest
runs-on: ubuntu-latest # nosemgrep : semgrep.dev/s/swati31196:github_provided_runner
strategy:
max-parallel: 4
matrix:
Expand All @@ -30,4 +29,4 @@ jobs:
pip install responses
python3 setup.py install
- name: Run Tests
run: python3 -m unittest
run: python3 -m unittest
51 changes: 51 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: SecurityChecks
on:
pull_request: {}
push:
branches: ["master"]
schedule:
- cron: '30 20 * * *'
jobs:
semgrep:
name: Scan
runs-on: [ubuntu-latest] # nosemgrep : semgrep.dev/s/swati31196:github_provided_runner
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
with:
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: 339
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

workflow_status:
runs-on: [ ubuntu-latest ] # nosemgrep : semgrep.dev/s/swati31196:github_provided_runner
name: Update Status Check
needs: [ semgrep ]
if: always()
env:
githubCommit: ${{ github.event.pull_request.head.sha }}
steps:
- name: Set github commit id
run: |
if [ "${{ github.event_name }}" = "push" ] || [ "${{ github.event_name }}" = "schedule" ]; then
echo "githubCommit=${{ github.sha }}" >> $GITHUB_ENV
fi
exit 0
- name: Failed
id: failed
if: (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && github.ref != 'refs/heads/master'
run: |
echo 'Failing the workflow for github security status check.'
curl -X POST -H "Content-Type: application/json" -H "Authorization: token ${{ github.token }}" \
-d '{ "state" : "failure" , "context" : "github/security-status-check" , "description" : "github/security-status-check", "target_url" : "https://github.com/${{ github.repository }}" }' \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.githubCommit }}
exit 1
- name: Success
if: steps.failed.conclusion == 'skipped' || github.ref != 'refs/heads/master'
run: |
echo 'Status check has passed!'
curl -X POST -H "Content-Type: application/json" -H "Authorization: token ${{ github.token }}" \
-d '{ "state" : "success" , "context" : "github/security-status-check" , "description" : "github/security-status-check", "target_url" : "https://github.com/${{ github.repository }}" }' \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.githubCommit }}
exit 0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format

## Unreleased

## [1.3.1][1.3.1] - 2022-07-01

- Added Third party validation & Otp API for Payment (createUpi, validateVpa, otpGenerate, otpSubmit, otpResend)
- Update Documention

## [1.3.0][1.3.0] - 2022-02-01

### Added
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ that both app title and version are strings.

- [Token](documents/token.md)

- [Fund](documents/fund.md)

- [Order](documents/order.md)

- [Payments](documents/payment.md)
Expand Down
4 changes: 2 additions & 2 deletions documents/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ client.subscription.createAddon('sub_I55auG9GnbsR8u',{
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
| items* | object | Details of the add-on you want to create. |
| quantity* | integer | This specifies the number of units of the add-on to be charged to the customer. |
| items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-an-add-on) |
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |

**Response:**
```json
Expand Down
65 changes: 49 additions & 16 deletions documents/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ client.customer.create({

```py
client.order.create({
"amount": 50000,
"currency": "INR",
"receipt": "receipt#1",
"notes": {
"key1": "value3",
"key2": "value2"
}
"amount":100,
"currency":"INR",
"customer_id":"cust_4xbQrmEoA5WJ01",
"method":"card",
"token":{
"max_amount":5000,
"expire_at":2709971120,
"frequency":"monthly"
},
"receipt":"Receipt No. 1",
"notes":{
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey... decaf."
}
})
```

Expand All @@ -62,24 +69,35 @@ client.order.create({
|-----------------|---------|------------------------------------------------------------------------------|
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
| currency* | string | The currency of the payment (defaults to INR) |
| customerId* | string | The id of the customer to be fetched |
| receipt | string | Your system order reference id. |
| method* | string | Payment method used to make the registration transaction. Possible value is `card`. |
| token | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#112-create-an-order) are supported |
| notes | object | A key-value pair |

**Response:**
```json
{
"id": "order_EKwxwAgItmmXdp",
"id": "order_JmugUU7mFbXTRN",
"entity": "order",
"amount": 50000,
"amount": 100,
"amount_paid": 0,
"amount_due": 50000,
"amount_due": 100,
"currency": "INR",
"receipt": "receipt#1",
"receipt": "Receipt No. 1",
"offer_id": null,
"status": "created",
"attempts": 0,
"notes": [],
"created_at": 1582628071
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey... decaf."
},
"created_at": 1656418993,
"token": {
"max_amount": 5000,
"expire_at": 2709971120
},
"method": "card"
}
```
-------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -117,8 +135,7 @@ client.registration_link.create({

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | object | Details of the customer to whom the registration link will be sent. |
| type* | string | the value is `link`. |
| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#121-create-a-registration-link) are supported |
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
| currency* | string | The currency of the payment (defaults to INR) |
| description* | string | A brief description of the payment. |
Expand Down Expand Up @@ -515,8 +532,24 @@ client.card.fetch(cardId)

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| cardId* | string | card id to be fetched |
| cardId* | string | card id to be fetched |

**Response:**
```json
{
"id": "card_JXPULjlKqC5j0i",
"entity": "card",
"name": "Gaurav",
"last4": "4366",
"network": "Visa",
"type": "credit",
"issuer": "UTIB",
"international": false,
"emi": true,
"sub_type": "consumer",
"token_iin": null
}
```
-------------------------------------------------------------------------------------------------------

## Delete tokens
Expand Down
4 changes: 2 additions & 2 deletions documents/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ client.customer.all(options)

| Name | Type | Description |
|---------------|-------------|---------------------------------------------|
| count | integer | number of payments to fetch (default: 10) |
| skip | integer | number of payments to be skipped (default: 0) |
| count | integer | number of customers to fetch (default: 10) |
| skip | integer | number of customers to be skipped (default: 0) |

**Response:**
```json
Expand Down
24 changes: 16 additions & 8 deletions documents/emandate.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ client.customer.create({
client.order.create({
"amount": 0,
"currency": "INR",
"payment_capture": True,
"method": "emandate",
"customer_id": "cust_1Aa00000000001",
"receipt": "Receipt No. 1",
"notes": {
"notes_key_1": "Beam me up Scotty",
"notes_key_2": "Engage"
"notes_key_2": "Engage"
},
"token": {
"auth_type": "netbanking",
Expand All @@ -81,13 +82,15 @@ client.order.create({
| amount* | integer | Amount of the order to be paid |
| currency* | string | Currency of the order. Currently only `INR` is supported. |
| method* | string | The authorization method. In this case the value will be `emandate` |
| receipt | string | Your system order reference id. |
| receipt | string | Your system order reference id. |
| customer_id* | string | The `customer_id` for the customer you want to charge.|
| 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. |
| notes | object | A key-value pair |
| token | object | A key-value pair |
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|

**Response:**
Create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#112-create-an-order)

-------------------------------------------------------------------------------------------------------

### Create an Authorization Payment
Expand Down Expand Up @@ -136,16 +139,20 @@ client.registration_link.create({

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | object | Details of the customer to whom the registration link will be sent. |
| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
| type* | string | In this case, the value is `link`. |
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
| amount* | integer | The payment amount in the smallest currency sub-unit. |
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
| subscription_registration | object | Details of the authorization payment. |
| notes | object | A key-value pair |
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : 1) |
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
| receipt | string | Your system order reference id. |
| notes | array | A key-value pair |

**Response:**
Create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#121-create-a-registration-link)

-------------------------------------------------------------------------------------------------------

### Send/Resend notifications
Expand Down Expand Up @@ -371,6 +378,7 @@ client.token.delete(customerId,tokenId)
client.order.create({
"amount":1000,
"currency":"INR",
"payment_capture": True,
"receipt":"Receipt No. 1",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
Expand All @@ -386,8 +394,8 @@ client.order.create({
| amount* | integer | Amount of the order to be paid |
| currency* | string | Currency of the order. Currently only `INR` is supported. |
| receipt | string | Your system order reference id. |
| notes | object | A key-value pair |
| 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. |
| notes | object | A key-value pair |
| 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. |

**Response:**
```json
Expand Down
74 changes: 50 additions & 24 deletions documents/fund.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,28 @@ client.fund_account.create({
**Response:**
```json
{
"id":"fa_Aa00000000001",
"entity":"fund_account",
"customer_id":"cust_Aa000000000001",
"account_type":"bank_account",
"bank_account":{
"name":"Gaurav Kumar",
"account_number":"11214311215411",
"ifsc":"HDFC0000053",
"bank_name":"HDFC Bank"
"id": "fa_JexSeA2SS1S19D",
"entity": "fund_account",
"customer_id": "cust_JdumbHq5F3kKu6",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"active":true,
"created_at":1543650891
"batch_id": null,
"active": true,
"created_at": 1654682051
}
```
-------------------------------------------------------------------------------------------------------

### Fetch all fund accounts

```py
client.fund_account.fetch(customerId)
client.fund_account.all({"customer_id":customerId})
```

**Parameters:**
Expand All @@ -55,18 +57,42 @@ client.fund_account.fetch(customerId)
**Response:**
```json
{
"id":"fa_Aa00000000001",
"entity":"fund_account",
"customer_id":"cust_Aa000000000001",
"account_type":"bank_account",
"bank_account":{
"name":"Gaurav Kumar",
"account_number":"11214311215411",
"ifsc":"HDFC0000053",
"bank_name":"HDFC Bank"
},
"active":true,
"created_at":1543650891
"entity": "collection",
"count": 2,
"items": [
{
"id": "fa_JcXaLomo4ck5IY",
"entity": "fund_account",
"customer_id": "cust_JZse2vlC5nK9AQ",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"batch_id": null,
"active": true,
"created_at": 1654154246
},
{
"id": "fa_JcXYtecLkhW74k",
"entity": "fund_account",
"customer_id": "cust_JZse2vlC5nK9AQ",
"account_type": "bank_account",
"bank_account": {
"ifsc": "HDFC0000053",
"bank_name": "HDFC Bank",
"name": "Gaurav Kumar",
"notes": [],
"account_number": "11214311215411"
},
"batch_id": null,
"active": true,
"created_at": 1654154163
}
]
}
```
-------------------------------------------------------------------------------------------------------
Expand Down
Loading