From 066f72156cfef6ebce393118863f64844b6bbe7b Mon Sep 17 00:00:00 2001 From: "javeeth.basha" Date: Tue, 22 Feb 2022 16:15:41 +0530 Subject: [PATCH 01/60] semgrep integration --- .github/workflows/security.yml | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/security.yml diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 00000000..3e35981b --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,51 @@ +name: SecurityChecks +on: + pull_request: {} + push: + branches: ["master", "semgrep_integration"] + 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 From f2ff14ae8f2e22aecda0888ea841b99350f33776 Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:13:56 +0530 Subject: [PATCH 02/60] changes --- .github/workflows/python.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index eed9b5c9..617c42f6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,8 +13,7 @@ on: jobs: deploy: - - runs-on: ubuntu-latest + runs-on: [self-hosted] strategy: max-parallel: 4 matrix: @@ -30,4 +29,4 @@ jobs: pip install responses python3 setup.py install - name: Run Tests - run: python3 -m unittest \ No newline at end of file + run: python3 -m unittest From d69ba9f36a4e5671e05ebf15fca36738429f0743 Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:18:19 +0530 Subject: [PATCH 03/60] nosemgrep --- razorpay/resources/payment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/razorpay/resources/payment.py b/razorpay/resources/payment.py index 93a448d2..07195143 100644 --- a/razorpay/resources/payment.py +++ b/razorpay/resources/payment.py @@ -34,7 +34,7 @@ def fetch(self, payment_id, data={}, **kwargs): """ return super(Payment, self).fetch(payment_id, data, **kwargs) - def capture(self, payment_id, amount, data={}, **kwargs): + def capture(self, payment_id, amount, data={}, **kwargs): # nosemgrep : python.lang.correctness.common-mistakes.default-mutable-dict.default-mutable-dict """" Capture Payment for given Id @@ -49,7 +49,7 @@ def capture(self, payment_id, amount, data={}, **kwargs): data['amount'] = amount return self.post_url(url, data, **kwargs) - def refund(self, payment_id, amount, data={}, **kwargs): # pragma: no cover + def refund(self, payment_id, amount, data={}, **kwargs): # pragma: no cover # nosemgrep : python.lang.correctness.common-mistakes.default-mutable-dict.default-mutable-dict """" Refund Payment for given Id From fff98391b83334740a6115e475d162b832059031 Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:25:06 +0530 Subject: [PATCH 04/60] nosemgrep --- razorpay/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/razorpay/client.py b/razorpay/client.py index ba9ad28b..91e1d573 100644 --- a/razorpay/client.py +++ b/razorpay/client.py @@ -83,7 +83,7 @@ def _update_user_agent_header(self, options): def _get_version(self): version = "" - try: + try: # nosemgrep : gitlab.bandit.B110 version = pkg_resources.require("razorpay")[0].version except DistributionNotFound: # pragma: no cover pass From 6d7f4fa089f2b3d36e2c73aebe10a9c4a2b30a55 Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:25:54 +0530 Subject: [PATCH 05/60] nosemgrep --- razorpay/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/razorpay/client.py b/razorpay/client.py index 91e1d573..f835e139 100644 --- a/razorpay/client.py +++ b/razorpay/client.py @@ -137,7 +137,7 @@ def request(self, method, path, **options): raise BadRequestError(msg) elif str.upper(code) == ERROR_CODE.GATEWAY_ERROR: raise GatewayError(msg) - elif str.upper(code) == ERROR_CODE.SERVER_ERROR: + elif str.upper(code) == ERROR_CODE.SERVER_ERROR: # nosemgrep : python.lang.maintainability.useless-ifelse.useless-if-body raise ServerError(msg) else: raise ServerError(msg) From 83f30132442109eba516bedca84a258901b0f4dd Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:28:54 +0530 Subject: [PATCH 06/60] changes --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 617c42f6..00046c0d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,7 +13,7 @@ on: jobs: deploy: - runs-on: [self-hosted] + runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: From 5dcf626aba2c87a4688dee1c03dab5a7e33a7a0b Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:29:58 +0530 Subject: [PATCH 07/60] changes --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 00046c0d..6fa7a3b2 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,7 +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: From 12b73b780808cf2371a8343d04a0bff36043a0dd Mon Sep 17 00:00:00 2001 From: thotakartheek004 Date: Mon, 7 Mar 2022 17:31:13 +0530 Subject: [PATCH 08/60] changes --- .github/workflows/security.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 3e35981b..6a035cd4 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -2,7 +2,7 @@ name: SecurityChecks on: pull_request: {} push: - branches: ["master", "semgrep_integration"] + branches: ["master"] schedule: - cron: '30 20 * * *' jobs: From a214b8973d52dcfb4761ebc29ed65011097395a0 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 20 May 2022 14:00:22 +0530 Subject: [PATCH 09/60] otp implement --- documents/payment.md | 95 ++++++++++++++++++++++++++++++ razorpay/resources/payment.py | 40 +++++++++++++ tests/mocks/fake_otp_generate.json | 19 ++++++ tests/mocks/fake_otp_resend.json | 7 +++ tests/mocks/fake_otp_submit.json | 5 ++ tests/test_client_payment.py | 45 +++++++++++++- 6 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 tests/mocks/fake_otp_generate.json create mode 100644 tests/mocks/fake_otp_resend.json create mode 100644 tests/mocks/fake_otp_submit.json diff --git a/documents/payment.md b/documents/payment.md index b9addc4a..00c87dab 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -438,6 +438,101 @@ client.payment.createPaymentJson({ ``` ------------------------------------------------------------------------------------------------------- +### OTP Generate + +```py +client.payment.otpGenerate(paymentId) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| paymentId* | integer | Unique identifier of the payment | + +Doc reference [doc](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/json/v2/build-integration/cards/#otp-generation-) + +**Response:**
+ +```json +{ + "razorpay_payment_id": "pay_FVmAstJWfsD3SO", + "next": [ + { + "action": "otp_submit", + "url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_submit/ac2d415a8be7595de09a24b41661729fd9028fdc?key_id=" + }, + { + "action": "otp_resend", + "url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_resend/json?key_id=" + } + ], + "metadata": { + "issuer": "HDFC", + "network": "MC", + "last4": "1111", + "iin": "411111" + } +} +``` +------------------------------------------------------------------------------------------------------- + +### OTP Submit + +```py +client.payment.otpSubmit(paymentId,{ + "otp": "12345" + }) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| otp* | string | The customer receives the OTP using their preferred notification medium - SMS or email | + +Doc reference [doc](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/json/v2/build-integration/cards/#response-on-submitting-otp) + +**Response:**
+Success +```json +{ + "razorpay_payment_id": "pay_D5jmY2H6vC7Cy3", + "razorpay_order_id": "order_9A33XWu170gUtm", + "razorpay_signature": "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d" +} +``` +------------------------------------------------------------------------------------------------------- + +### OTP Resend + +```py +client.payment.otpResend(paymentId) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| paymentId* | integer | Unique identifier of the payment | + +Doc reference [doc](https://razorpay.com/docs/payments/payment-methods/cards/authentication/native-otp/#otp-resend) + +**Response:**
+ +```json +{ + "next": [ + "otp_submit", + "otp_resend" + ], + "razorpay_payment_id": "pay_JWaNvYmrx75sXo" +} +``` + +------------------------------------------------------------------------------------------------------- + **PN: * indicates mandatory fields**

diff --git a/razorpay/resources/payment.py b/razorpay/resources/payment.py index 93a448d2..4cb36c36 100644 --- a/razorpay/resources/payment.py +++ b/razorpay/resources/payment.py @@ -223,3 +223,43 @@ def createRecurring(self, data={}, **kwargs): """ url = "{}/{}/recurring".format(self.base_url,'create') return self.post_url(url, data, **kwargs) + + def otpGenerate(self, payment_id, data={}, **kwargs): + """" + Otp Generate + + Args: + payment_id : Id for which upi transfer entity has to be fetched + + Returns: + Otp Dict which was created + """ + url = "{}/{}/otp_generate".format(self.base_url, payment_id) + return self.post_url(url, data, **kwargs) + + def otpSubmit(self, payment_id, data={}, **kwargs): + """" + Otp Submit + + Args: + payment_id : Id for which upi transfer entity has to be fetched + + Returns: + Otp Dict which was created + """ + url = "{}/{}/otp/submit".format(self.base_url, payment_id) + return self.post_url(url, data, **kwargs) + + def otpResend(self, payment_id, data={}, **kwargs): + """" + Otp Resend + + Args: + payment_id : Id for which upi transfer entity has to be fetched + + Returns: + Otp Dict which was created + """ + url = "{}/{}/otp/resend".format(self.base_url, payment_id) + return self.post_url(url, data, **kwargs) + \ No newline at end of file diff --git a/tests/mocks/fake_otp_generate.json b/tests/mocks/fake_otp_generate.json new file mode 100644 index 00000000..26f14941 --- /dev/null +++ b/tests/mocks/fake_otp_generate.json @@ -0,0 +1,19 @@ +{ + "razorpay_payment_id": "pay_FVmAstJWfsD3SO", + "next": [ + { + "action": "otp_submit", + "url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_submit/ac2d415a8be7595de09a24b41661729fd9028fdc?key_id=" + }, + { + "action": "otp_resend", + "url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_resend/json?key_id=" + } + ], + "metadata": { + "issuer": "HDFC", + "network": "MC", + "last4": "1111", + "iin": "411111" + } +} diff --git a/tests/mocks/fake_otp_resend.json b/tests/mocks/fake_otp_resend.json new file mode 100644 index 00000000..1cca81f1 --- /dev/null +++ b/tests/mocks/fake_otp_resend.json @@ -0,0 +1,7 @@ +{ + "next": [ + "otp_submit", + "otp_resend" + ], + "razorpay_payment_id": "pay_JWaNvYmrx75sXo" + } \ No newline at end of file diff --git a/tests/mocks/fake_otp_submit.json b/tests/mocks/fake_otp_submit.json new file mode 100644 index 00000000..b13b5b23 --- /dev/null +++ b/tests/mocks/fake_otp_submit.json @@ -0,0 +1,5 @@ +{ + "razorpay_payment_id": "pay_D5jmY2H6vC7Cy3", + "razorpay_order_id": "order_9A33XWu170gUtm", + "razorpay_signature": "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d" +} diff --git a/tests/test_client_payment.py b/tests/test_client_payment.py index 794ccad0..0440f94f 100644 --- a/tests/test_client_payment.py +++ b/tests/test_client_payment.py @@ -196,8 +196,9 @@ def test_payment_json(self): responses.add(responses.POST, url, status=200, body=json.dumps(result), match_querystring=True) self.assertEqual(self.client.payment.createPaymentJson(param), result) - - def createRecurring(self): + + @responses.activate + def test_createRecurring(self): init = mock_file('init_create_recurring') result = mock_file('fake_create_recurring') url = "{}/{}/recurring".format(self.base_url,'create') @@ -208,3 +209,43 @@ def createRecurring(self): match_querystring=True) self.assertEqual(self.client.payment.createRecurring(init), result) + + @responses.activate + def test_otpGenerate(self): + result = mock_file('fake_otp_generate') + url = "{}/{}/otp_generate".format(self.base_url,'dummy_id') + responses.add(responses.POST, + url, + status=200, + body=json.dumps(result), + match_querystring=True) + + self.assertEqual(self.client.payment.otpGenerate('dummy_id'), result) + + @responses.activate + def test_otpSubmit(self): + param = { + "otp": "123456" + } + + result = mock_file('fake_otp_submit') + url = "{}/{}/otp/submit".format(self.base_url,'dummy_id') + responses.add(responses.POST, + url, + status=200, + body=json.dumps(result), + match_querystring=True) + + self.assertEqual(self.client.payment.otpSubmit('dummy_id',param), result) + + @responses.activate + def test_otpResend(self): + result = mock_file('fake_otp_resend') + url = "{}/{}/otp/resend".format(self.base_url,'dummy_id') + responses.add(responses.POST, + url, + status=200, + body=json.dumps(result), + match_querystring=True) + + self.assertEqual(self.client.payment.otpResend('dummy_id'), result) \ No newline at end of file From 35fb1251ee3bf06154d2ecbea3ecee8a12109ac1 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 11:28:52 +0530 Subject: [PATCH 10/60] customer doc correction --- documents/customer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/customer.md b/documents/customer.md index a2ec5716..157ac127 100644 --- a/documents/customer.md +++ b/documents/customer.md @@ -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 From 27eb2edadc83f9012ca66cd421e25ef533816409 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 13:09:01 +0530 Subject: [PATCH 11/60] order doc correction --- documents/order.md | 98 +++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 40 deletions(-) diff --git a/documents/order.md b/documents/order.md index 24ddfbe5..9cdb3bab 100644 --- a/documents/order.md +++ b/documents/order.md @@ -61,6 +61,9 @@ client.order.all(option) | skip | integer | number of orders to be skipped (default: 0) | | authorized | boolean | Orders for which orders are currently in authorized state. | | receipt | string | Orders with the provided value for receipt. | +| expand[] | string | Used to retrieve additional information about the payment. Possible value is `payments`,`payments.card`,`transfers` or `virtual_account` | +| authorized | boolean | Possible value is `0` or `1` | + **Response:** @@ -103,17 +106,21 @@ client.order.fetch(orderId) ```json { - "id":"order_DaaS6LOUAASb7Y", - "entity":"order", - "amount":2200, - "amount_paid":0, - "amount_due":2200, - "currency":"INR", - "receipt":"Receipt #211", - "status":"attempted", - "attempts":1, - "notes":[], - "created_at":1572505143 + "id": "order_Jc81IZnaXSMLFh", + "entity": "order", + "amount": 50000, + "amount_paid": 50000, + "amount_due": 0, + "currency": "INR", + "receipt": null, + "offer_id": null, + "status": "paid", + "attempts": 1, + "notes": { + "notes_key_1": "value1", + "notes_key_2": "value2" + }, + "created_at": 1654064215 } ``` ------------------------------------------------------------------------------------------------------- @@ -121,7 +128,7 @@ client.order.fetch(orderId) ### Fetch payments for an order ```py -client.order.payment(orderId) +client.order.payments(orderId) ``` **Parameters** @@ -132,35 +139,46 @@ client.order.payment(orderId) **Response:** ```json { - "entity":"collection", - "count":1, - "items":[ + "entity": "collection", + "count": 1, + "items": [ { - "id":"pay_DaaSOvhgcOfzgR", - "entity":"payment", - "amount":2200, - "currency":"INR", - "status":"captured", - "order_id":"order_DaaS6LOUAASb7Y", - "invoice_id":null, - "international":false, - "method":"card", - "amount_refunded":0, - "refund_status":null, - "captured":true, - "description":"Beans in every imaginable flavour", - "card_id":"card_DZon6fd8J3IcA2", - "bank":null, - "wallet":null, - "vpa":null, - "email":"gaurav.kumar@example.com", - "contact":"+919999999988", - "notes":[], - "fee":44, - "tax":0, - "error_code":null, - "error_description":null, - "created_at":1572505160 + "id": "pay_Jc81alhu5LmAUI", + "entity": "payment", + "amount": 50000, + "currency": "INR", + "status": "captured", + "order_id": "order_Jc81IZnaXSMLFh", + "invoice_id": "inv_Jc81IWvxf4TT1F", + "international": false, + "method": "upi", + "amount_refunded": 0, + "refund_status": null, + "captured": true, + "description": "Order # 2", + "card_id": null, + "bank": null, + "wallet": null, + "vpa": "success@razorpay", + "email": "sofiya.shaikh2@razorpay.com", + "contact": "+919702219003", + "customer_id": "cust_JR4BVKjKyJ7enk", + "token_id": "token_Jc81b6OBfodoi6", + "notes": { + "opencart_order_id": "2" + }, + "fee": 1180, + "tax": 180, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "acquirer_data": { + "rrn": "001000100002", + "upi_transaction_id": "npci_txn_id_for_Jc81alhu5LmAUI" + }, + "created_at": 1654064232 } ] } From ecd194f4d065f3b68fd95dd760e14199ee6d75ac Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 13:23:38 +0530 Subject: [PATCH 12/60] fund doc correction --- documents/fund.md | 74 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/documents/fund.md b/documents/fund.md index 6b8f1228..c6d6d6ed 100644 --- a/documents/fund.md +++ b/documents/fund.md @@ -24,18 +24,20 @@ 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 } ``` ------------------------------------------------------------------------------------------------------- @@ -43,7 +45,7 @@ client.fund_account.create({ ### Fetch all fund accounts ```py -client.fund_account.fetch(customerId) +client.fund_account.all({"customer_id":customerId}) ``` **Parameters:** @@ -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 + } + ] } ``` ------------------------------------------------------------------------------------------------------- From 6b0c8c1423044cb4b38cb73886946935316c4aa0 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 17:42:07 +0530 Subject: [PATCH 13/60] token doc correction --- documents/token.md | 154 ++++++++++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 71 deletions(-) diff --git a/documents/token.md b/documents/token.md index 25aa91e9..ccf4cf1b 100644 --- a/documents/token.md +++ b/documents/token.md @@ -70,47 +70,50 @@ client.token.all(customerId) **Response:** ```json { - "entity":"collection", - "count":1, - "items":[ - { - "id":"token_HouA2OQR5Z2jTL", - "entity":"token", - "token":"2JPRk664pZHUWG", - "bank":null, - "wallet":null, - "method":"card", - "card":{ - "entity":"card", - "name":"Gaurav Kumar", - "last4":"8950", - "network":"Visa", - "type":"credit", - "issuer":"STCB", - "international":false, - "emi":false, - "sub_type":"consumer", - "expiry_month":12, - "expiry_year":2021, - "flows":{ - "otp":true, - "recurring":true - } - }, - "recurring":true, - "recurring_details":{ - "status":"confirmed", - "failure_reason":null - }, - "auth_type":null, - "mrn":null, - "used_at":1629779657, - "created_at":1629779657, - "expired_at":1640975399, - "dcc_enabled":false, - "billing_address":null - } - ] + "entity": "collection", + "count": 1, + "items": [ + { + "id": "token_JIskPHR6HnypUV", + "entity": "token", + "token": "14LDXyJ1q4MKge", + "bank": null, + "wallet": null, + "method": "card", + "card": { + "entity": "card", + "name": "ankit", + "last4": "4366", + "network": "Visa", + "type": "credit", + "issuer": "UTIB", + "international": false, + "emi": true, + "sub_type": "consumer", + "token_iin": null, + "expiry_month": 12, + "expiry_year": 2022, + "flows": { + "otp": true, + "recurring": true + } + }, + "recurring": true, + "recurring_details": { + "status": "confirmed", + "failure_reason": null + }, + "auth_type": null, + "mrn": null, + "used_at": 1649861969, + "created_at": 1649861969, + "expired_at": 1672511399, + "status": null, + "notes": [], + "dcc_enabled": false, + "compliant_with_tokenisation_guidelines": false + } + ] } ``` ------------------------------------------------------------------------------------------------------- @@ -130,35 +133,44 @@ client.token.fetch(customerId, tokenId) **Response:** ```json { - "id": "token_Hxe0skTXLeg9pF", - "entity": "token", - "token": "F85BgXnGVwcuqV", - "bank": null, - "wallet": null, - "method": "card", - "card": { - "entity": "card", - "name": "ankit", - "last4": "5449", - "network": "MasterCard", - "type": "credit", - "issuer": "UTIB", - "international": false, - "emi": false, - "sub_type": "consumer", - "expiry_month": 12, - "expiry_year": 2024, - "flows": { - "recurring": true - } - }, - "recurring": true, - "auth_type": null, - "mrn": null, - "used_at": 1632976165, - "created_at": 1631687852, - "expired_at": 1634215992, - "dcc_enabled": false + "id": "token_JIskPHR6HnypUV", + "entity": "token", + "token": "14LDXyJ1q4MKge", + "bank": null, + "wallet": null, + "method": "card", + "card": { + "entity": "card", + "name": "ankit", + "last4": "4366", + "network": "Visa", + "type": "credit", + "issuer": "UTIB", + "international": false, + "emi": true, + "sub_type": "consumer", + "token_iin": null, + "expiry_month": 12, + "expiry_year": 2022, + "flows": { + "otp": true, + "recurring": true + } + }, + "recurring": true, + "recurring_details": { + "status": "confirmed", + "failure_reason": null + }, + "auth_type": null, + "mrn": null, + "used_at": 1649861969, + "created_at": 1649861969, + "expired_at": 1672511399, + "status": null, + "notes": [], + "dcc_enabled": false, + "compliant_with_tokenisation_guidelines": false } ``` ------------------------------------------------------------------------------------------------------- @@ -187,4 +199,4 @@ client.token.delete(customerId, tokenId) **PN: * indicates mandatory fields**

