From 6239273199ea57486b56e640c348ec6e2a18e35a Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Tue, 28 Jun 2022 17:59:53 +0530 Subject: [PATCH 1/2] 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 14a69570a10795534beb62a2b7de93a93d628aff Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 1 Jul 2022 17:40:39 +0530 Subject: [PATCH 2/2] 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