-**For reference click [here](https://razorpay.com/docs/api/recurring-payments/upi/tokens/)** \ No newline at end of file +**For reference click [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/tokens/)** \ No newline at end of file From 4744454c6986404765aa9284020efc44f7c15b3f Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 17:45:22 +0530 Subject: [PATCH 14/60] add fund link param --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2cc9c783..7b1e92ec 100644 --- a/README.md +++ b/README.md @@ -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) From 75792d9f6d838f6da5ba25eb9ea8458656f9793a Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 14 Jun 2022 18:40:57 +0530 Subject: [PATCH 15/60] payment doc correction --- documents/payment.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index b9addc4a..1aae3d30 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -15,7 +15,7 @@ client.payment.capture(paymentId,{ |-----------|---------|--------------------------------------------------------------------------------| | paymentId* | string | Id of the payment to capture | | 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) | +| currency* | string | The currency of the payment (defaults to INR) | **Response:** ```json @@ -127,6 +127,7 @@ client.payment.fetch(paymentId) | Name | Type | Description | |------------|--------|-----------------------------------| | paymentId* | string | Id of the payment to be retrieved | +| expand[] | string | Used to retrieve additional information about the payment. Possible value is `card`, `offers` or `emi`| **Response:** ```json @@ -259,6 +260,7 @@ client.payment.edit(paymentId,{ "wallet": null, "vpa": null, "email": "testme@acme.com", + "customer_id": "cust_JR4BVKjKyJ7enk", "notes": { "key1": "value1", "key2": "value2" @@ -312,16 +314,17 @@ client.payment.fetchCardDetails(paymentId) **Response:** ```json { - "id": "card_6krZ6bcjoeqyV9", + "id": "card_JXPULjlKqC5j0i", "entity": "card", - "name": "Gaurav", - "last4": "3335", + "name": "gaurav", + "last4": "4366", "network": "Visa", - "type": "debit", - "issuer": "SBIN", + "type": "credit", + "issuer": "UTIB", "international": false, - "emi": null, - "sub_type": "business" + "emi": true, + "sub_type": "consumer", + "token_iin": null } ``` ------------------------------------------------------------------------------------------------------- @@ -329,7 +332,7 @@ client.payment.fetchCardDetails(paymentId) ### Fetch Payment Downtime Details ```py -client.payment.fetchPaymentDowntime() +client.payment.fetchDownTime() ``` **Response:**
For payment downtime response please click [here](https://razorpay.com/docs/api/payments/downtime/#fetch-payment-downtime-details) From dc2ae1f458f2d210731fe9024eecdacc00ef737f Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 16 Jun 2022 00:30:09 +0530 Subject: [PATCH 16/60] settlement doc correction --- documents/settlement.md | 226 ++++++++++++++-------------------------- 1 file changed, 78 insertions(+), 148 deletions(-) diff --git a/documents/settlement.md b/documents/settlement.md index 693f8a15..5f948cc6 100644 --- a/documents/settlement.md +++ b/documents/settlement.md @@ -65,147 +65,6 @@ client.settlement.fetch(settlementId) ``` ------------------------------------------------------------------------------------------------------- -### Settlement report for a month - -```py -client.settlement.report({ - year: 2020, - month: 9 -}) -``` - -**Parameters:** - -| Name | Type | Description | -|---------------|-------------|---------------------------------------------| -| year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` | -| month* | integer | The month the settlement was received in the `MM` format. For example, `09` | -| day | integer | The date the settlement was received in the `DD` format. For example, `01` | -| count | integer | number of settlements to fetch (default: 10) | -| skip | integer | number of settlements to be skipped (default: 0) | - -**Response:** -```json -{ - "entity": "collection", - "count": 4, - "items": [ - { - "entity_id": "pay_DEXrnipqTmWVGE", - "type": "payment", - "debit": 0, - "credit": 97100, - "amount": 100000, - "currency": "INR", - "fee": 2900, - "tax": 0, - "on_hold": false, - "settled": true, - "created_at": 1567692556, - "settled_at": 1568176960, - "settlement_id": "setl_DGlQ1Rj8os78Ec", - "posted_at": null, - "credit_type": "default", - "description": "Recurring Payment via Subscription", - "notes": "{}", - "payment_id": null, - "settlement_utr": "1568176960vxp0rj", - "order_id": "order_DEXrnRiR3SNDHA", - "order_receipt": null, - "method": "card", - "card_network": "MasterCard", - "card_issuer": "KARB", - "card_type": "credit", - "dispute_id": null - }, - { - "entity_id": "rfnd_DGRcGzZSLyEdg1", - "type": "refund", - "debit": 242500, - "credit": 0, - "amount": 242500, - "currency": "INR", - "fee": 0, - "tax": 0, - "on_hold": false, - "settled": true, - "created_at": 1568107224, - "settled_at": 1568176960, - "settlement_id": "setl_DGlQ1Rj8os78Ec", - "posted_at": null, - "credit_type": "default", - "description": null, - "notes": "{}", - "payment_id": "pay_DEXq1pACSqFxtS", - "settlement_utr": "1568176960vxp0rj", - "order_id": "order_DEXpmZgffXNvuI", - "order_receipt": null, - "method": "card", - "card_network": "MasterCard", - "card_issuer": "KARB", - "card_type": "credit", - "dispute_id": null - }, - { - "entity_id": "trf_DEUoCEtdsJgvl7", - "type": "transfer", - "debit": 100296, - "credit": 0, - "amount": 100000, - "currency": "INR", - "fee": 296, - "tax": 46, - "on_hold": false, - "settled": true, - "created_at": 1567681786, - "settled_at": 1568176960, - "settlement_id": "setl_DGlQ1Rj8os78Ec", - "posted_at": null, - "credit_type": "default", - "description": null, - "notes": null, - "payment_id": "pay_DEApNNTR6xmqJy", - "settlement_utr": "1568176960vxp0rj", - "order_id": null, - "order_receipt": null, - "method": null, - "card_network": null, - "card_issuer": null, - "card_type": null, - "dispute_id": null - }, - { - "entity_id": "adj_EhcHONhX4ChgNC", - "type": "adjustment", - "debit": 0, - "credit": 1012, - "amount": 1012, - "currency": "INR", - "fee": 0, - "tax": 0, - "on_hold": false, - "settled": true, - "created_at": 1567681786, - "settled_at": 1568176960, - "settlement_id": "setl_DGlQ1Rj8os78Ec", - "posted_at": null, - "description": "test reason", - "notes": null, - "payment_id": null, - "settlement_utr": null, - "order_id": null, - "order_receipt": null, - "method": null, - "card_network": null, - "card_issuer": null, - "card_type": null, - "dispute_id": null - } - ] -} -``` -------------------------------------------------------------------------------------------------------- - ### Settlement recon ```py @@ -222,6 +81,8 @@ client.settlement.report({ | year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` | | month* | integer | The month the settlement was received in the `MM` format. For example, `09` | | day | integer | The day the settlement was received in the `DD` format. For example, | +| count | integer | Specifies the number of available settlements to be fetched. | +| skip | integer | Specifies the number of available settlements to be skipped when fetching a count. | **Response:** ```json @@ -350,7 +211,7 @@ client.settlement.report({ ```py client.settlement.create_ondemand_settlement({ "amount": 1221, - "settle_full_balance": 0, + "settle_full_balance": false, "description": "Testing", "notes": { "notes_key_1": "Tea, Earl Grey, Hot", @@ -410,6 +271,9 @@ client.settlement.create_ondemand_settlement({ } } ``` + +Create on-demand settlement please click [here](https://razorpay.com/docs/api/settlements/instant/#create-an-instant-settlement) + ------------------------------------------------------------------------------------------------------- ### Fetch all on-demand settlements @@ -421,13 +285,59 @@ client.settlement.fetch_all_ondemand_settlement(options) | Name | Type | Description | |-------|-----------|--------------------------------------------------| -| from | timestamp | timestamp after which the payments were created | -| to | timestamp | timestamp before which the payments were created | -| count | integer | number of payments to fetch (default: 10) | -| skip | integer | number of payments to be skipped (default: 0) | +| from | timestamp | timestamp after which the settlements were created | +| to | timestamp | timestamp before which the settlements were created | +| count | integer | number of settlements to fetch (default: 10) | +| skip | integer | number of settlements to be skipped (default: 0) | **Response:**
-For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements) + +```json +{ + "entity": "collection", + "count": 2, + "items": [ + { + "id": "setlod_FNj7g2YS5J67Rz", + "entity": "settlement.ondemand", + "amount_requested": 200000, + "amount_settled": 199410, + "amount_pending": 0, + "amount_reversed": 0, + "fees": 590, + "tax": 90, + "currency": "INR", + "settle_full_balance": false, + "status": "processed", + "description": "Need this to make vendor payments.", + "notes": { + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." + }, + "created_at": 1596771429 + }, + { + "id": "setlod_FJOp0jOWlalIvt", + "entity": "settlement.ondemand", + "amount_requested": 300000, + "amount_settled": 299114, + "amount_pending": 0, + "amount_reversed": 0, + "fees": 886, + "tax": 136, + "currency": "INR", + "settle_full_balance": false, + "status": "processed", + "description": "Need this to buy stock.", + "notes": { + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." + }, + "created_at": 1595826576 + } + ] +} +``` ------------------------------------------------------------------------------------------------------- @@ -444,8 +354,28 @@ client.settlement.fetch_ondemand_settlement_id(settlementId) | settlementId* | string | Settlement Id of the On-demand settlement| **Response:** -For on-demand settlement by ID response please click [here](https://razorpay.com/docs/api/settlements/#fetch-on-demand-settlements-by-id) +```json +{ + "id": "setlod_FNj7g2YS5J67Rz", + "entity": "settlement.ondemand", + "amount_requested": 200000, + "amount_settled": 199410, + "amount_pending": 0, + "amount_reversed": 0, + "fees": 590, + "tax": 90, + "currency": "INR", + "settle_full_balance": false, + "status": "processed", + "description": "Need this to make vendor payments.", + "notes": { + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." + }, + "created_at": 1596771429 +} +``` ------------------------------------------------------------------------------------------------------- **PN: * indicates mandatory fields** From a4b3cb8800e7e511b88bc623ba066eabda6ca004 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 16 Jun 2022 01:04:02 +0530 Subject: [PATCH 17/60] refund doc correction --- documents/refund.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/refund.md b/documents/refund.md index debdecf6..3620acac 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -249,7 +249,7 @@ client.refund.fetch(refundId) ### Update the refund ```py -client.refund.edit({ +client.refund.edit(refundId,{ "notes": { "notes_key_1": "Beam me up Scotty.", "notes_key_2": "Engage" From ce6936d14ea19faf116615f089372d79fc1e3953 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 17 Jun 2022 17:58:15 +0530 Subject: [PATCH 18/60] fixed invoice doc --- documents/invoice.md | 107 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 98 insertions(+), 9 deletions(-) diff --git a/documents/invoice.md b/documents/invoice.md index 59fda466..1201be93 100644 --- a/documents/invoice.md +++ b/documents/invoice.md @@ -8,7 +8,7 @@ In this example, an invoice is created using the customer and item details. Here client.invoice.create({ "type": "invoice", "description": "Invoice for the month of January 2020", - "partial_payment": 1, + "partial_payment": true, "customer": { "name": "Gaurav Kumar", "contact": 9999999999, @@ -16,7 +16,7 @@ client.invoice.create({ "billing_address": { "line1": "Ground & 1st Floor, SJR Cyber Laskar", "line2": "Hosur Road", - "zipcode": 560068, + "zipcode": "560068", "city": "Bengaluru", "state": "Karnataka", "country": "in" @@ -24,7 +24,7 @@ client.invoice.create({ "shipping_address": { "line1": "Ground & 1st Floor, SJR Cyber Laskar", "line2": "Hosur Road", - "zipcode": 560068, + "zipcode": "560068", "city": "Bengaluru", "state": "Karnataka", "country": "in" @@ -35,7 +35,7 @@ client.invoice.create({ "name": "Master Cloud Computing in 30 Days", "description": "Book by Ravena Ravenclaw", "amount": 399, - "currency": "USD", + "currency": "USD", "quantity": 1 } ], @@ -52,9 +52,10 @@ client.invoice.create({ |-----------------|---------|------------------------------------------------------------------------------| |type* | string | entity type (here its invoice) | |description | string | A brief description of the invoice. | -|customer_id | string | customer id for which invoice need be raised | -|customer | array | customer details in a array format | -|line_items* | array | Details of the line item that is billed in the invoice. | +|customer_id | string | customer id for which invoice need be raised | +|draft | string | Invoice is created in draft state when value is set to `1` | +| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported | +| line_items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported | |expire_by | array | Details of the line item that is billed in the invoice. | |sms_notify | array | Details of the line item that is billed in the invoice. | |email_notify | array | Details of the line item that is billed in the invoice. | @@ -250,10 +251,98 @@ client.invoice.edit(invoiceId,{ | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| | invoiceId* | string | The id of the invoice to be fetched | +| line_items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#update-an-invoice) are supported | +| notes | array | key value pair | **Response:** -For update invoice response please click [here](https://razorpay.com/docs/api/invoices/#update-an-invoice) - +```json +{ + "id": "inv_DAweOiQ7amIUVd", + "entity": "invoice", + "receipt": "#0961", + "invoice_number": "#0961", + "customer_id": "cust_DAtUWmvpktokrT", + "customer_details": { + "id": "cust_DAtUWmvpktokrT", + "name": "Gaurav Kumar", + "email": "gaurav.kumar@example.com", + "contact": "9977886633", + "gstin": null, + "billing_address": { + "id": "addr_DAtUWoxgu91obl", + "type": "billing_address", + "primary": true, + "line1": "318 C-Wing, Suyog Co. Housing Society Ltd.", + "line2": "T.P.S Road, Vazira, Borivali", + "zipcode": "400092", + "city": "Mumbai", + "state": "Maharashtra", + "country": "in" + }, + "shipping_address": null, + "customer_name": "Gaurav Kumar", + "customer_email": "gaurav.kumar@example.com", + "customer_contact": "9977886633" + }, + "order_id": null, + "line_items": [ + { + "id": "li_DAweOizsysoJU6", + "item_id": null, + "name": "Book / English August - Updated name and quantity", + "description": "150 points in Quidditch", + "amount": 400, + "unit_amount": 400, + "gross_amount": 400, + "tax_amount": 0, + "taxable_amount": 400, + "net_amount": 400, + "currency": "INR", + "type": "invoice", + "tax_inclusive": false, + "hsn_code": null, + "sac_code": null, + "tax_rate": null, + "unit": null, + "quantity": 1, + "taxes": [] + } + ], + "payment_id": null, + "status": "draft", + "expire_by": 1567103399, + "issued_at": null, + "paid_at": null, + "cancelled_at": null, + "expired_at": null, + "sms_status": null, + "email_status": null, + "date": 1566891149, + "terms": null, + "partial_payment": false, + "gross_amount": 600, + "tax_amount": 0, + "taxable_amount": 600, + "amount": 600, + "amount_paid": null, + "amount_due": null, + "currency": "INR", + "currency_symbol": "₹", + "description": "This is a test invoice.", + "notes": { + "updated-key": "An updated note." + }, + "comment": null, + "short_url": null, + "view_less": true, + "billing_start": null, + "billing_end": null, + "type": "invoice", + "group_taxes_discounts": false, + "created_at": 1566906474, + "idempotency_key": null +} +``` ------------------------------------------------------------------------------------------------------- ### Issue an invoice From 7fa65e478a402eb9936d79f87550fa2c1d224ab0 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 20 Jun 2022 08:56:18 +0530 Subject: [PATCH 19/60] added tpv order --- documents/order.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/documents/order.md b/documents/order.md index 24ddfbe5..cffaed3c 100644 --- a/documents/order.md +++ b/documents/order.md @@ -45,6 +45,53 @@ client.order.create({ ------------------------------------------------------------------------------------------------------- +### Create order (Third party validation) + +```py +client.order.create({ + "amount": 500, + "method": "netbanking", + "receipt": "BILL13375649", + "currency": "INR", + "bank_account": { + "account_number": "765432123456789", + "name": "Gaurav Kumar", + "ifsc": "HDFC0000053" + } +}) +``` + +**Parameters:** + +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| amount* | integer | Amount of the order to be paid | +| method | string | The payment method used to make the payment. If this parameter is not passed, customers will be able to make payments using both netbanking and UPI payment methods. Possible values is `netbanking` or `upi`| +| currency* | string | Currency of the order. Currently only `INR` is supported. | +| receipt | string | Your system order reference id. | +|bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/#step-2-create-an-order) are supported | + +**Response:** + +```json +{ + "id": "order_GAWN9beXgaqRyO", + "entity": "order", + "amount": 500, + "amount_paid": 0, + "amount_due": 500, + "currency": "INR", + "receipt": "BILL13375649", + "offer_id": null, + "status": "created", + "attempts": 0, + "notes": [], + "created_at": 1573044247 +} +``` + +------------------------------------------------------------------------------------------------------- + ### Fetch all orders ```py From 364b2f75387b40e6c21d1f4fe094a7a9f3023d61 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 20 Jun 2022 08:58:01 +0530 Subject: [PATCH 20/60] added tpv payment --- documents/payment.md | 180 ++++++++++++++++++++++++++++++++++ razorpay/resources/payment.py | 27 +++++ 2 files changed, 207 insertions(+) diff --git a/documents/payment.md b/documents/payment.md index b9addc4a..69901bef 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -438,6 +438,186 @@ client.payment.createPaymentJson({ ``` ------------------------------------------------------------------------------------------------------- +### Create Payment Json (Third party validation) + +```py +client.payment.createPaymentJson({ + "amount": "500", + "currency": "INR", + "email": "gaurav.kumar@example.com", + "contact": "9123456789", + "order_id": "order_GAWN9beXgaqRyO", + "method": "netbanking", + "bank": "HDFC" +}) +``` + +**Parameters:** +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| amount* | integer | Amount of the order to be paid | +| currency* | string | The currency of the payment (defaults to INR) | +| order_id* | string | The unique identifier of the order created. | +| email* | string | Email of the customer | +| contact* | string | Contact number of the customer | +| method* | string | Possible value is `netbanking` | +| bank | string | The customer's bank code.For example, `HDFC`.| + + please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/netbanking#step-3-create-a-payment) for params + +**Response:**
+```json +{ + "razorpay_payment_id": "pay_GAWOYqPlvrtPSi", + "next": [ + { + "action": "redirect", + "url": "https://api.razorpay.com/v1/payments/pay_GAWOYqPlvrtPSi/authorize" + } + ] +} +``` +------------------------------------------------------------------------------------------------------- +### Create Payment UPI s2s / VPA token (Third party validation) + +```py +client.payment.createUpi({ + "amount": 200, + "currency": "INR", + "order_id": "order_GAWRjlWkVcRh0V", + "email": "gaurav.kumar@example.com", + "contact": "9123456789", + "method": "upi", + "customer_id": "cust_EIW4T2etiweBmG", + "save": 1, + "ip": "192.168.0.103", + "referer": "http", + "user_agent": "Mozilla/5.0", + "description": "Test flow", + "notes": { + "note_key": "value1" + }, + "upi": { + "flow": "collect", + "vpa": "gauravkumar@exampleupi", + "expiry_time": 5 + } +}) +``` + +**Parameters:** +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| amount* | integer | Amount of the order to be paid | +| currency* | string | The currency of the payment (defaults to INR) | +| order_id* | string | The unique identifier of the order created. | +| email* | string | Email of the customer | +| customer_id* | string | The id of the customer to be fetched | +| contact* | string | Contact number of the customer | +| notes | array | A key-value pair | +| description | string | Descriptive text of the payment. | +| save | boolean | Specifies if the VPA should be stored as tokens.Possible value is `0`, `1` | +| callback_url | string | URL where Razorpay will submit the final payment status. | +| ip* | string | The client's browser IP address. For example `117.217.74.98` | +| referer* | string | Value of `referer` header passed by the client's browser. For example, `https://example.com/` | +| user_agent* | string | Value of `user_agent` header passed by the client's browser. For example, `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36` | +| upi* (for Upi only) | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/collect#step-14-initiate-a-payment) are supported | + +**Response:**
+```json +{ + "razorpay_payment_id": "pay_EAm09NKReXi2e0" +} +``` +------------------------------------------------------------------------------------------------------- +### Create Payment UPI s2s / VPA token (Third party validation) + +```py +client.payment.createUpi({ + "amount": 100, + "currency": "INR", + "order_id": "order_Ee0biRtLOqzRjP", + "email": "gaurav.kumar@example.com", + "contact": "9090909090", + "method": "upi", + "ip": "192.168.0.103", + "referer": "http", + "user_agent": "Mozilla/5.0", + "description": "Test flow", + "notes": { + "purpose": "UPI test payment" + }, + "upi": { + "flow" : "intent" + } +}) +``` + +**Parameters:** +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| amount* | integer | Amount of the order to be paid | +| currency* | string | The currency of the payment (defaults to INR) | +| order_id* | string | The unique identifier of the order created. | +| email* | string | Email of the customer | +| customer_id* | string | The id of the customer to be fetched | +| contact* | string | Contact number of the customer | +| notes | array | A key-value pair | +| description | string | Descriptive text of the payment. | +| save | boolean | Specifies if the VPA should be stored as tokens.Possible value is `0`, `1` | +| callback_url | string | URL where Razorpay will submit the final payment status. | +| ip* | string | The client's browser IP address. For example `117.217.74.98` | +| referer* | string | Value of `referer` header passed by the client's browser. For example, `https://example.com/` | +| user_agent* | string | Value of `user_agent` header passed by the client's browser. For example, `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36` | +| upi* (for Upi only) | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/intent/#step-2-initiate-a-payment) are supported | + +**Response:**
+```json +{ + "razorpay_payment_id": "pay_CMeM6XvOPGFiF", + "link": "upi://pay?pa=success@razorpay&pn=xyz&tr=xxxxxxxxxxx&tn=gourav&am=1&cu=INR&mc=xyzw" +} +``` +------------------------------------------------------------------------------------------------------- + +### Valid VPA (Third party validation) + +```py +client.payment.validateVpa({ + "vpa": "gauravkumar@exampleupi" +}) +``` + +**Parameters:** +| Name | Type | Description | +|-------------|---------|--------------------------------------| +| vpa* | string | The virtual payment address (VPA) you want to validate. For example, `gauravkumar@exampleupi` | + + please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/collect#step-13-validate-the-vpa) for params + +**Response:**
+```json +{ + "vpa": "gauravkumar@exampleupi", + "success": true, + "customer_name": "Gaurav Kumar" +} +``` +------------------------------------------------------------------------------------------------------- + +### Fetch payment methods (Third party validation) + +```py +client = razorpay.Client(auth=("key", "")) // Use Only razorpay key +client.payment.fetchPaymentMethods() +``` + +**Response:**
+ please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/methods-api/#fetch-payment-methods) for response + +``` +------------------------------------------------------------------------------------------------------- + **PN: * indicates mandatory fields**

diff --git a/razorpay/resources/payment.py b/razorpay/resources/payment.py index 93a448d2..bfa38764 100644 --- a/razorpay/resources/payment.py +++ b/razorpay/resources/payment.py @@ -223,3 +223,30 @@ def createRecurring(self, data={}, **kwargs): """ url = "{}/{}/recurring".format(self.base_url,'create') return self.post_url(url, data, **kwargs) + + def createUpi(self, data={}, **kwargs): + """" + Initiate a payment + Return: + Payments dict + """ + url = "{}/create/{}".format(self.base_url,'upi') + return self.post_url(url, data, **kwargs) + + def validateVpa(self, data={}, **kwargs): + """" + Validate the VPA + Return: + Payments dict + """ + url = "{}/validate/{}".format(self.base_url,'vpa') + return self.post_url(url, data, **kwargs) + + def fetchPaymentMethods(self, **kwargs): + """" + Fetch payment methods + Return: + Payments dict + """ + url = "/{}".format('methods') + return self.get_url(url, {}, **kwargs) From a03715d7f3f294cf4748a6bbcf04a1d157622585 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 20 Jun 2022 09:03:02 +0530 Subject: [PATCH 21/60] added tpv token --- documents/token.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/documents/token.md b/documents/token.md index 25aa91e9..a43258b8 100644 --- a/documents/token.md +++ b/documents/token.md @@ -184,6 +184,63 @@ client.token.delete(customerId, tokenId) ``` ------------------------------------------------------------------------------------------------------- +### Fetch VPA tokens of a customer id + +```js +client.token.all(customerId) +``` + +**Parameters:** + +| Name | Type | Description | +|---------------|-------------|---------------------------------------------| +| customerId* | string | The id of the customer to be fetched | + + please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/collect/#step-22-fetch-vpa-tokens-of-a-customer) + +**Response:** +```json +{ + "entity": "collection", + "count": 1, + "items": [ + { + "id": "token_EeroOjvOvorT5L", + "entity": "token", + "token": "4ydxm47GQjrIEx", + "bank": null, + "wallet": null, + "method": "card", + "card": { + "entity": "card", + "name": "Gaurav Kumar", + "last4": "8430", + "network": "Visa", + "type": "credit", + "issuer": "HDFC", + "international": false, + "emi": true, + "expiry_month": 12, + "expiry_year": 2022, + "flows": { + "otp": true, + "recurring": true + } + }, + "vpa": null, + "recurring": false, + "auth_type": null, + "mrn": null, + "used_at": 1586976724, + "created_at": 1586976724, + "expired_at": 1672511399, + "dcc_enabled": false + } + ] +} +``` +------------------------------------------------------------------------------------------------------- + **PN: * indicates mandatory fields**

From a051d9bbba64ed2c46dfb1d83766add326ac93a3 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 28 Jun 2022 12:01:18 +0530 Subject: [PATCH 22/60] fixed accourding comment --- documents/qrcode.md | 66 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/documents/qrcode.md b/documents/qrcode.md index 7ef09181..84074f84 100644 --- a/documents/qrcode.md +++ b/documents/qrcode.md @@ -7,7 +7,7 @@ client.qrcode.create({ "type": "upi_qr", "name": "Store_1", "usage": "single_use", - "fixed_amount": true, + "fixed_amount": True, "payment_amount": 300, "description": "For Store 1", "customer_id": "cust_HKsR5se84c5LTO", @@ -240,24 +240,27 @@ client.qrcode.fetch(qrCodeId) "count": 1, "items": [ { - "id": "qr_HMsgvioW64f0vh", + "id": "qr_HO2r1MDprYtWRT", "entity": "qr_code", - "created_at": 1623660959, + "created_at": 1623915088, "name": "Store_1", "usage": "single_use", "type": "upi_qr", - "image_url": "https://rzp.io/i/DTa2eQR", + "image_url": "https://rzp.io/i/oCswTOcCo", "payment_amount": 300, - "status": "active", + "status": "closed", "description": "For Store 1", "fixed_amount": true, - "payments_amount_received": 0, - "payments_count_received": 0, + "payments_amount_received": 300, + "payments_count_received": 1, "notes": { "purpose": "Test UPI QR code notes" }, "customer_id": "cust_HKsR5se84c5LTO", - "close_by": 1681615838 + "close_by": 1681615838, + "closed_at": 1625558914, + "close_reason": "paid", + "tax_invoice": null } ] } @@ -299,7 +302,8 @@ client.qrcode.fetch(qrCodeId) "notes": [], "customer_id": "cust_HKsR5se84c5LTO", "close_by": 1624472999, - "close_reason": null + "close_reason": "paid", + "tax_invoice": null } ] } @@ -370,7 +374,7 @@ client.qrcode.fetch_all_payments(qrCodeId, options) ### Close a QR Code ```py -client.qrcode.close(qrCodeId); +client.qrcode.close(qrCodeId) ``` **Parameters:** @@ -406,6 +410,48 @@ client.qrcode.close(qrCodeId); ``` ------------------------------------------------------------------------------------------------------- +### Refund a Payment + +```py +client.payment.refund("pay_JRP3Y66cNcf2qF",{ + "amount": "100", + "notes": { + "notes_key_1": "Beam me up Scotty.", + "notes_key_2": "Engage" + } +}) +``` + +**Parameters:** + +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| paymentId* | string | The id of the payment to be refunded | +| amount | string | Amount to be refunded | +| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. | + +**Response:** +```json +{ + "id": "rfnd_FP8QHiV938haTz", + "entity": "refund", + "amount": 500100, + "receipt": "Receipt No. 31", + "currency": "INR", + "payment_id": "pay_29QQoUBi66xm2f", + "notes": [], + "receipt": null, + "acquirer_data": { + "arn": null + }, + "created_at": 1597078866, + "batch_id": null, + "status": "processed", + "speed_processed": "normal", + "speed_requested": "normal" +} +``` +------------------------------------------------------------------------------------------------------- **PN: * indicates mandatory fields**
From f902b057faa0f349cf87b4632ebd80d93c0284fa Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 28 Jun 2022 12:28:51 +0530 Subject: [PATCH 23/60] fixed according comments --- documents/emandate.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/documents/emandate.md b/documents/emandate.md index 2ed07424..e6980ef7 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -81,13 +81,14 @@ 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. | | 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 @@ -136,16 +137,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 @@ -371,6 +376,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", @@ -386,7 +392,7 @@ 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 | +| 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:** From 5e7d0ce43f742c74d6f0503366f87c7c0ed89c37 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 28 Jun 2022 13:00:34 +0530 Subject: [PATCH 24/60] create order update parameter --- documents/emandate.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documents/emandate.md b/documents/emandate.md index e6980ef7..69322882 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -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", @@ -82,6 +83,7 @@ client.order.create({ | 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. | +| 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 | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported| From 6239273199ea57486b56e640c348ec6e2a18e35a Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 28 Jun 2022 17:59:53 +0530 Subject: [PATCH 25/60] fixed according comments --- documents/card.md | 61 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/documents/card.md b/documents/card.md index ee9a453f..26684e03 100644 --- a/documents/card.md +++ b/documents/card.md @@ -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." + } }) ``` @@ -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" } ``` ------------------------------------------------------------------------------------------------------- @@ -515,8 +533,23 @@ client.card.fetch(cardId) | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| -| cardId* | string | card id to be fetched | +| cardId* | string | card id to be fetched | +```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 From d993031035199b279a1e9925f129e0eb4cda1dbe Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 29 Jun 2022 00:07:35 +0530 Subject: [PATCH 26/60] fixed according doc --- documents/papernach.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/documents/papernach.md b/documents/papernach.md index 9b2ea32e..9334be0c 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -74,28 +74,17 @@ client.order.create({ ``` **Parameters:** -| Name | Type |Description | + +| Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| | 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 | | method* | string | Payment method used to make the registration transaction. Possible value is `nach`. | | receipt | string | Your system order reference id. | -| token.auth_type* | string | Possible value is `physical`| -| token.max_amount | integer | Use to set the maximum amount per debit request. The value can range from `500` - `1000000000` (1cr, default value) | -| token.expire_at | integer | The timestamp, in Unix format, till when the registration link should expire | -| token.notes | object | A key-value pair | -| bank.account_number* | string | Customer's bank account number. | -| bank.ifsc_code* | string | Customer's bank IFSC | -| bank.beneficiary_name* | string | Customer's name | -| bank.account_type* | string | Customer's bank account. Possible value is `saving`(default), `current`, `cc`, `nre`, `nro` | -| nach.form_reference1 | string | A user-entered reference that appears on the NACH form | -| nach.form_reference2 | string | A user-entered reference that appears on the NACH form | -| nach.description | string | All keys listed | +| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#112-create-an-order) are supported | | notes | object | A key-value pair | -All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#112-create-an-order) are supported - **Response:** ```json { @@ -601,6 +590,7 @@ client.order.create({ "amount":1000, "currency":"INR", "receipt":"Receipt No. 1", + "payment_capture":True, "notes": { "notes_key_1":"Tea, Earl Grey, Hot", "notes_key_2":"Tea, Earl Grey… decaf." @@ -614,8 +604,10 @@ client.order.create({ |-----------------|---------|------------------------------------------------------------------------------| | amount* | integer | Amount of the order to be paid | | currency* | string | Currency of the order. Currently only `INR` is supported. | +| 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. | | receipt | string | Your system order reference id. | -| notes | object | A key-value pair | +| notes | array | A key-value pair | + **Response:** ```json { From 3d8286ec54ea0be19b5db1ab5c12f474df7dbe0e Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 29 Jun 2022 00:19:34 +0530 Subject: [PATCH 27/60] fixed according doc --- documents/upi.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/documents/upi.md b/documents/upi.md index 0bbbe311..00f1727d 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -6,6 +6,7 @@ client.customer.create({ "name": "Gaurav Kumar", "contact": 9123456780, "email": "gaurav.kumar@example.com", + "fail_existing": 0, "notes": { "notes_key_1": "Tea, Earl Grey, Hot", "notes_key_2": "Tea, Earl Grey… decaf." @@ -139,18 +140,16 @@ 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/upi/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 | -|sms_notify | array | Details of the line item that is billed in the invoice. | -|email_notify | array | Details of the line item that is billed in the invoice. | -|expire_by | array | Details of the line item that is billed in the invoice. | -|receipt | string | Your system order reference id. | -|notes | object | A key-value pair | +| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/create-authorization-transaction/#121-create-a-registration-link) are supported | +| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : 1) | +| 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. | +| notes | array | A key-value pair | **Response:** ```json @@ -436,6 +435,7 @@ client.order.create({ "amount":1000, "currency":"INR", "receipt":"Receipt No. 1", + "payment_capture":True, "notes": { "notes_key_1":"Tea, Earl Grey, Hot", "notes_key_2":"Tea, Earl Grey… decaf." @@ -450,7 +450,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 | +| notes | array | 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 From f238092e8203426be5a4e36fbd9c197d91c04c8d Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 29 Jun 2022 00:33:04 +0530 Subject: [PATCH 28/60] fixing according doc --- documents/registerNach.md | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/documents/registerNach.md b/documents/registerNach.md index e197d10c..485be54c 100644 --- a/documents/registerNach.md +++ b/documents/registerNach.md @@ -87,19 +87,8 @@ client.order.create({ | currency* | string | The currency of the payment (defaults to INR) | | customerId* | string | The id of the customer to be fetched | | method* | string | Payment method used to make the registration transaction. Possible value is `nach`. | -| receipt | string | Your system order reference id. | -| token.auth_type* | string | Possible value is `physical`| -| token.max_amount | integer | Use to set the maximum amount per debit request. The value can range from `500` - `1000000000` (1cr, default value) | -| token.expire_at | integer | The timestamp, in Unix format, till when the registration link should expire | -| token.notes | object | A key-value pair | -| bank.account_number* | string | Customer's bank account number. | -| bank.ifsc_code* | string | Customer's bank IFSC | -| bank.beneficiary_name* | string | Customer's name | -| bank.account_type* | string | Customer's bank account. Possible value is `saving`(default), `current`, `cc`, `nre`, `nro` | -| nach.form_reference1 | string | A user-entered reference that appears on the NACH form | -| nach.form_reference2 | string | A user-entered reference that appears on the NACH form | -| nach.description | string | All keys listed | -| notes | object | A key-value pair | +| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported | +| notes | array | A key-value pair | **Response:** ```json @@ -334,7 +323,7 @@ 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) | -| 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. | +| 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. | | receipt | string | Your system order reference id. | | notes | object | A key-value pair | @@ -368,11 +357,14 @@ client.payment.createRecurring({ "contact": "9123456789", "amount": 1000, "currency": "INR", + "order_id": "order_1Aa00000000002", + "customer_id": "cust_1Aa00000000001", + "token": "token_1Aa00000000001", "recurring": "1", "description": "Creating recurring payment for Gaurav Kumar", "notes": { - "key1": "value3", - "key2": "value2" + "note_key 1": "Beam me up Scotty", + "note_key 2": "Tea. Earl Gray. Hot." } }) ``` @@ -389,7 +381,7 @@ client.payment.createRecurring({ | tokenId* | string | The id of the token to be fetched | | recurring* | boolean | Possible values is `0` or `1` | | description | string | A brief description of the payment. | -| notes | object | A key-value pair | +| notes | array | A key-value pair | **Response:** ```json From 554eb55ac87dbc269b076d6bdd7fa7df9a63c159 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 29 Jun 2022 14:00:25 +0530 Subject: [PATCH 29/60] update paramter & response --- documents/registerNach.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documents/registerNach.md b/documents/registerNach.md index 485be54c..f1d74c57 100644 --- a/documents/registerNach.md +++ b/documents/registerNach.md @@ -47,9 +47,10 @@ client.customer.create({ ```py client.order.create({ - "amount": 100, + "amount": 0, "currency": "INR", "method": "nach", + "customer_id": "cust_1Aa00000000001", "receipt": "Receipt No. 5", "notes": { "note_key 1"": "Beam me up Scotty", @@ -89,6 +90,7 @@ client.order.create({ | method* | string | Payment method used to make the registration transaction. Possible value is `nach`. | | token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported | | notes | array | A key-value pair | +| receipt | string | Your system order reference id. | **Response:** ```json @@ -386,9 +388,7 @@ client.payment.createRecurring({ **Response:** ```json { - "razorpay_payment_id" : "pay_1Aa00000000001", - "razorpay_order_id" : "order_1Aa00000000001", - "razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d" + "razorpay_payment_id" : "pay_1Aa00000000001" } ``` ------------------------------------------------------------------------------------------------------- From 1180fcc2e5e96124867e8c61d624f18fa0d46b5b Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 29 Jun 2022 14:25:46 +0530 Subject: [PATCH 30/60] fixed according sdkaudit doc --- documents/registerEmandate.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/documents/registerEmandate.md b/documents/registerEmandate.md index 7619367c..7643841b 100644 --- a/documents/registerEmandate.md +++ b/documents/registerEmandate.md @@ -57,6 +57,7 @@ client.order.create({ "notes_key_2": "Engage" }, "token": { + "first_payment_amount": 100, "auth_type": "netbanking", "max_amount": 9999900, "expire_at": 4102444799, @@ -112,6 +113,7 @@ client.registration_link.create({ "currency": "INR", "description": "12 p.m. Meals", "subscription_registration": { + "first_payment_amount": 100, "method": "emandate", "auth_type": "netbanking", "expire_at": 1580480689, @@ -138,12 +140,12 @@ client.registration_link.create({ | Name | Type | Description | |-----------------|---------|---------------------------------------------------------------| -| customer | object | Details of the customer to whom the registration link will be sent. | +| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link) are supported | | type* | object | the value is `link`. | | 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. | -| subscription_registration | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#121-create-a-registration-link) are supported | +| subscription_registration | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link) are supported | | receipt | string | Your system order reference id. | | 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.| | sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : 1) | @@ -162,6 +164,7 @@ For create registration link response please click [here](https://razorpay.com/d client.order.create({ "amount":1000, "currency":"INR", + "payment_capture": True, "receipt":"Receipt No. 1", "notes": { "notes_key_1":"Tea, Earl Grey, Hot", @@ -175,6 +178,7 @@ 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) | +| 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. | | receipt | string | Your system order reference id. | | notes | object | A key-value pair | @@ -205,14 +209,17 @@ client.order.create({ ```py client.payment.createRecurring({ "email": "gaurav.kumar@example.com", - "contact": 9123456789, + "contact": "9123456789", "amount": 1000, "currency": "INR", - "recurring": 1, + "order_id": "order_1Aa00000000002", + "customer_id": "cust_1Aa00000000001", + "token": "token_1Aa00000000001", + "recurring": "1", "description": "Creating recurring payment for Gaurav Kumar", "notes": { - "key1": "value3", - "key2": "value2" + "note_key 1": "Beam me up Scotty", + "note_key 2": "Tea. Earl Gray. Hot." } }) ``` @@ -234,9 +241,7 @@ client.payment.createRecurring({ **Response:** ```json { - "razorpay_payment_id" : "pay_1Aa00000000001", - "razorpay_order_id" : "order_1Aa00000000001", - "razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d" + "razorpay_payment_id" : "pay_1Aa00000000001" } ``` ------------------------------------------------------------------------------------------------------- From deb969e2c22925b34bb637691cb91054d2eabdc5 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 00:24:48 +0530 Subject: [PATCH 31/60] subscription doc correction --- documents/subscription.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/documents/subscription.md b/documents/subscription.md index 7c26f15c..cd41069c 100644 --- a/documents/subscription.md +++ b/documents/subscription.md @@ -32,11 +32,12 @@ client.subscription.create({ | plan_id* | string | The unique identifier for a plan that should be linked to the subscription.| | total_count* | string | The number of billing cycles for which the customer should be charged | | customer_notify | boolean | Indicates whether the communication to the customer would be handled by you or us | -| quantity | integer | The number of times the customer should be charged the plan amount per invoice | +| quantity | integer | The number of times the customer should be charged the plan amount per invoice | | start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. | | expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. | -| addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. | -| notes | object | Notes you can enter for the contact for future reference. | +| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription) are supported | +| notes | array | Notes you can enter for the contact for future reference. | +| offer_id | string | The unique identifier of the offer that is linked to the subscription. | **Response:** ```json @@ -111,9 +112,10 @@ client.subscription.create({ | quantity | integer | The number of times the customer should be charged the plan amount per invoice | | start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. | | expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. | -| addons | object | Object that contains details of any upfront amount you want to collect as part of the authorization transaction. | -| notes | object | Notes you can enter for the contact for future reference. | -| 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.) | +| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported | +| notes | array | Notes you can enter for the contact for future reference. | +| notify_info | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported | +| offer_id | string | The unique identifier of the offer that is linked to the subscription. | **Response:** ```json From b142989443ce4872c6646f8bc35108f5897ea733 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 00:28:13 +0530 Subject: [PATCH 32/60] addon doc correction --- documents/addon.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/addon.md b/documents/addon.md index 74b8f3be..f2abc853 100644 --- a/documents/addon.md +++ b/documents/addon.md @@ -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 From 06d0cf2c16b6674a556f1c867591e83a5b0abb28 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 00:40:51 +0530 Subject: [PATCH 33/60] item doc correction --- documents/items.md | 80 ++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/documents/items.md b/documents/items.md index 7d48dfc2..6506d28d 100644 --- a/documents/items.md +++ b/documents/items.md @@ -23,12 +23,22 @@ client.item.create({ **Response:** ```json { - "id": "item_7Oxp4hmm6T4SCn", + "id": "item_JnQ2kRGq8Kbte3", "active": true, "name": "Book / English August", "description": "An indian story, Booker prize winner.", "amount": 20000, - "currency": "INR" + "unit_amount": 20000, + "currency": "INR", + "type": "invoice", + "unit": null, + "tax_inclusive": false, + "hsn_code": null, + "sac_code": null, + "tax_rate": null, + "tax_id": null, + "tax_group_id": null, + "created_at": 1656529427 } ``` @@ -52,31 +62,25 @@ client.item.all(options) ```json { "entity": "collection", - "count": 3, + "count": 1, "items": [ { - "id": "item_7Oy8OMV6BdEAac", - "active": true, - "name": "Book / Ignited Minds", - "description": null, - "amount": 15000, - "currency": "INR" - }, - { - "id": "item_7Oxp4hmm6T4SCn", + "id": "item_JnQ2kRGq8Kbte3", "active": true, "name": "Book / English August", "description": "An indian story, Booker prize winner.", "amount": 20000, - "currency": "INR" - }, - { - "id": "item_7OxoGnoxCuUKbo", - "active": true, - "name": "Book / English August", - "description": null, - "amount": 20000, - "currency": "INR" + "unit_amount": 20000, + "currency": "INR", + "type": "invoice", + "unit": null, + "tax_inclusive": false, + "hsn_code": null, + "sac_code": null, + "tax_rate": null, + "tax_id": null, + "tax_group_id": null, + "created_at": 1656529427 } ] } @@ -96,12 +100,22 @@ client.item.fetch(itemId) **Response:** ```json { - "id": "item_7Oxp4hmm6T4SCn", + "id": "item_JnQ2kRGq8Kbte3", "active": true, "name": "Book / English August", "description": "An indian story, Booker prize winner.", "amount": 20000, - "currency": "INR" + "unit_amount": 20000, + "currency": "INR", + "type": "invoice", + "unit": null, + "tax_inclusive": false, + "hsn_code": null, + "sac_code": null, + "tax_rate": null, + "tax_id": null, + "tax_group_id": null, + "created_at": 1656529427 } ``` @@ -115,7 +129,7 @@ client.item.edit(itemId,{ "description": "New descirption too. :).", "amount": 20000, "currency": "INR", - "active": true + "active": True }) ``` **Parameters** @@ -132,12 +146,22 @@ client.item.edit(itemId,{ **Response:** ```json { - "id": "item_7Oy8OMV6BdEAac", + "id": "item_JnQ2kRGq8Kbte3", "active": true, "name": "Book / Ignited Minds - Updated name!", - "description": "New descirption too. :)", - "amount": 15000, - "currency": "INR" + "description": "New descirption too. :).", + "amount": 20000, + "unit_amount": 20000, + "currency": "INR", + "type": "invoice", + "unit": null, + "tax_inclusive": false, + "hsn_code": null, + "sac_code": null, + "tax_rate": null, + "tax_id": null, + "tax_group_id": null, + "created_at": 1656529427 } ``` ------------------------------------------------------------------------------------------------------- From 3cb6e1b36c57b882a70f55d4fa41c5fad21354de Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 01:19:32 +0530 Subject: [PATCH 34/60] paymentlink doc correction --- documents/paymentLink.md | 155 ++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 74 deletions(-) diff --git a/documents/paymentLink.md b/documents/paymentLink.md index afa6e3d7..64540f62 100644 --- a/documents/paymentLink.md +++ b/documents/paymentLink.md @@ -9,7 +9,7 @@ Standard Payment Link client.payment_link.create({ "amount": 500, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "description": "For XYZ purpose", "customer": { @@ -18,10 +18,10 @@ client.payment_link.create({ "contact": "+919999999999" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "notes": { "policy_name": "Jeevan Bima" }, @@ -35,10 +35,10 @@ UPI Payment Link ```py client.payment_link.create({ - "upi_link": true, + "upi_link": True, "amount": 500, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "description": "For XYZ purpose", "customer": { @@ -47,13 +47,15 @@ client.payment_link.create({ "contact": "+919999999999" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "notes": { "policy_name": "Jeevan Bima" } + "callback_url": "https://example-callback-url.com/", + "callback_method": "get" }) ``` @@ -64,9 +66,11 @@ client.payment_link.create({ |upi_link* | boolean | boolean Must be set to true // to creating UPI Payment Link only | |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | +|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | -|reference_id | string | AReference number tagged to a Payment Link. | -|customer | object | name, email, contact | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | +|reference_id | string | Reference number tagged to a Payment Link. | +|customer | object | All parameters listed [here](https://razorpay.com/docs/api/payments/payment-links/#sample-codes-for-standard-payment-links) are supported | |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. | |notify | object | sms or email (boolean) | |notes | json object | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty” | @@ -114,10 +118,10 @@ For fetch specific payment link response please click [here](https://razorpay.co ### Update payment link ```py -client.payment_link.edit({ +client.payment_link.edit(paymentLinkId, { "reference_id": "TS35", "expire_by": 1653347540, - "reminder_enable":false, + "reminder_enable":False, "notes":{ "policy_name": "Jeevan Saral" } @@ -180,35 +184,38 @@ client.payment_link.notifyBy(paymentLinkId, medium) ```py client.payment_link.create({ - "amount": 20000, + "amount": 1500, "currency": "INR", - "accept_partial": false, - "description": "For XYZ purpose", + "accept_partial": False, + "reference_id": "#aasasw8", + "description": "Payment for policy no #23456", "customer": { "name": "Gaurav Kumar", - "email": "gaurav.kumar@example.com", - "contact": "+919999999999" + "contact": "+919999999999", + "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { - "order": [ - { - "account": "acc_CNo3jSI8OkFJJJ", - "amount": 500, - "currency": "INR", - "notes": { - "branch": "Acme Corp Bangalore North", - "name": "Saurav Kumar", + "order": { + "transfers": [ + { + "account": "acc_I0QRP7PpvaHhpB", + "amount": 500, + "currency": "INR", + "notes": { + "branch": "Acme Corp Bangalore North", + "name": "Bhairav Kumar" + }, "linked_account_notes": [ "branch" ] } - } - ] + ] + } } }) ``` @@ -267,7 +274,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 3400, "currency": "INR", - "accept_partial": false, + "accept_partial": False, "reference_id": "#425", "description": "Payment for policy no #23456", "customer": { @@ -276,10 +283,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": false, + "reminder_enable": False, "options": { "order": { "offers": [ @@ -345,7 +352,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#425", "description": "Payment for policy no #23456", @@ -355,10 +362,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": false + "reminder_enable": False }) ``` @@ -440,7 +447,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 500, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "description": "For XYZ purpose", "customer": { @@ -449,10 +456,10 @@ client.payment_link.create({ "contact": "+919999999999" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "partial_payment": { @@ -527,7 +534,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#2234542", "description": "Payment for policy no #23456", @@ -537,10 +544,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "name": "Lacme Corp" @@ -556,7 +563,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | @@ -609,7 +616,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#417", "description": "Payment for policy no #23456", @@ -619,10 +626,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "prefill": { @@ -644,7 +651,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | @@ -662,7 +669,7 @@ For prefill checkout fields response please click [here](https://razorpay.com/do client.payment_link.create({ "amount": 500, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "description": "For XYZ purpose", "customer": { @@ -671,10 +678,10 @@ client.payment_link.create({ "contact": "+919999999999" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "method": { @@ -695,7 +702,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | @@ -749,7 +756,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#20", "description": "Payment for policy no #23456", @@ -759,10 +766,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "readonly": { @@ -781,7 +788,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | @@ -835,7 +842,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#423212", "description": "Payment for policy no #23456", @@ -845,14 +852,14 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "theme": { - "hide_topbar": true + "hide_topbar": True } } } @@ -866,7 +873,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | @@ -919,7 +926,7 @@ client.payment_link.create({ client.payment_link.create({ "amount": 1000, "currency": "INR", - "accept_partial": true, + "accept_partial": True, "first_min_partial_amount": 100, "reference_id": "#421", "description": "Payment for policy no #23456", @@ -929,10 +936,10 @@ client.payment_link.create({ "email": "gaurav.kumar@example.com" }, "notify": { - "sms": true, - "email": true + "sms": True, + "email": True }, - "reminder_enable": true, + "reminder_enable": True, "options": { "checkout": { "partial_payment": { @@ -953,7 +960,7 @@ client.payment_link.create({ |amount* | integer | Amount to be paid using the Payment Link. | |currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. | |accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. | -|first_min_partial_amount | integer | | +|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |description | string | A brief description of the Payment Link | |customer | object | name, email, contact | |notify | object | sms or email (boolean) | From d56d97327a9789dbfc2c7afa67edee08d1c05e30 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 01:49:31 +0530 Subject: [PATCH 35/60] smartcollect doc correction --- documents/virtualAccount.md | 60 ++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/documents/virtualAccount.md b/documents/virtualAccount.md index 7cf2457e..b12f0796 100644 --- a/documents/virtualAccount.md +++ b/documents/virtualAccount.md @@ -21,7 +21,7 @@ client.virtual_account.create({ | Name | Type | Description | |---------------|-------------|---------------------------------------------| -| receivers* | object | Array that defines what receivers are available for this Virtual Account | +| receivers* | object | All parameters listed [here](https://razorpay.com/docs/api/payments/smart-collect/#create-virtual-account) are supported | | description | string | A brief description of the virtual account. | | customer_id | string | Unique identifier of the customer to whom the virtual account must be tagged. | | close_by | integer | UNIX timestamp at which the virtual account is scheduled to be automatically closed. | @@ -225,10 +225,10 @@ client.virtual_account.all(options) | Name | Type | Description | |-------|-----------|--------------------------------------------------| -| from | timestamp | timestamp after which the payments were created | -| to | timestamp | timestamp before which the payments were created | -| count | integer | number of payments to fetch (default: 10) | -| skip | integer | number of payments to be skipped (default: 0) | +| from | timestamp | Timestamp, in seconds, from when virtual accounts are to be fetched. | +| to | timestamp | Timestamp, in seconds, till when virtual accounts are to be fetched. | +| count | integer | Number of virtual accounts to be fetched. The default value is 10 and the maximum value is 100. | +| skip | integer | Number of records to be skipped while fetching the virtual accounts. This can be used for pagination, in combination with `count`. | **Response:** ```json @@ -287,35 +287,38 @@ client.virtual_account.payments(virtualId,options) ```json { "entity": "collection", - "count": 1, + "count": 3, "items": [ { - "id": "pay_Di5iqCqA1WEHq6", + "id": "pay_JccakgG2EZbHZO", "entity": "payment", - "amount": 239000, + "amount": 10000, "currency": "INR", "status": "captured", "order_id": null, "invoice_id": null, "international": false, "method": "bank_transfer", - "amount_refunded": 0, - "refund_status": null, + "amount_refunded": 500, + "refund_status": "partial", "captured": true, "description": "", "card_id": null, "bank": null, "wallet": null, "vpa": null, - "email": "saurav.kumar@example.com", - "contact": "+919972139994", - "customer_id": "cust_DOMUFFiGdCaCUJ", + "email": null, + "contact": null, "notes": [], - "fee": 2820, - "tax": 430, + "fee": 118, + "tax": 18, "error_code": null, "error_description": null, - "created_at": 1574143644 + "error_source": null, + "error_step": null, + "error_reason": null, + "acquirer_data": {}, + "created_at": 1654171877 } ] } @@ -388,7 +391,6 @@ client.payment.bank_transfer(paymentId) ```py client.payment.refund(paymentId,{ "amount": "100", - "speed": "normal", "notes": { "notes_key_1": "Beam me up Scotty.", "notes_key_2": "Engage" @@ -410,20 +412,22 @@ client.payment.refund(paymentId,{ **Response:** ```json { - "id": "rfnd_E6j36ZEKvsWsEn", + "id": "rfnd_FP8QHiV938haTz", "entity": "refund", - "amount": 100, + "amount": 500100, + "receipt": "Receipt No. 31", "currency": "INR", - "payment_id": "pay_E54n391WnEAV9H", - "notes": { - "key_1": "value1", - "key_2": "value2" - }, + "payment_id": "pay_FCXKPFtYfPXJPy", + "notes": [] "receipt": null, "acquirer_data": { - "rrn": null + "arn": null }, - "created_at": 1579522301 + "created_at": 1597078866, + "batch_id": null, + "status": "processed", + "speed_processed": "normal", + "speed_requested": "normal" } ``` ------------------------------------------------------------------------------------------------------- @@ -431,7 +435,7 @@ client.payment.refund(paymentId,{ ### Add receiver to an existing virtual account ```py client.virtual_account.add_receiver(virtualId,{ - "type": [ + "types": [ "vpa" ], "vpa": { @@ -444,7 +448,7 @@ client.virtual_account.add_receiver(virtualId,{ | Name | Type | Description | |-------|-----------|--------------------------------------------------| -| virtualId* | string | The id of the virtual to be updated | +| virtualId* | string | All parameters listed [here](https://razorpay.com/docs/api/payments/smart-collect-tpv#add-receiver-to-an-existing-virtual-account) are supported | | types* | object | The receiver type to be added to the virtual account. Possible values are `vpa` or `bank_account` | | vpa | object | This is to be passed only when `vpa` is passed as the receiver types. | From 38e40815d9b4528a931eaecf82be74be88e4db1d Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 16:20:35 +0530 Subject: [PATCH 36/60] update params in readme --- documents/payment.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index 1aae3d30..f63513d3 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -70,6 +70,7 @@ client.payment.all(option) | to | timestamp | timestamp before which the payments were created | | count | integer | number of payments to fetch (default: 10) | | skip | integer | number of payments to be skipped (default: 0) | +| expand[] | string | Used to retrieve additional information about the payment. Possible value is `card`, `offers`, `transaction`, `transaction.settlement`, `refunds`, `token` or `emi`| **Response:** ```json @@ -127,7 +128,7 @@ client.payment.fetch(paymentId) | Name | Type | Description | |------------|--------|-----------------------------------| | paymentId* | string | Id of the payment to be retrieved | -| expand[] | string | Used to retrieve additional information about the payment. Possible value is `card`, `offers` or `emi`| +| expand[] | string | Used to retrieve additional information about the payment. Possible value is `card`, `offers`, `transaction`, `transaction.settlement`, `refunds`, `token` or `emi`| **Response:** ```json @@ -385,17 +386,21 @@ client.order.create({ **Response:**
```json { - "id": "order_DBJOWzybf0sJbb", + "id": "order_Jng8xOZRVEf97O", "entity": "order", "amount": 50000, "amount_paid": 0, "amount_due": 50000, "currency": "INR", "receipt": "rcptid_11", + "offer_id": "offer_JTUADI4ZWBGWur", + "offers": [ + "offer_JTUADI4ZWBGWur" + ], "status": "created", "attempts": 0, "notes": [], - "created_at": 1566986570 + "created_at": 1656586126 } ``` ------------------------------------------------------------------------------------------------------- From e719dcaeec22324e1294800a5b866e1c547046ca Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 30 Jun 2022 16:34:11 +0530 Subject: [PATCH 37/60] transfer doc correction --- documents/transfer.md | 235 ++++++++++++++++++++++++++---------------- 1 file changed, 144 insertions(+), 91 deletions(-) diff --git a/documents/transfer.md b/documents/transfer.md index 0a2c13b9..31311cc4 100644 --- a/documents/transfer.md +++ b/documents/transfer.md @@ -185,22 +185,33 @@ client.transfer.create({ **Response:** ```json { - "id": "trf_E9utgtfGTcpcmm", + "id": "trf_JnRRvcSbZb1VHN", "entity": "transfer", - "source": "acc_CJoeHMNpi0nC7k", - "recipient": "acc_CPRsN1LkFccllA", - "amount": 100, + "status": "processed", + "source": "acc_HZbJUcl6DBDLIN", + "recipient": "acc_HjVXbtpSCIxENR", + "amount": 500, "currency": "INR", "amount_reversed": 0, - "notes": [], "fees": 1, "tax": 0, + "notes": [], + "linked_account_notes": [], "on_hold": false, "on_hold_until": null, "recipient_settlement_id": null, - "created_at": 1580219046, - "linked_account_notes": [], - "processed_at": 1580219046 + "created_at": 1656534379, + "processed_at": 1656534379, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_JnRRvcSbZb1VHN", + "source": null, + "metadata": null + } } ``` ------------------------------------------------------------------------------------------------------- @@ -224,22 +235,34 @@ client.payment.transfers(paymentId) "count": 1, "items": [ { - "id": "trf_EAznuJ9cDLnF7Y", + "id": "trf_I8kA5qRv9czK3Y", "entity": "transfer", - "source": "pay_E9up5WhIfMYnKW", - "recipient": "acc_CMaomTz4o0FOFz", - "amount": 1000, + "status": "processed", + "source": "pay_I7watngocuEY4P", + "recipient": "acc_HjVXbtpSCIxENR", + "amount": 10000, "currency": "INR", - "amount_reversed": 100, + "amount_reversed": 0, + "fees": 12, + "tax": 2, "notes": [], - "fees": 3, - "tax": 0, + "linked_account_notes": [], "on_hold": false, "on_hold_until": null, + "settlement_status": "pending", "recipient_settlement_id": null, - "created_at": 1580454666, - "linked_account_notes": [], - "processed_at": 1580454666 + "created_at": 1634111246, + "processed_at": 1634111251, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_I8kA5qRv9czK3Y", + "source": null, + "metadata": null + } } ] } @@ -259,54 +282,62 @@ client.order.fetch(orderId, { | Name | Type | Description | |---------------|-------------|---------------------------------------------| | orderId* | string | The id of the order to be fetched | -| expand* | string | Supported value is `transfer` | +| expand[]* | string | Supported value is `transfer` | **Response:** ```json { - "id": "order_DSkl2lBNvueOly", + "id": "order_I7waiV9PUGADuv", "entity": "order", - "amount": 1000, - "amount_paid": 1000, + "amount": 50000, + "amount_paid": 50000, "amount_due": 0, "currency": "INR", - "receipt": null, + "receipt": "55", "offer_id": null, "status": "paid", "attempts": 1, - "notes": [], - "created_at": 1570794714, + "notes": { + "woocommerce_order_number": "55" + }, + "created_at": 1633936677, "transfers": { "entity": "collection", "count": 1, "items": [ { - "id": "trf_DSkl2lXWbiADZG", + "id": "trf_I7waiajxgS5jWL", "entity": "transfer", - "source": "order_DSkl2lBNvueOly", - "recipient": "acc_CNo3jSI8OkFJJJ", - "amount": 500, + "status": "processed", + "source": "order_I7waiV9PUGADuv", + "recipient": "acc_HalyQGZh9ZyiGg", + "amount": 10000, "currency": "INR", "amount_reversed": 0, - "notes": { - "branch": "Acme Corp Bangalore North", - "name": "Gaurav Kumar" - }, - "fees": 2, - "tax": 0, - "on_hold": true, - "on_hold_until": 1670776632, + "fees": 12, + "tax": 2, + "notes": [], + "linked_account_notes": [], + "on_hold": false, + "on_hold_until": null, + "settlement_status": "pending", "recipient_settlement_id": null, - "created_at": 1570794714, - "linked_account_notes": [ - "Acme Corp Bangalore North" - ], - "processed_at": 1570794772 + "created_at": 1633936677, + "processed_at": 1633936700, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_I7waiajxgS5jWL", + "source": null, + "metadata": null + } } ] } } - ``` ------------------------------------------------------------------------------------------------------- @@ -325,22 +356,34 @@ client.transfer.fetch(transferId) **Response:** ```json { - "id": "trf_E7V62rAxJ3zYMo", + "id": "trf_I7waiajxgS5jWL", "entity": "transfer", - "source": "pay_E6j30Iu1R7XbIG", - "recipient": "acc_CMaomTz4o0FOFz", - "amount": 100, + "status": "processed", + "source": "order_I7waiV9PUGADuv", + "recipient": "acc_HalyQGZh9ZyiGg", + "amount": 10000, "currency": "INR", "amount_reversed": 0, + "fees": 12, + "tax": 2, "notes": [], - "fees": 1, - "tax": 0, + "linked_account_notes": [], "on_hold": false, "on_hold_until": null, + "settlement_status": "pending", "recipient_settlement_id": null, - "created_at": 1579691505, - "linked_account_notes": [], - "processed_at": 1579691505 + "created_at": 1633936677, + "processed_at": 1633936700, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_I7waiajxgS5jWL", + "source": null, + "metadata": null + } } ``` ------------------------------------------------------------------------------------------------------- @@ -409,32 +452,35 @@ client.transfer.all({ "count": 1, "items": [ { - "id": "trf_DGSTeXzBkEVh48", + "id": "trf_JnRRvcSbZb1VHN", "entity": "transfer", - "source": "pay_DGSRhvMbOqeCe7", - "recipient": "acc_CMaomTz4o0FOFz", + "status": "processed", + "source": "acc_HZbJUcl6DBDLIN", + "recipient": "acc_HjVXbtpSCIxENR", "amount": 500, "currency": "INR", "amount_reversed": 0, - "notes": [], - "fees": 2, + "fees": 1, "tax": 0, + "notes": [], + "linked_account_notes": [], "on_hold": false, "on_hold_until": null, - "recipient_settlement_id": "setl_DHYJ3dRPqQkAgV", - "recipient_settlement": { - "id": "setl_DHYJ3dRPqQkAgV", - "entity": "settlement", - "amount": 500, - "status": "failed", - "fees": 0, - "tax": 0, - "utr": "CN0038699836", - "created_at": 1568349124 - }, - "created_at": 1568110256, - "linked_account_notes": [], - "processed_at": null + "settlement_status": null, + "recipient_settlement_id": null, + "recipient_settlement": null, + "created_at": 1656534379, + "processed_at": 1656534379, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_JnRRvcSbZb1VHN", + "source": null, + "metadata": null + } } ] } @@ -461,17 +507,21 @@ client.payment.refund(paymentId,{ **Response:** ```json { - "id": "rfnd_EAzovSwG8jBnGf", + "id": "rfnd_JJFNlNXPHY640A", "entity": "refund", "amount": 100, "currency": "INR", - "payment_id": "pay_EAdwQDe4JrhOFX", + "payment_id": "pay_JJCqynf4fQS0N1", "notes": [], "receipt": null, "acquirer_data": { - "rrn": null + "arn": null }, - "created_at": 1580454723 + "created_at": 1649941680, + "batch_id": null, + "status": "processed", + "speed_processed": "normal", + "speed_requested": "normal" } ``` ------------------------------------------------------------------------------------------------------- @@ -497,31 +547,37 @@ client.payment.all({ "count": 2, "items": [ { - "id": "pay_E9uth3WhYbh9QV", + "id": "pay_JJCqynf4fQS0N1", "entity": "payment", - "amount": 100, + "amount": 10000, "currency": "INR", "status": "captured", - "order_id": null, + "order_id": "order_JJCqnZG8f3754z", "invoice_id": null, - "international": null, - "method": "transfer", + "international": false, + "method": "netbanking", "amount_refunded": 0, "refund_status": null, "captured": true, - "description": null, + "description": "#JJCqaOhFihfkVE", "card_id": null, - "bank": null, + "bank": "YESB", "wallet": null, "vpa": null, - "email": "", - "contact": null, + "email": "john.example@example.com", + "contact": "+919820958250", "notes": [], - "fee": 0, - "tax": 0, + "fee": 236, + "tax": 36, "error_code": null, "error_description": null, - "created_at": 1580219046 + "error_source": null, + "error_step": null, + "error_reason": null, + "acquirer_data": { + "bank_transaction_id": "2118867" + }, + "created_at": 1649932775 } ] } @@ -580,10 +636,7 @@ client.payment.transfer(paymentId,{ | Name | Type | Description | |---------------|-------------|---------------------------------------------| | paymentId* | string | The id of the payment to be fetched | -| transfers.account* | string | The id of the account to be fetched | -| transfers.amount* | string | The transaction amount, in paise | -| transfers.currency* | string | The currency of the payment (defaults to INR) | -| transfers.on_hold* | string | Possible values is `0` or `1` | +| transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#hold-settlements-for-transfers) are supported | **Response:** ```json From 37dfc1c0bf5e62ff432c2b724fefb5a29f809ce5 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 00:28:22 +0530 Subject: [PATCH 38/60] create upi link update params --- documents/paymentLink.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/documents/paymentLink.md b/documents/paymentLink.md index 64540f62..2360664a 100644 --- a/documents/paymentLink.md +++ b/documents/paymentLink.md @@ -40,7 +40,9 @@ client.payment_link.create({ "currency": "INR", "accept_partial": True, "first_min_partial_amount": 100, - "description": "For XYZ purpose", + "expire_by": 1691097057, + "reference_id": "TS1989", + "description": "Payment for policy no #23456", "customer": { "name": "Gaurav Kumar", "email": "gaurav.kumar@example.com", @@ -70,10 +72,13 @@ client.payment_link.create({ |description | string | A brief description of the Payment Link | |first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment | |reference_id | string | Reference number tagged to a Payment Link. | -|customer | object | All parameters listed [here](https://razorpay.com/docs/api/payments/payment-links/#sample-codes-for-standard-payment-links) are supported | +|customer | object | All parameters listed [here](https://razorpay.com/docs/api/payments/payment-links/#sample-codes-for-upi-payment-links) are supported | |expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. | |notify | object | sms or email (boolean) | |notes | json object | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty” | +| callback_url | string | If specified, adds a redirect URL to the Payment Link. Once customers completes the payment, they are redirected to the specified URL. | +| callback_method | string | If callback_url parameter is passed, callback_method must be passed with the value `get`. | +| reminder_enable | boolean | Used to send reminders for the Payment Link. Possible values is `true` or `false` | **Response:** For create payment link response please click [here](https://razorpay.com/docs/api/payment-links/#create-payment-link) From f343ff07b76ee6dc7d95e35907bff2d1b2a5b1a0 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 00:33:15 +0530 Subject: [PATCH 39/60] added active param --- documents/items.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/items.md b/documents/items.md index 6506d28d..6231894f 100644 --- a/documents/items.md +++ b/documents/items.md @@ -57,6 +57,7 @@ client.item.all(options) | to | timestamp | timestamp before which the item were created | | count | integer | number of item to fetch (default: 10) | | skip | integer | number of item to be skipped (default: 0) | +| active | integer | Fetches number of active or inactive items. The value is `1` for active items and `0` for inactive items. | **Response:** ```json From 996d6fac8046266085fbd44bde8e2fba987b82df Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 00:59:06 +0530 Subject: [PATCH 40/60] update delete addon --- razorpay/resources/addon.py | 4 +++- tests/test_client_addon.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/razorpay/resources/addon.py b/razorpay/resources/addon.py index 85a995e1..a3953c94 100644 --- a/razorpay/resources/addon.py +++ b/razorpay/resources/addon.py @@ -26,7 +26,9 @@ def delete(self, addon_id, data={}, **kwargs): Args: addon_id : Id for which addon object has to be deleted """ - return super(Addon, self).delete(addon_id, data, **kwargs) + url = '{}/{}'.format(self.base_url, addon_id) + + return self.delete_url(url, data, **kwargs) def all(self, data={}, **kwargs): """" diff --git a/tests/test_client_addon.py b/tests/test_client_addon.py index 9a4d9588..f5a9e1bd 100644 --- a/tests/test_client_addon.py +++ b/tests/test_client_addon.py @@ -22,7 +22,7 @@ def test_addon_fetch(self): @responses.activate def test_addon_delete(self): result = [] - url = '{}/{}/delete'.format(self.base_url, self.addon_id) + url = '{}/{}'.format(self.base_url, self.addon_id) responses.add(responses.DELETE, url, status=200, From 5763be476e4211ee54a2b6d1d0267a1917212929 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 01:04:34 +0530 Subject: [PATCH 41/60] add double quotes --- documents/settlement.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documents/settlement.md b/documents/settlement.md index 5f948cc6..68084322 100644 --- a/documents/settlement.md +++ b/documents/settlement.md @@ -69,9 +69,9 @@ client.settlement.fetch(settlementId) ```py client.settlement.report({ - year: 2020, - month: 9, - day:11 + "year": 2020, + "month": 9, + "day":11 }) ``` **Parameters:** From aa8a5f7eb5693c3d72cf560952765b0f55e0efb9 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 01:08:44 +0530 Subject: [PATCH 42/60] added notes param --- documents/payment.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index f63513d3..37471048 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -381,7 +381,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. | -| payment | object | please refer this [doc](https://razorpay.com/docs/payments/payments/capture-settings/api/) for params | +| payment | object | please refer this [doc](https://razorpay.com/docs/payments/payments/capture-settings/api/) for params | +| notes | object | A key-value pair | **Response:**
```json From 89680fca07ec1c06f0bb0f3d76e2137b06049c07 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 01:14:22 +0530 Subject: [PATCH 43/60] added partial payment param --- documents/order.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/order.md b/documents/order.md index 9cdb3bab..3deccfd4 100644 --- a/documents/order.md +++ b/documents/order.md @@ -7,6 +7,7 @@ client.order.create({ "amount": 50000, "currency": "INR", "receipt": "receipt#1", + "partial_payment":False, "notes": { "key1": "value3", "key2": "value2" From b6f225a13611e80c0c8de71b582e7e552d276364 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 11:49:35 +0530 Subject: [PATCH 44/60] update response parameter --- documents/refund.md | 52 +++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/documents/refund.md b/documents/refund.md index 3620acac..4e1baf08 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -27,20 +27,24 @@ client.payment.refund(paymentId,{ **Response:** ```json { - "id": "rfnd_FP8QHiV938haTz", + "id": "rfnd_JnzyQwYOOBNJJu", "entity": "refund", - "amount": 500100, - "receipt": "Receipt No. 31", + "amount": 100, "currency": "INR", - "payment_id": "pay_FCXKPFtYfPXJPy", - "notes": [], + "payment_id": "pay_JRSS9bMrRMds3w", + "notes": { + "notes_key_1": "Beam me up Scotty.", + "notes_key_2": "Engage" + }, + "receipt": "#Receipt No. 131", "acquirer_data": { "arn": null }, - "created_at": 1597078866, + "created_at": 1656655960, "batch_id": null, "status": "processed", - "speed_processed": "normal" + "speed_processed": "normal", + "speed_requested": "normal" } ``` ------------------------------------------------------------------------------------------------------- @@ -67,22 +71,20 @@ client.payment.refund(paymentId,{ **Response:** ```json { - "id": "rfnd_FP8R8EGjGbPkVb", + "id": "rfnd_Jo00DtIBzADMi6", "entity": "refund", - "amount": 500100, + "amount": 100, "currency": "INR", - "payment_id": "pay_FC8MmhMBZPKDHF", - "notes": { - "notes_key_1": "Tea, Earl Grey, Hot", - "notes_key_2": "Tea, Earl Grey… decaf." - }, - "receipt": "Receipt No. 31", + "payment_id": "pay_JRP3Y66cNcf2qF", + "notes": [], + "receipt": "#Receipt No. 132", "acquirer_data": { "arn": null }, - "created_at": 1597078914, + "created_at": 1656656062, "batch_id": null, - "status": "processed", + "status": "pending", + "speed_processed": "instant", "speed_requested": "optimum" } ``` @@ -99,10 +101,10 @@ client.payment.fetch_multiple_refund(paymentId,option) | Name | Type | Description | |-------|-----------|--------------------------------------------------| | paymentId* | string | The id of the payment | -| from | timestamp | timestamp after which the payments were created | -| to | timestamp | timestamp before which the payments were created | -| count | integer | number of payments to fetch (default: 10) | -| skip | integer | number of payments to be skipped (default: 0) | +| from | timestamp | timestamp after which the refunds were created | +| to | timestamp | timestamp before which the refunds were created | +| count | integer | number of refunds to fetch (default: 10) | +| skip | integer | number of refunds to be skipped (default: 0) | **Refund:** ```json @@ -179,10 +181,10 @@ client.refund.all(options) | Name | Type | Description | |-------|-----------|--------------------------------------------------| -| from | timestamp | timestamp after which the payments were created | -| to | timestamp | timestamp before which the payments were created | -| count | integer | number of payments to fetch (default: 10) | -| skip | integer | number of payments to be skipped (default: 0) | +| from | timestamp | timestamp after which the refunds were created | +| to | timestamp | timestamp before which the refunds were created | +| count | integer | number of refunds to fetch (default: 10) | +| skip | integer | number of refunds to be skipped (default: 0) | **Response:** ```json From 3c1cad1c2e1369507cdd78af609a6b3cde8f84ea Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 11:53:53 +0530 Subject: [PATCH 45/60] added notes param --- documents/order.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/order.md b/documents/order.md index cffaed3c..4701dd92 100644 --- a/documents/order.md +++ b/documents/order.md @@ -69,6 +69,7 @@ client.order.create({ | method | string | The payment method used to make the payment. If this parameter is not passed, customers will be able to make payments using both netbanking and UPI payment methods. Possible values is `netbanking` or `upi`| | currency* | string | Currency of the order. Currently only `INR` is supported. | | receipt | string | Your system order reference id. | +| notes | array | A key-value pair | |bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/#step-2-create-an-order) are supported | **Response:** From 86892167c96f26b748d88f24ca2c11e0eab8d13e Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 11:58:44 +0530 Subject: [PATCH 46/60] update param --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index 69901bef..b6001424 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -461,7 +461,7 @@ client.payment.createPaymentJson({ | email* | string | Email of the customer | | contact* | string | Contact number of the customer | | method* | string | Possible value is `netbanking` | -| bank | string | The customer's bank code.For example, `HDFC`.| +| bank* | string | The customer's bank code.For example, `HDFC`.| please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/netbanking#step-3-create-a-payment) for params From 3d33bcd46f6bd8637b282fc653cbfb5bedc0d7e2 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 13:30:47 +0530 Subject: [PATCH 47/60] update response and parameter --- documents/transfer.md | 129 ++++++++++++++++++++++++++++-------------- 1 file changed, 85 insertions(+), 44 deletions(-) diff --git a/documents/transfer.md b/documents/transfer.md index 31311cc4..f547b46a 100644 --- a/documents/transfer.md +++ b/documents/transfer.md @@ -409,22 +409,34 @@ client.transfer.all({ "count": 1, "items": [ { - "id": "trf_DGSTeXzBkEVh48", + "id": "trf_HWjmkReRGPhguR", "entity": "transfer", - "source": "pay_DGSRhvMbOqeCe7", - "recipient": "acc_CMaomTz4o0FOFz", - "amount": 500, + "status": "processed", + "source": "pay_HWjY9DZSMsbm5E", + "recipient": "acc_HWjl1kqobJzf4i", + "amount": 1000, "currency": "INR", "amount_reversed": 0, - "notes": [], - "fees": 2, + "fees": 3, "tax": 0, + "notes": [], + "linked_account_notes": [], "on_hold": false, "on_hold_until": null, - "recipient_settlement_id": "setl_DHYJ3dRPqQkAgV", - "created_at": 1568110256, - "linked_account_notes": [], - "processed_at": null + "settlement_status": "settled", + "recipient_settlement_id": "setl_HYIIk3H0J4PYdX", + "created_at": 1625812996, + "processed_at": 1625812996, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_HWjmkReRGPhguR", + "source": null, + "metadata": null + } } ] } @@ -602,17 +614,21 @@ client.transfer.reverse(transferId,{ **Response:** ```json { - "id": "rvrsl_EB0BWgGDAu7tOz", - "entity": "reversal", - "transfer_id": "trf_EAznuJ9cDLnF7Y", + "id": "rfnd_JJFNlNXPHY640A", + "entity": "refund", "amount": 100, - "fee": 0, - "tax": 0, "currency": "INR", + "payment_id": "pay_JJCqynf4fQS0N1", "notes": [], - "initiator_id": "CJoeHMNpi0nC7k", - "customer_refund_id": null, - "created_at": 1580456007 + "receipt": null, + "acquirer_data": { + "arn": null + }, + "created_at": 1649941680, + "batch_id": null, + "status": "processed", + "speed_processed": "normal", + "speed_requested": "normal" } ``` ------------------------------------------------------------------------------------------------------- @@ -645,22 +661,31 @@ client.payment.transfer(paymentId,{ "count": 1, "items": [ { - "id": "trf_EB1VJ4Ux4GMmxQ", + "id": "trf_Jfm1KCF6w1oWgy", "entity": "transfer", - "source": "pay_EB1R2s8D4vOAKG", - "recipient": "acc_CMaomTz4o0FOFz", + "status": "pending", + "source": "pay_JXPULbHbkkkS8D", + "recipient": "acc_I0QRP7PpvaHhpB", "amount": 100, "currency": "INR", "amount_reversed": 0, "notes": [], - "fees": 1, - "tax": 0, + "linked_account_notes": [], "on_hold": true, "on_hold_until": null, "recipient_settlement_id": null, - "created_at": 1580460652, - "linked_account_notes": [], - "processed_at": 1580460652 + "created_at": 1654860101, + "processed_at": null, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_Jfm1KCF6w1oWgy", + "source": null, + "metadata": null + } } ] } @@ -679,28 +704,44 @@ client.transfer.edit(transferId,{ | Name | Type | Description | |---------------|-------------|---------------------------------------------| -| transferId* | string | The id of the transfer to be fetched | -| transfers | array | All parameters listed here https://razorpay.com/docs/api/route/#hold-settlements-for-transfers are supported | +| transferId* | string | The id of the payment to be fetched | +| on_hold* | boolean | Possible values is `0` or `1` | +| on_hold_until | integer | Timestamp, in Unix, that indicates until when the settlement of the transfer must be put on hold | **Response:** ```json { - "id": "trf_EB17rqOUbzSCEE", - "entity": "transfer", - "source": "pay_EAeSM2Xul8xYRo", - "recipient": "acc_CMaomTz4o0FOFz", - "amount": 100, - "currency": "INR", - "amount_reversed": 0, - "notes": [], - "fees": 1, - "tax": 0, - "on_hold": true, - "on_hold_until": 1679691505, - "recipient_settlement_id": null, - "created_at": 1580459321, - "linked_account_notes": [], - "processed_at": 1580459321 + "entity": "collection", + "count": 1, + "items": [ + { + "id": "trf_JhemwjNekar9Za", + "entity": "transfer", + "status": "pending", + "source": "pay_I7watngocuEY4P", + "recipient": "acc_HjVXbtpSCIxENR", + "amount": 100, + "currency": "INR", + "amount_reversed": 0, + "notes": [], + "linked_account_notes": [], + "on_hold": true, + "on_hold_until": null, + "recipient_settlement_id": null, + "created_at": 1655271313, + "processed_at": null, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_JhemwjNekar9Za", + "source": null, + "metadata": null + } + } + ] } ``` From ed24dd5d71ebcb0ead3fabdd3227c5c890580eeb Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 17:31:38 +0530 Subject: [PATCH 48/60] fixed according comments --- documents/upi.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/documents/upi.md b/documents/upi.md index 00f1727d..dc08815a 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -47,24 +47,20 @@ client.customer.create({ ```py client.order.create({ - "amount": 0, + "amount": 100, "currency": "INR", "method": "upi", "customer_id": "cust_1Aa00000000001", "receipt": "Receipt No. 1", + "token": { + "max_amount": 9999900, + "expire_at": 4102444799, + "frequency": "monthly" + }, "notes": { "notes_key_1": "Beam me up Scotty", "notes_key_2": "Engage" }, - "token": { - "auth_type": "netbanking", - "max_amount": 9999900, - "expire_at": 4102444799, - "notes": { - "notes_key_1": "Tea, Earl Grey, Hot", - "notes_key_2": "Tea, Earl Grey… decaf." - } - } }) ``` @@ -77,7 +73,8 @@ client.order.create({ | method* | string | The authorization method. In this case the value will be `emandate` | | receipt | string | Your system order reference id. | | notes | object | A key-value pair | -| token | object | A key-value pair | +| token | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/create-authorization-transaction#112-create-an-order) are supported | + **Response:** ```json From 8008079b32b295de4de1ab439f5de4451d7a1075 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 17:35:45 +0530 Subject: [PATCH 49/60] added fail_existing param --- documents/papernach.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/papernach.md b/documents/papernach.md index 9334be0c..8059b345 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -23,6 +23,7 @@ client.customer.create({ | email | string | Email of the customer | | contact | string | Contact number of the customer | | notes | object | A key-value pair | +| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `0` or `1`| **Response:** ```json From 14a69570a10795534beb62a2b7de93a93d628aff Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 17:40:39 +0530 Subject: [PATCH 50/60] fixed according comments --- documents/card.md | 4 ++-- test.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test.py diff --git a/documents/card.md b/documents/card.md index 26684e03..1aad8183 100644 --- a/documents/card.md +++ b/documents/card.md @@ -135,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. | @@ -535,6 +534,7 @@ client.card.fetch(cardId) |-----------------|---------|------------------------------------------------------------------------------| | cardId* | string | card id to be fetched | +**Response:** ```json { "id": "card_JXPULjlKqC5j0i", diff --git a/test.py b/test.py new file mode 100644 index 00000000..68716cb7 --- /dev/null +++ b/test.py @@ -0,0 +1,29 @@ +import razorpay +import requests +from pprint import pprint +import json + +client = razorpay.Client(auth=("rzp_test_k6uL897VPBz20q", "EnLs21M47BllR3X8PSFtjtbd")) + +data = {"customer_id":"cust_JnFmpXS63vWgYJ"} + +#x = client.addon.delete("ao_JniYt836HF7aQm") + +x = client.transfer.all({ + 'expand[]':'recipient_settlement' +}) + +print(json.dumps(x)) + + # def delete(self, addon_id, data={}, **kwargs): + # """ + # Delete addon for given id + + # Args: + # addon_id : Id for which addon object has to be deleted + # """ + # url = '{}/{}'.format(self.base_url, addon_id) + + # return self.delete_url(url, data, **kwargs) +# "please check response error_code , error_desc , tax and other are missing +# tested with account va_JccSJQQoGOBi2q" \ No newline at end of file From 70050f0fda0e86b31dcb36e698670ef357d89380 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 17:44:57 +0530 Subject: [PATCH 51/60] fixed according comments --- documents/emandate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/emandate.md b/documents/emandate.md index 69322882..755b7593 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -395,7 +395,7 @@ client.order.create({ | 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. | +| 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 From e6fa144f240886adf55e99d74c2fb89c7aacb4ef Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 18:28:48 +0530 Subject: [PATCH 52/60] response param change --- documents/refund.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/refund.md b/documents/refund.md index 4e1baf08..31878268 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -10,7 +10,7 @@ client.payment.refund(paymentId,{ "notes_key_1": "Beam me up Scotty.", "notes_key_2": "Engage" }, - "receipt": "Receipt No. 31" + "receipt": "#Receipt No. 131" }) ``` From fede84eb09d4e2f5f0876e8b7150688096261a2f Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 18:32:29 +0530 Subject: [PATCH 53/60] add mandatory --- documents/upi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/upi.md b/documents/upi.md index dc08815a..a4aa0dd4 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -448,7 +448,7 @@ client.order.create({ | currency* | string | Currency of the order. Currently only `INR` is supported. | | receipt | string | Your system order reference id. | | notes | array | 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. | +| 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 From 45aac00251ba4a9bdb8d0862110b4f276369087b Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 18:42:15 +0530 Subject: [PATCH 54/60] response param update --- documents/refund.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/refund.md b/documents/refund.md index 31878268..9914e0af 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -55,7 +55,7 @@ client.payment.refund(paymentId,{ client.payment.refund(paymentId,{ "amount": "100", "speed": "optimum", - "receipt": "Receipt No. 31" + "receipt": "#Receipt No. 132" }) ``` From da7e26c7bbe5b8340af77651aa82d77fcb880617 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 19:49:28 +0530 Subject: [PATCH 55/60] update version --- CHANGELOG.md | 5 +++++ documents/virtualAccount.md | 2 ++ setup.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff90c41..443cc83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/documents/virtualAccount.md b/documents/virtualAccount.md index b12f0796..61ad7423 100644 --- a/documents/virtualAccount.md +++ b/documents/virtualAccount.md @@ -213,7 +213,9 @@ client.virtual_account.fetch(virtualId) | virtualId* | string | The id of the virtual to be updated | **Response:** + For fetch virtual account by id response please click [here](https://razorpay.com/docs/api/smart-collect/#fetch-a-virtual-account-by-id) + ------------------------------------------------------------------------------------------------------- ### Fetch all virtual account diff --git a/setup.py b/setup.py index 36562c2c..2650ecef 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="razorpay", - version="1.3.0", + version="1.3.1", description="Razorpay Python Client", long_description=readme_content, long_description_content_type='text/markdown', From 1da7ed38d6ff0e5ad2a48cd4e31273e8d7d5aa6c Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 17:28:13 +0530 Subject: [PATCH 56/60] create order params updated --- documents/papernach.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/documents/papernach.md b/documents/papernach.md index 8059b345..fcc5c7d4 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -47,28 +47,33 @@ client.customer.create({ ```py client.order.create({ - "amount": 0, - "currency": "INR", - "method": "emandate", + "amount":0, + "currency":"INR", + "method":"nach", "customer_id": "cust_1Aa00000000001", - "receipt": "Receipt No. 1", + "receipt":"Receipt No. 1", "notes": { "notes_key_1": "Beam me up Scotty", - "notes_key_2": "Engage" + "notes_key_2": "Engage" }, - "token": { - "auth_type": "netbanking", - "max_amount": 9999900, - "expire_at": 4102444799, + "token":{ + "auth_type":"physical", + "max_amount":10000000, + "expire_at":2709971120, "notes": { "notes_key_1": "Tea, Earl Grey, Hot", "notes_key_2": "Tea, Earl Grey… decaf." }, - "bank_account": { - "beneficiary_name": "Gaurav Kumar", - "account_number": 1121431121541121, - "account_type": "savings", - "ifsc_code": "HDFC0000001" + "bank_account":{ + "account_number":"11214311215411", + "ifsc_code":"HDFC0000001", + "beneficiary_name":"Gaurav Kumar", + "account_type":"savings" + }, + "nach":{ + "form_reference1":"Recurring Payment for Gaurav Kumar", + "form_reference2":"Method Paper NACH", + "description":"Paper NACH Gaurav Kumar" } } }) From d59a40ab2be3297dd223ec3dcc2a5c91c744ff83 Mon Sep 17 00:00:00 2001 From: ankitdas13 <89454448+ankitdas13@users.noreply.github.com> Date: Tue, 6 Dec 2022 12:42:52 +0530 Subject: [PATCH 57/60] Removed unused test.py file --- test.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 test.py diff --git a/test.py b/test.py deleted file mode 100644 index 68716cb7..00000000 --- a/test.py +++ /dev/null @@ -1,29 +0,0 @@ -import razorpay -import requests -from pprint import pprint -import json - -client = razorpay.Client(auth=("rzp_test_k6uL897VPBz20q", "EnLs21M47BllR3X8PSFtjtbd")) - -data = {"customer_id":"cust_JnFmpXS63vWgYJ"} - -#x = client.addon.delete("ao_JniYt836HF7aQm") - -x = client.transfer.all({ - 'expand[]':'recipient_settlement' -}) - -print(json.dumps(x)) - - # def delete(self, addon_id, data={}, **kwargs): - # """ - # Delete addon for given id - - # Args: - # addon_id : Id for which addon object has to be deleted - # """ - # url = '{}/{}'.format(self.base_url, addon_id) - - # return self.delete_url(url, data, **kwargs) -# "please check response error_code , error_desc , tax and other are missing -# tested with account va_JccSJQQoGOBi2q" \ No newline at end of file From 5d96a99a78289d1370a48f5d7779403747a40b71 Mon Sep 17 00:00:00 2001 From: prem-razorpay <116806144+prem-razorpay@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:19:58 +0530 Subject: [PATCH 58/60] Create pull_request_template.md add pull request template --- .github/pull_request_template.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..ccbd370e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ +## Note :- Please follow the below points while attaching test cases document link below: + ### - If label `Tested` is added then test cases document URL is mandatory. + ### - Link added should be a valid URL and accessible throughout the org. + ### - If the branch name contains hotfix / revert by default the BVT workflow check will pass. + +| Test Case Document URL | +|-----------------------------------------------| +| Please paste test case document link here.... | From 60df5f0d9d18c95705dd956e42140d115ff3911b Mon Sep 17 00:00:00 2001 From: Ankit Das <89454448+ankitdas13@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:34:18 +0530 Subject: [PATCH 59/60] feat: Test coverage and automate publish (#251) --- .github/workflows/ci.yml | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..de5afd47 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,81 @@ +name: CI +on: + push: + branches: + - master + tags: + - v[0-9]+.[0-9]+.[0-9]+* + pull_request: + branches: + - master +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + python -m build + python -m pip install --upgrade twine + python -m twine check dist/* + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist/ + test: + name: Test Coverage + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install responses + pip install coverage + python ${{ github.workspace }}/setup.py install + - name: Run Tests + run: | + python -m coverage run -m unittest + python -m coverage xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + + publish: + if: startsWith(github.ref, 'refs/tags/v') + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Download all workflow run artifacts + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + - name: Set up Python 3 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Publish packages to PyPi + run: | + python -m pip install --upgrade twine + set -ex + export VERSION=$(python3 setup.py --version) + python -m twine upload --verbose dist/razorpay-$VERSION-py3-none-any.whl dist/razorpay-$VERSION.tar.gz + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + From 7ecad7e3418560cba58628ee013eee1d0d4992fa Mon Sep 17 00:00:00 2001 From: KumaraGuru <34372541+kumaraguru1735@users.noreply.github.com> Date: Thu, 3 Aug 2023 00:02:53 +0530 Subject: [PATCH 60/60] Update payment.md --- documents/payment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index c8e95003..793e240c 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -172,7 +172,7 @@ client.payment.fetch(paymentId) ### Fetch payments for an order ```py -client.order.payment(orderId) +client.order.payments(orderId) ``` **Parameters** @@ -721,4 +721,4 @@ Doc reference [doc](https://razorpay.com/docs/payments/payment-methods/cards/aut **PN: * indicates mandatory fields**

-**For reference click [here](https://razorpay.com/docs/api/payments/)** \ No newline at end of file +**For reference click [here](https://razorpay.com/docs/api/payments/)**