From 5d033f53f9f24858c463333fbf024d9de6a3b4cd Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 22 Jun 2022 16:22:01 +0530 Subject: [PATCH 01/49] added tpv order --- documents/order.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/documents/order.md b/documents/order.md index 5600907..c099537 100644 --- a/documents/order.md +++ b/documents/order.md @@ -52,6 +52,55 @@ Razorpay::Order.create(para_attr) ------------------------------------------------------------------------------------------------------- +### Create order (Third party validation) + +```rb +param_attr = { + "amount": 500, + "method": "netbanking", + "receipt": "BILL13375649", + "currency": "INR", + "bank_account": { + "account_number": "765432123456789", + "name": "Gaurav Kumar", + "ifsc": "HDFC0000053" + } +) + +Razorpay::Order.create(para_attr) +``` + +**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 ```rb From a9e9394325995cec0eecca6fd90c767d2b27a257 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 22 Jun 2022 16:36:42 +0530 Subject: [PATCH 02/49] added tpv payment --- documents/payment.md | 190 ++++++++++++++++++ lib/razorpay.rb | 1 + lib/razorpay/payment.rb | 8 + lib/razorpay/payment_method.rb | 17 ++ test/fixtures/fake_create_upi_payment.json | 3 + test/fixtures/fake_validate_vpa.json | 5 + test/fixtures/payment_methods_collection.json | 149 ++++++++++++++ test/razorpay/test_payment.rb | 48 ++++- 8 files changed, 419 insertions(+), 2 deletions(-) create mode 100644 lib/razorpay/payment_method.rb create mode 100644 test/fixtures/fake_create_upi_payment.json create mode 100644 test/fixtures/fake_validate_vpa.json create mode 100644 test/fixtures/payment_methods_collection.json diff --git a/documents/payment.md b/documents/payment.md index a2604e2..941285b 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -630,6 +630,196 @@ Doc reference [doc](https://razorpay.com/docs/payments/payment-methods/cards/aut ------------------------------------------------------------------------------------------------------- +### Create Payment Json (Third party validation) + +```rb +param_attr = { + "amount": "100", + "currency": "INR", + "email": "gaurav.kumar@example.com", + "contact": "9123456789", + "order_id": "order_JkVtS9XJdk2u0B", + "method": "netbanking", + "bank": "HDFC" +} + +Razorpay::Payment.create_json_payment(param_attr) + +``` + +**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) + +```rb +param_attr = { + "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 + } +} + +Razorpay::Payment.create_upi(para_attr) +``` + +**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) + +```rb +param_attr = { + "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" + } +} + +Razorpay::Payment.create_upi(para_attr) +``` + +**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) + +```rb +param_attr = { + "vpa": "gauravkumar@exampleupi" +} +Razorpay::Payment.validate_vpa(para_attr) +``` + +**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) + +```rb +Razorpay.setup('key', '') # Use Only razorpay key + +Razorpay::PaymentMethods.all() +``` + +**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/lib/razorpay.rb b/lib/razorpay.rb index c853637..05988b7 100644 --- a/lib/razorpay.rb +++ b/lib/razorpay.rb @@ -19,6 +19,7 @@ require 'razorpay/fund_account' require 'razorpay/item' require 'razorpay/qr_code' +require 'razorpay/payment_method' # Base Razorpay module module Razorpay diff --git a/lib/razorpay/payment.rb b/lib/razorpay/payment.rb index 4c104d2..d39f5a9 100644 --- a/lib/razorpay/payment.rb +++ b/lib/razorpay/payment.rb @@ -104,5 +104,13 @@ def otp_submit(options) def otp_resend self.class.request.post "#{id}/otp/resend" end + + def self.create_upi(data={}) + request.post "create/upi" , data + end + + def self.validate_vpa(data={}) + request.post "validate/vpa" , data + end end end diff --git a/lib/razorpay/payment_method.rb b/lib/razorpay/payment_method.rb new file mode 100644 index 0000000..9a089af --- /dev/null +++ b/lib/razorpay/payment_method.rb @@ -0,0 +1,17 @@ +require 'razorpay/request' +require 'razorpay/refund' +require 'razorpay/entity' + +module Razorpay + # Payment Methods class is allows you to create + # to fetch all payment methods + class PaymentMethods < Entity + def self.request + Razorpay::Request.new('methods') + end + + def self.all(options = {}) + request.all options + end + end +end diff --git a/test/fixtures/fake_create_upi_payment.json b/test/fixtures/fake_create_upi_payment.json new file mode 100644 index 0000000..495712b --- /dev/null +++ b/test/fixtures/fake_create_upi_payment.json @@ -0,0 +1,3 @@ +{ + "razorpay_payment_id": "pay_FVmAstJWfsD3SO" +} diff --git a/test/fixtures/fake_validate_vpa.json b/test/fixtures/fake_validate_vpa.json new file mode 100644 index 0000000..6551c77 --- /dev/null +++ b/test/fixtures/fake_validate_vpa.json @@ -0,0 +1,5 @@ +{ + "vpa": "gauravkumar@exampleupi", + "success": true, + "customer_name": "Gaurav Kumar" + } \ No newline at end of file diff --git a/test/fixtures/payment_methods_collection.json b/test/fixtures/payment_methods_collection.json new file mode 100644 index 0000000..6d9f081 --- /dev/null +++ b/test/fixtures/payment_methods_collection.json @@ -0,0 +1,149 @@ +{ + "entity": "methods", + "card": true, + "debit_card": true, + "credit_card": true, + "prepaid_card": true, + "card_networks": { + "AMEX": 0, + "DICL": 0, + "MC": 1, + "MAES": 1, + "VISA": 1, + "JCB": 0, + "RUPAY": 1, + "BAJAJ": 0 + }, + "card_subtype": { + "consumer": 1, + "business": 1, + "premium": 0 + }, + "amex": false, + "netbanking": { + "AUBL": "AU Small Finance Bank", + "AIRP": "Airtel Payments Bank", + "ANDB": "Andhra Bank", + "UTIB": "Axis Bank", + "BARB_R": "Bank of Baroda - Retail Banking", + "VIJB": "Bank of Baroda - Retail Banking (Erstwhile Vijaya Bank)", + "MAHB": "Bank of Maharashtra", + "CNRB": "Canara Bank", + "CSBK": "Catholic Syrian Bank", + "CBIN": "Central Bank of India", + "DCBL": "DCB Bank", + "DEUT": "Deutsche Bank", + "DLXB": "Dhanlaxmi Bank", + "ESFB": "Equitas Small Finance Bank", + "FSFB": "Fincare Small Finance Bank", + "ICIC": "ICICI Bank", + "IBKL": "IDBI", + "IDFB": "IDFC FIRST Bank", + "IDIB": "Indian Bank", + "ALLA": "Indian Bank (Erstwhile Allahabad Bank)", + "IOBA": "Indian Overseas Bank", + "INDB": "Indusind Bank", + "JAKA": "Jammu and Kashmir Bank", + "JSFB": "Jana Small Finance Bank", + "KARB": "Karnataka Bank", + "KVBL": "Karur Vysya Bank", + "KKBK": "Kotak Mahindra Bank", + "LAVB_R": "Lakshmi Vilas Bank - Retail Banking", + "NSPB": "NSDL Payments Bank", + "ORBC": "PNB (Erstwhile-Oriental Bank of Commerce)", + "UTBI": "PNB (Erstwhile-United Bank of India)", + "PSIB": "Punjab & Sind Bank", + "PUNB_R": "Punjab National Bank - Retail Banking", + "RATN": "RBL Bank", + "SVCB": "SVC Co-Operative Bank Ltd.", + "SRCB": "Saraswat Co-operative Bank", + "SIBL": "South Indian Bank", + "SCBL": "Standard Chartered Bank", + "SBBJ": "State Bank of Bikaner and Jaipur", + "SBHY": "State Bank of Hyderabad", + "SBIN": "State Bank of India", + "SBMY": "State Bank of Mysore", + "STBP": "State Bank of Patiala", + "SBTR": "State Bank of Travancore", + "TMBL": "Tamilnad Mercantile Bank", + "UCBA": "UCO Bank", + "UBIN": "Union Bank of India", + "CORP": "Union Bank of India (Erstwhile Corporation Bank)", + "YESB": "Yes Bank" + }, + "wallet": { + "mobikwik": true, + "payzapp": true, + "olamoney": true, + "airtelmoney": true, + "freecharge": true, + "jiomoney": true + }, + "emi": false, + "upi": true, + "cardless_emi": [], + "paylater": { + "epaylater": true, + "getsimpl": true, + "icic": true, + "hdfc": true, + "kkbk": true, + "lazypay": true + }, + "google_pay_cards": false, + "app": { + "cred": 0, + "twid": 0, + "trustly": 0, + "poli": 0, + "sofort": 0, + "giropay": 0 + }, + "gpay": false, + "emi_types": { + "credit": false, + "debit": false + }, + "debit_emi_providers": { + "HDFC": 0 + }, + "nach": false, + "cod": false, + "offline": false, + "recurring": { + "card": { + "credit": [ + "MasterCard", + "Visa" + ], + "prepaid": [ + "MasterCard", + "Visa" + ], + "debit": { + "UTIB": "Axis Bank", + "BARB": "Bank of Baroda", + "MAHB": "Bank of Maharashtra", + "CITI": "CITI Bank", + "CNRB": "Canara Bank", + "CIUB": "City Union Bank", + "ESFB": "Equitas Small Finance Bank", + "FDRL": "Federal Bank", + "HDFC": "HDFC Bank", + "HSBC": "HSBC", + "ICIC": "ICICI Bank", + "IDIB": "Indian Bank", + "ALLA": "Indian Bank (Erstwhile Allahabad Bank)", + "IOBA": "Indian Overseas Bank", + "INDB": "Indusind Bank", + "KVBL": "Karur Vysya Bank", + "KKBK": "Kotak Mahindra Bank", + "RATN": "RBL Bank", + "SBIN": "State Bank of India" + } + }, + "upi": true, + "nach": false + }, + "upi_intent": true + } diff --git a/test/razorpay/test_payment.rb b/test/razorpay/test_payment.rb index 4e62bf0..a071f85 100644 --- a/test/razorpay/test_payment.rb +++ b/test/razorpay/test_payment.rb @@ -217,6 +217,7 @@ def test_otp_resend stub_post(%r{payments/#{@payment_id}/otp/resend$}, 'fake_otp_resend', {}) payment = Razorpay::Payment.fetch(@payment_id).otp_resend assert_equal @payment_id, payment.razorpay_payment_id + end def test_payment_edit @@ -253,7 +254,50 @@ def test_payment_create_payment_json stub_post(%r{payments/create/json$}, 'create_json_payment',payment_attr.to_json) payment = Razorpay::Payment.create_json_payment payment_attr.to_json assert_equal 'pay_FVmAstJWfsD3SO', payment.razorpay_payment_id + end + def test_create_upi + + param_attr = { + "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 + } + } + + stub_post(%r{payments/create/upi$}, 'fake_create_upi_payment',param_attr.to_json) + payment = Razorpay::Payment.create_upi param_attr.to_json + assert_equal 'pay_FVmAstJWfsD3SO', payment.razorpay_payment_id + end + + def test_payment_methods + stub_get(/methods$/, 'payment_methods_collection') + methods = Razorpay::PaymentMethods.all + assert_equal 'methods', methods.entity end - end - end + + def test_validate_vpa + param_attr = { + "vpa": "gauravkumar@exampleupi" + } + stub_post(%r{payments/validate/vpa$}, 'fake_validate_vpa',param_attr.to_json) + payment = Razorpay::Payment.validate_vpa param_attr.to_json + assert_equal param_attr[:vpa], payment.vpa + end + end end From 41440e97ea6de946cfc5505a374310670e609432 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 22 Jun 2022 17:08:30 +0530 Subject: [PATCH 03/49] added tpv token --- documents/tokens.md | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/documents/tokens.md b/documents/tokens.md index b887e78..5bb3bd0 100644 --- a/documents/tokens.md +++ b/documents/tokens.md @@ -201,6 +201,60 @@ Razorpay::fetch(customerId).deleteToken(tokenId) } ``` ------------------------------------------------------------------------------------------------------- +### Fetch VPA tokens of a customer id + +```rb +Razorpay::Customer.fetch(customerId).fetchTokens +``` + +**Parameters:** + +| Name | Type | Description | +|---------------|-------------|---------------------------------------------| +| customerId* | string | The id of the customer to be fetched | + +**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 6cd8dcb2d21f8732fa0c4b62d8be2bb075e3b650 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 10:53:50 +0530 Subject: [PATCH 04/49] customer doc correction --- documents/customer.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documents/customer.md b/documents/customer.md index e176296..6e5f24a 100644 --- a/documents/customer.md +++ b/documents/customer.md @@ -28,6 +28,8 @@ Razorpay::Customer.create({ | name* | string | Name of the customer | | email | string | Email of the customer | | contact | string | Contact number of the customer | +| 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`| +| gstin | string | Customer's GST number, if available. For example, `29XAbbA4369J1PA` | | notes | object | A key-value pair | **Response:** From 57d94d0c0d8a47bceac48527f3574e14ddf90868 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 11:40:41 +0530 Subject: [PATCH 05/49] order doc correction --- documents/order.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/order.md b/documents/order.md index 5600907..f0e4268 100644 --- a/documents/order.md +++ b/documents/order.md @@ -70,6 +70,7 @@ Razorpay::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` | **Response:** From 9c7a3c643f2ecedea96c7cbf67da44023acf607c Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 11:55:41 +0530 Subject: [PATCH 06/49] fund doc correction --- documents/fund.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/documents/fund.md b/documents/fund.md index 910c5d4..900ef0b 100644 --- a/documents/fund.md +++ b/documents/fund.md @@ -17,7 +17,7 @@ para_attr = { } } -Razorpay::FundAccount.create(data) +Razorpay::FundAccount.create(para_attr) ``` **Parameters:** @@ -31,18 +31,20 @@ Razorpay::FundAccount.create(data) **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_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" }, - "active":true, - "created_at":1543650891 + "batch_id": null, + "active": true, + "created_at": 1654154246 } ``` ------------------------------------------------------------------------------------------------------- From 76fa25f2229adab9b1816d23bc14ab162684849e Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 12:16:40 +0530 Subject: [PATCH 07/49] token doc correction --- documents/tokens.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/tokens.md b/documents/tokens.md index b887e78..2f36985 100644 --- a/documents/tokens.md +++ b/documents/tokens.md @@ -184,7 +184,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** From 9974b0868024cc6b12e8bed6a281dfbfb7e943bb Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 12:33:50 +0530 Subject: [PATCH 08/49] payment doc correction --- documents/payment.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index a2604e2..8a1b384 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -81,7 +81,7 @@ Razorpay::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[] | array | Supported values are: -card: Expanded card details, usable for card and EMI payments. -emi: Expanded EMI plan details, usable for EMI payments | +| expand[] | string | Supported values are: -card: Expanded card details, usable for card and EMI payments. -emi: Expanded EMI plan details, usable for EMI payments | **Response:** @@ -255,8 +255,8 @@ Razorpay::Payment.fetch(paymentId).edit(para_attr) | Name | Type | Description | |-------------|---------|--------------------------------------| -| paymentId* | string | Id of the payment to update | -| notes* | object | A key-value pair | +| paymentId* | string | Id of the payment to update | +| notes* | object | A key-value pair | **Response:** ```json @@ -401,7 +401,8 @@ Razorpay::Order.create(para_attr) | 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 @@ -497,12 +498,12 @@ Razorpay::Payment.create_json_payment(para_attr) | email* | string | Email of the customer | | contact* | string | Contact number of the customer | | method* | string | Possible value is `card`, `netbanking`, `wallet`,`emi`, `upi`, `cardless_emi`, `paylater`. | -| card | array | All keys listed [here](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/#supported-payment-fields) are supported | +| card | object | All keys listed [here](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/#supported-payment-fields) are supported | | bank | string | Bank code of the bank used for the payment. Required if the method is `netbanking`.| -| bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/#create-a-fund-account) are supported | +| bank_account | object | All keys listed [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/#create-a-fund-account) are supported | | vpa | string | Virtual payment address of the customer. Required if the method is `upi`. | | wallet | string | Wallet code for the wallet used for the payment. Required if the method is `wallet`. | -| notes | array | A key-value pair | +| notes | object | A key-value pair | please refer this [doc](https://razorpay.com/docs/payment-gateway/s2s-integration/payment-methods/) for params From 8a21648d793d6f2d64977b3ab90d6734c6c4c08a Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 12:56:26 +0530 Subject: [PATCH 09/49] settlement doc correction --- documents/settlement.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/settlement.md b/documents/settlement.md index b14dc0b..5cb1962 100644 --- a/documents/settlement.md +++ b/documents/settlement.md @@ -441,6 +441,7 @@ Razorpay::Settlement.fetch_all_ondemand_settlement(para_attr) | 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 | Possible value is `ondemand_payouts`| **Response:**
For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements) From 3333ea8cf1d58ced70c0b33c5b2d8b4a14c94618 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 13:29:52 +0530 Subject: [PATCH 10/49] refund doc correction --- documents/refund.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/documents/refund.md b/documents/refund.md index 9e87237..f35584b 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -50,7 +50,8 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr) "created_at": 1597078866, "batch_id": null, "status": "processed", - "speed_processed": "normal" + "speed_processed": "normal", + "speed_requested": "normal" } ``` ------------------------------------------------------------------------------------------------------- @@ -115,11 +116,11 @@ Razorpay::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) | +| paymentId* | string | The id of the payment for which refund has been requested. | +| from | timestamp | UNIX timestamp at which the refunds were created. | +| to | timestamp | UNIX timestamp till which the refunds were created. | +| count | integer | The number of refunds to fetch for the payment. | +| skip | integer | The number of refunds to be skipped for the payment. | **Refund:** ```json @@ -164,8 +165,8 @@ Razorpay::Payment.fetch(paymentId).fetch_refund(refundId) | Name | Type | Description | |---------------|-------------|---------------------------------------------| -| paymentId* | string | The id of the payment to be fetched | -| refundId* | string | The id of the refund to be fetched | +| paymentId* | string | Unique identifier of the payment for which the refund has been made.| +| refundId* | string | Unique identifier of the refund to be retrieved. | **Response:** ```json From 48e22a19d5636a884450bdc0bef63df2f137a3a3 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 13:51:14 +0530 Subject: [PATCH 11/49] settlement doc correction --- documents/Invoice.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/documents/Invoice.md b/documents/Invoice.md index 807a202..a9c7268 100644 --- a/documents/Invoice.md +++ b/documents/Invoice.md @@ -67,8 +67,16 @@ Razorpay::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 | object | customer details in a object format | +|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.name* | object | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported | +| line_items | object | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported | + +|expire_by | object | Details of the line item that is billed in the invoice. | +|sms_notify | object | Details of the line item that is billed in the invoice. | +|email_notify | object | Details of the line item that is billed in the invoice. | +|partial_payment | boolean | Indicates whether customers can make partial payments on the invoice . Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. | +| currency* | string | The currency of the payment (defaults to INR) | **Response:** For create invoice response please click [here](https://razorpay.com/docs/api/invoices/#create-an-invoice) @@ -507,7 +515,7 @@ invoiceId = "inv_E7q0tqkxBRzdau" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId,medium) +Razorpay::Invoice.notify_by(invoiceId,medium) ``` **Parameters:** From 1e28c46ebfc6ab5106ec7dba824b1ac2c7b96738 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 14:17:59 +0530 Subject: [PATCH 12/49] plan doc correction --- documents/plan.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documents/plan.md b/documents/plan.md index 1f68ad7..bdb19c4 100644 --- a/documents/plan.md +++ b/documents/plan.md @@ -32,8 +32,8 @@ Razorpay::Plan.create(para_attr) |-----------------|---------|------------------------------------------------------------------------------| | period* | string | Used together with `interval` to define how often the customer should be charged.Possible values:
1.`daily`
2.`weekly`
3.`monthly`
4.`yearly` | | interval* | string | Used together with `period` to define how often the customer should be charged | -| items* | array | Details of the plan. For more details please refer [here](https://razorpay.com/docs/api/subscriptions/#create-a-plan) | -| notes | array | Notes you can enter for the contact for future reference. | +| items* | object | Details of the plan. For more details please refer [here](https://razorpay.com/docs/api/subscriptions/#create-a-plan) | +| notes | object | Notes you can enter for the contact for future reference. | **Response:** ```json @@ -141,7 +141,7 @@ Razorpay::Plan.fetch(planId) | Name | Type | Description | |-------|-----------|--------------------------------------------------| -| planId | string | The id of the plan to be fetched | +| planId* | string | The id of the plan to be fetched | **Response:** ```json From 7cb5843d048f81274530ac43a2d6d1c1ad3ed2a6 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 14:37:04 +0530 Subject: [PATCH 13/49] subscription doc correction --- documents/subscriptions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documents/subscriptions.md b/documents/subscriptions.md index c0791ca..948eec5 100644 --- a/documents/subscriptions.md +++ b/documents/subscriptions.md @@ -44,6 +44,7 @@ Razorpay::Subscription.create(para_attr) | 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. | +| offer_id | string | The unique identifier of the offer that is linked to the subscription. | **Response:** ```json @@ -123,6 +124,7 @@ Razorpay::Subscription.create(para_attr) | 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.) | +| offer_id | string | The unique identifier of the offer that is linked to the subscription. | **Response:** ```json @@ -484,7 +486,7 @@ Razorpay::Subscription.cancel_scheduled_changes(subscriptionId) ```rb subscriptionId = "sub_00000000000001" -options = { "pause_at" : "now" } +options = {"pause_at": "now"} Razorpay::Subscription.pause(subscriptionId,options) ``` From 92f39fa67ab7d7dfbfd2b6db6acc340e2990eb7d Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 16:01:07 +0530 Subject: [PATCH 14/49] addon doc correction --- documents/addon.md | 25 ++++++++++++++++++++++++- lib/razorpay/addon.rb | 4 ++++ test/razorpay/test_addon.rb | 8 ++++++-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/documents/addon.md b/documents/addon.md index 5b4ad84..e2f6a7a 100644 --- a/documents/addon.md +++ b/documents/addon.md @@ -28,7 +28,7 @@ Razorpay::Addon.create(subscriptionId,{ |-------|-----------|--------------------------------------------------| | 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. | +| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. | **Response:** ```json @@ -161,6 +161,29 @@ Razorpay::Addon.fetch(addonId) "invoice_id":null } ``` +---------------------------------------------------------------------------------------------------- + +### Delete an addon + +```rb +addonId = "ao_IrSY3UIqDRx7df" +Razorpay::Addon.delete(addonId) +**Parameters:** +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| addonId* | string | addon id to be fetched +``` + +**Parameters:** + +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| addonId* | string | addon id to be deleted | + +**Response:** +```json +[] +``` ------------------------------------------------------------------------------------------------------- **PN: * indicates mandatory fields** diff --git a/lib/razorpay/addon.rb b/lib/razorpay/addon.rb index e76369d..f9cf580 100644 --- a/lib/razorpay/addon.rb +++ b/lib/razorpay/addon.rb @@ -24,5 +24,9 @@ def self.create(subscription_id, options) # POST subscriptions/{sub_id}/addons r.request :post, "/subscriptions/#{subscription_id}/addons", options end + + def self.delete(id) + request.delete id + end end end diff --git a/test/razorpay/test_addon.rb b/test/razorpay/test_addon.rb index bfb7f1d..239dbee 100644 --- a/test/razorpay/test_addon.rb +++ b/test/razorpay/test_addon.rb @@ -57,8 +57,6 @@ def test_add_addons_to_subscription assert_addon_item_details(addon) end - private - def assert_addon_item_details(addon) addon_item = Item.new(addon.item) @@ -68,5 +66,11 @@ def assert_addon_item_details(addon) assert_equal 'INR', addon_item.currency, 'Addon Item currency is accessible' assert_equal 500, addon_item.amount, 'Addon Item amount is accessible' end + + def test_delete_addon + stub_delete(%r{addons/#{@addon_id}$}, 'empty') + addon = Razorpay::Addon.delete(@addon_id) + assert_instance_of Razorpay::Entity, addon + end end end From 5547a85f5e92246ba3d022b595a79759ade2a071 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 16:06:04 +0530 Subject: [PATCH 15/49] readme syntax resolve --- documents/addon.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/documents/addon.md b/documents/addon.md index e2f6a7a..6514630 100644 --- a/documents/addon.md +++ b/documents/addon.md @@ -167,8 +167,11 @@ Razorpay::Addon.fetch(addonId) ```rb addonId = "ao_IrSY3UIqDRx7df" + Razorpay::Addon.delete(addonId) +``` **Parameters:** + | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| | addonId* | string | addon id to be fetched From b90627621def064668a71b24cba9b0d3a0c3d883 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 16:08:53 +0530 Subject: [PATCH 16/49] readme syntax resolve --- documents/addon.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/documents/addon.md b/documents/addon.md index 6514630..2072520 100644 --- a/documents/addon.md +++ b/documents/addon.md @@ -170,12 +170,7 @@ addonId = "ao_IrSY3UIqDRx7df" Razorpay::Addon.delete(addonId) ``` -**Parameters:** -| Name | Type | Description | -|-----------------|---------|------------------------------------------------------------------------------| -| addonId* | string | addon id to be fetched -``` **Parameters:** @@ -184,6 +179,7 @@ Razorpay::Addon.delete(addonId) | addonId* | string | addon id to be deleted | **Response:** + ```json [] ``` From 4fcc3933811c159cafd722030b0a4f37898a08d7 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 17:02:46 +0530 Subject: [PATCH 17/49] item doc correction --- documents/items.md | 34 +++++++++++++++++++++++++++------- test.rb | 24 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 test.rb diff --git a/documents/items.md b/documents/items.md index 9b183f2..3c46784 100644 --- a/documents/items.md +++ b/documents/items.md @@ -23,17 +23,27 @@ Razorpay::Item.create({ | name* | string | Name of the item. | | description | string | A brief description of the item. | | amount | integer | Amount of the order to be paid | -| currency | string | Currency of the order. Currently only `INR` is supported. | +| currency* | string | Currency of the order. Currently only `INR` is supported. | **Response:** ```json { - "id": "item_7Oxp4hmm6T4SCn", + "id": "item_Jf5MlwKlPMOKBV", "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": 1654709890 } ``` @@ -150,12 +160,22 @@ Razorpay::Item.edit(itemId,para_attr) **Response:** ```json { - "id": "item_7Oy8OMV6BdEAac", + "id": "item_JInaSLODeDUQiQ", "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": 1649843796 } ``` ------------------------------------------------------------------------------------------------------- diff --git a/test.rb b/test.rb new file mode 100644 index 0000000..e68d998 --- /dev/null +++ b/test.rb @@ -0,0 +1,24 @@ + +require "razorpay" + +Razorpay.setup('rzp_test_k6uL897VPBz20q', 'EnLs21M47BllR3X8PSFtjtbd') + + +options = {"count":1} + +Razorpay::Item.all(options) + +# para_attr = { +# "amount": 100, +# "currency": "INR", +# "receipt": "receipt#1", +# "bank_account": { +# "account_number": "765432123456789", +# "name": "Gaurav Kumar", +# "ifsc": "HDFC0000053" +# } +# } + +# res = Razorpay::Order.create(para_attr) + +puts(res.to_json()) \ No newline at end of file From 2c20ad6cd2357820fd6d0b29c62d139cbeff26bf Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 6 Jul 2022 19:02:05 +0530 Subject: [PATCH 18/49] paymentlink doc correction --- documents/paymentLink.md | 52 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/documents/paymentLink.md b/documents/paymentLink.md index 6477468..44a01ab 100644 --- a/documents/paymentLink.md +++ b/documents/paymentLink.md @@ -76,12 +76,15 @@ Razorpay::PaymentLink.create(para_attr.to_json) |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” | +|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” | + **Response:** For create payment link response please click [here](https://razorpay.com/docs/api/payment-links/#create-payment-link) @@ -208,14 +211,15 @@ Razorpay::PaymentLink.notify_by(paymentLinkId, medium) ```rb para_attr = { - "amount": 20000, + "amount": 1500, "currency": "INR", "accept_partial": false, - "description": "For XYZ purpose", + "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, @@ -223,20 +227,34 @@ para_attr = { }, "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_CPRsN1LkFccllA", + "amount": 500, + "currency": "INR", + "notes": { + "branch": "Acme Corp Bangalore North", + "name": "Bhairav Kumar" + }, + "linked_account_notes": [ + "branch" + ] + }, + { + "account": "acc_CNo3jSI8OkFJJJ", + "amount": 500, + "currency": "INR", + "notes": { + "branch": "Acme Corp Bangalore South", + "name": "Saurav Kumar" + }, "linked_account_notes": [ "branch" ] } - } - ] + ] + } } } From 7e04d9be597f9a82201992df9c5e7c81a23b9b31 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 16:51:54 +0530 Subject: [PATCH 19/49] add param link --- documents/paymentLink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/paymentLink.md b/documents/paymentLink.md index 44a01ab..570dd24 100644 --- a/documents/paymentLink.md +++ b/documents/paymentLink.md @@ -869,7 +869,7 @@ Razorpay::PaymentLink.create(para_attr.to_json) |customer | object | name, email, contact | |notify | object | sms or email (boolean) | |reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false | -|options* | object | Options to set contact and email as read-only fields on Checkout. Parent parameter under which the checkout and readonly child parameters must be passed.| +|options* | object | All parameters listed [here](https://razorpay.com/docs/api/payments/payment-links/v1/customise/read-only/#request-parameters) are supported | **Response:** ```json From 379d23442e75e66153fc6aa9c51ce766b197aa66 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 17:12:45 +0530 Subject: [PATCH 20/49] smartcollect doc correction --- documents/virtualAccount.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/documents/virtualAccount.md b/documents/virtualAccount.md index dd1abfd..5d398bf 100644 --- a/documents/virtualAccount.md +++ b/documents/virtualAccount.md @@ -342,7 +342,7 @@ Razorpay::VirtualAccount.fetch(virtualId).payments(options) ```rb paymend_id = "pay_Di5iqCqA1WEHq6" -Razorpay::Razorpay::Payment.fetch(paymend_id).bank_transfer +Razorpay::Payment.fetch(paymend_id).bank_transfer ``` **Parameters:** @@ -403,6 +403,8 @@ Razorpay::Razorpay::Payment.fetch(paymend_id).bank_transfer ### Refund payments made to a virtual account ```rb +paymend_id = "pay_Di5iqCqA1WEHq6" + options = { "amount": "100", "speed": "normal", @@ -413,7 +415,7 @@ options = { "receipt": "Receipt No. 31" } -Razorpay::Payment.fetch(@payment_id).refund(options) +Razorpay::Payment.fetch(payment_id).refund(options) ``` **Parameters:** @@ -429,20 +431,22 @@ Razorpay::Payment.fetch(@payment_id).refund(options) **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" } ``` ------------------------------------------------------------------------------------------------------- @@ -469,7 +473,7 @@ Razorpay::VirtualAccount.add_receiver(virtualId, para_attr) |-------|-----------|--------------------------------------------------| | virtualId* | string | The id of the virtual to be updated | | 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. | +| vpa.descriptor | string | Descriptor should be 10 characters only. | **Response:** For add receiver to an existing virtual account response please click [here](https://razorpay.com/docs/api/smart-collect/#add-receiver-to-an-existing-virtual-account) @@ -560,7 +564,7 @@ Razorpay::VirtualAccount.delete_allowed_payer(virtualId,allowedPayersId) **Response:** ```json -{} +null ``` ------------------------------------------------------------------------------------------------------- ### Close virtual account @@ -578,6 +582,7 @@ Razorpay::VirtualAccount.close(virtualId) **Response:** For close virtual account response please click [here](https://razorpay.com/docs/api/smart-collect/#close-a-virtual-account) + ------------------------------------------------------------------------------------------------------- **PN: * indicates mandatory fields** From c6e252239581098acf1078b642cff44d6fdd918d Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 19:34:43 +0530 Subject: [PATCH 21/49] transfer doc correction --- documents/transfers.md | 476 +++++++++++++++++++++++++---------------- 1 file changed, 289 insertions(+), 187 deletions(-) diff --git a/documents/transfers.md b/documents/transfers.md index b039a87..83ed63f 100644 --- a/documents/transfers.md +++ b/documents/transfers.md @@ -43,31 +43,37 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr) **Response:** ```json { - "entity": "collection", - "count": 1, - "items": [ - { - "id": "trf_E9uhYLFLLZ2pks", - "entity": "transfer", - "source": "pay_E8JR8E0XyjUSZd", - "recipient": "acc_CPRsN1LkFccllA", - "amount": 100, - "currency": "INR", - "amount_reversed": 0, - "notes": { - "name": "Gaurav Kumar", - "roll_no": "IEC2011025" - }, - "on_hold": true, - "on_hold_until": 1671222870, - "recipient_settlement_id": null, - "created_at": 1580218356, - "linked_account_notes": [ - "roll_no" - ], - "processed_at": 1580218357 - } - ] + "id": "pay_DJiaO3iqUZaZrO", + "entity": "payment", + "amount": 5000, + "currency": "INR", + "status": "captured", + "order_id": null, + "invoice_id": null, + "international": false, + "method": "netbanking", + "amount_refunded": 0, + "refund_status": null, + "captured": true, + "description": "Credits towards consultation", + "card_id": null, + "bank": "UTIB", + "wallet": null, + "vpa": null, + "email": "void@razorpay.com", + "contact": "+919191919191", + "notes": [], + "fee": 171, + "tax": 26, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "acquirer_data": { + "bank_transaction_id": "7909502" + }, + "created_at": 1568822005 } ``` ------------------------------------------------------------------------------------------------------- @@ -130,48 +136,55 @@ Razorpay::Order.create(para_attr) **Response:** ```json { - "id": "order_E9uTczH8uWPCyQ", - "entity": "order", - "amount": 2000, - "amount_paid": 0, - "amount_due": 2000, - "currency": "INR", - "receipt": null, - "offer_id": null, - "status": "created", - "attempts": 0, - "notes": [], - "created_at": 1580217565, - "transfers": [ - { - "recipient": "acc_CPRsN1LkFccllA", - "amount": 1000, - "currency": "INR", - "notes": { - "branch": "Acme Corp Bangalore North", - "name": "Gaurav Kumar" - }, - "linked_account_notes": [ - "branch" - ], - "on_hold": true, - "on_hold_until": 1671222870 - }, - { - "recipient": "acc_CNo3jSI8OkFJJJ", - "amount": 1000, - "currency": "INR", - "notes": { - "branch": "Acme Corp Bangalore South", - "name": "Saurav Kumar" - }, - "linked_account_notes": [ - "branch" - ], - "on_hold": false, - "on_hold_until": null - } - ] + "id": "order_Jhf1Sn06my7AUb", + "entity": "order", + "amount": 2000, + "amount_paid": 0, + "amount_due": 2000, + "currency": "INR", + "receipt": null, + "offer_id": "offer_JGQvQtvJmVDRIA", + "offers": [ + "offer_JGQvQtvJmVDRIA" + ], + "status": "created", + "attempts": 0, + "notes": [], + "created_at": 1655272138, + "transfers": [ + { + "id": "trf_Jhf1SpAYVIeRoP", + "entity": "transfer", + "status": "created", + "source": "order_Jhf1Sn06my7AUb", + "recipient": "acc_HjVXbtpSCIxENR", + "amount": 1000, + "currency": "INR", + "amount_reversed": 0, + "notes": { + "branch": "Acme Corp Bangalore North", + "name": "Gaurav Kumar" + }, + "linked_account_notes": [ + "branch" + ], + "on_hold": true, + "on_hold_until": 1671222870, + "recipient_settlement_id": null, + "created_at": 1655272138, + "processed_at": null, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_Jhf1SpAYVIeRoP", + "source": null, + "metadata": null + } + } + ] } ``` ------------------------------------------------------------------------------------------------------- @@ -199,22 +212,36 @@ Razorpay::Transfer.create(para_attr) **Response:** ```json { - "id": "trf_E9utgtfGTcpcmm", - "entity": "transfer", - "source": "acc_CJoeHMNpi0nC7k", - "recipient": "acc_CPRsN1LkFccllA", - "amount": 100, - "currency": "INR", - "amount_reversed": 0, - "notes": [], - "fees": 1, - "tax": 0, - "on_hold": false, - "on_hold_until": null, - "recipient_settlement_id": null, - "created_at": 1580219046, - "linked_account_notes": [], - "processed_at": 1580219046 + "id":"trf_E9utgtfGTcpcmm", + "entity":"transfer", + "transfer_status":"pending", + "settlement_status":null, + "source":"acc_CJoeHMNpi0nC7k", + "recipient":"acc_CPRsN1LkFccllA", + "amount":100, + "currency":"INR", + "amount_reversed":0, + "notes":[ + + ], + "fees":1, + "tax":0, + "on_hold":false, + "on_hold_until":null, + "recipient_settlement_id":null, + "created_at":1580219046, + "linked_account_notes":[ + + ], + "processed_at":null, + "error":{ + "code":null, + "description":null, + "field":null, + "source":null, + "step":null, + "reason":null + } } ``` ------------------------------------------------------------------------------------------------------- @@ -224,7 +251,7 @@ Razorpay::Transfer.create(para_attr) ```rb paymentId = "pay_E8JR8E0XyjUSZd" -Razorpay::Payment.fetch_transfer(paymentId) +Razorpay::Payment.fetch(paymentId).fetch_transfer ``` **Parameters:** @@ -279,44 +306,53 @@ Razorpay::Order.fetch_transfer_order(orderId) **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 + } } ] } @@ -342,22 +378,39 @@ Razorpay::Transfer.fetch(transferId) **Response:** ```json { - "id": "trf_E7V62rAxJ3zYMo", + "id": "trf_JJD536GI6wuz3m", "entity": "transfer", - "source": "pay_E6j30Iu1R7XbIG", - "recipient": "acc_CMaomTz4o0FOFz", - "amount": 100, + "status": "processed", + "source": "pay_JGmCgTEa9OTQcX", + "recipient": "acc_IRQWUleX4BqvYn", + "amount": 300, "currency": "INR", "amount_reversed": 0, - "notes": [], "fees": 1, "tax": 0, + "notes": { + "name": "Saurav Kumar", + "roll_no": "IEC2011026" + }, + "linked_account_notes": [ + "roll_no" + ], "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": 1649933574, + "processed_at": 1649933579, + "error": { + "code": null, + "description": null, + "reason": null, + "field": null, + "step": null, + "id": "trf_JJD536GI6wuz3m", + "source": null, + "metadata": null + } } ``` ------------------------------------------------------------------------------------------------------- @@ -385,22 +438,34 @@ Razorpay::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 + } } ] } @@ -420,32 +485,35 @@ Razorpay::Transfer.fetch_settlements "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 + } } ] } @@ -458,8 +526,8 @@ Razorpay::Transfer.fetch_settlements paymentId = "pay_EAdwQDe4JrhOFX" para_attr = { - "amount" : 100, - "reverse_all" : 1 + "amount": 100, + "reverse_all": 1 } Razorpay::Payment.fetch(paymentId).refund(para_attr) @@ -476,17 +544,21 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr) **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" } ``` ------------------------------------------------------------------------------------------------------- @@ -509,34 +581,40 @@ Razorpay::Payment.all ```json { "entity": "collection", - "count": 2, + "count": 1, "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 } ] } @@ -613,22 +691,31 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr) "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 + } } ] } @@ -657,22 +744,37 @@ Razorpay::Transfer.fetch(transferId).edit(para_attr) **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 3af54061d895dda9a5277e4be24f8dbcba8eb62a Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 20:12:57 +0530 Subject: [PATCH 22/49] variable correction --- documents/transfers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/transfers.md b/documents/transfers.md index 83ed63f..73ee441 100644 --- a/documents/transfers.md +++ b/documents/transfers.md @@ -724,7 +724,7 @@ Razorpay::Payment.fetch(paymentId).transfer(para_attr) ### Modify settlement hold for transfers ```rb -paymentId = "pay_EAeSM2Xul8xYRo" +transferId = "trf_JhemwjNekar9Za" para_attr = { "on_hold": "1", From aa1c571d9f903da87964c18dc759f146d56ebdaf Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 20:18:13 +0530 Subject: [PATCH 23/49] qrcode doc correction --- documents/qrcode.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/documents/qrcode.md b/documents/qrcode.md index 54be72d..555d1f1 100644 --- a/documents/qrcode.md +++ b/documents/qrcode.md @@ -258,26 +258,24 @@ Razorpay::QrCode.all(para_attr) "count": 1, "items": [ { - "id": "qr_HMsgvioW64f0vh", + "id": "qr_HMsqRoeVwKbwAF", "entity": "qr_code", - "created_at": 1623660959, - "name": "Store_1", - "usage": "single_use", + "created_at": 1623661499, + "name": "Fresh Groceries", + "usage": "multiple_use", "type": "upi_qr", - "image_url": "https://rzp.io/i/DTa2eQR", - "payment_amount": 300, + "image_url": "https://rzp.io/i/eI9XD54Q", + "payment_amount": null, "status": "active", - "description": "For Store 1", - "fixed_amount": true, - "payments_amount_received": 0, - "payments_count_received": 0, - "notes": { - "purpose": "Test UPI QR code notes" - }, + "description": "Buy fresh groceries", + "fixed_amount": false, + "payments_amount_received": 1000, + "payments_count_received": 1, + "notes": [], "customer_id": "cust_HKsR5se84c5LTO", - "close_by": 1681615838, - "closed_at" : null, - "close_reason": null + "close_by": 1624472999, + "close_reason": "paid", + "tax_invoice": null } ] } From 8fbed45885e33c86867e61161cb9bc95f4002a8b Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 23:14:31 +0530 Subject: [PATCH 24/49] emandate doc correction --- documents/emandate.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/documents/emandate.md b/documents/emandate.md index a265d1d..184bddb 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -28,6 +28,7 @@ Razorpay::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 @@ -50,9 +51,10 @@ Razorpay::Customer.create({ ### Create order ```rb -Razorpay::Customer.create({ +Razorpay::Order.create({ "amount": 0, "currency": "INR", + "payment_capture": true, "method": "emandate", "customer_id": "cust_1Aa00000000001", "receipt": "Receipt No. 1", @@ -70,7 +72,7 @@ Razorpay::Customer.create({ }, "bank_account": { "beneficiary_name": "Gaurav Kumar", - "account_number": 1121431121541121, + "account_number": "1121431121541121", "account_type": "savings", "ifsc_code": "HDFC0000001" } @@ -86,9 +88,10 @@ Razorpay::Customer.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 | object | A key-value pair | +| notes | object | A key-value pair | +| token | object | 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) @@ -142,13 +145,16 @@ Razorpay::SubscriptionRegistration.create(para_attr) | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| -| customer | object | Details of the customer to whom the registration link will be sent. | +| customer* | object | 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 | object | 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 | object | 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) @@ -313,7 +319,7 @@ Razorpay::Payment.fetch(paymentId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -367,7 +373,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** @@ -409,6 +415,7 @@ Razorpay::Order.create(para_attr) | 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. | **Response:** ```json @@ -450,7 +457,7 @@ para_attr = { "note_key 2": "Tea. Earl Gray. Hot." } } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** From f38c2323efcf4f6c9271201ea60bd71c054c8365 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Thu, 7 Jul 2022 23:34:29 +0530 Subject: [PATCH 25/49] param & notify_by correction --- documents/emandate.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/documents/emandate.md b/documents/emandate.md index 184bddb..dcbd82e 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -12,7 +12,6 @@ Razorpay::Customer.create({ "contact": 9123456780, "email": "gaurav.kumar@example.com", "fail_existing": 0, - "gstin": "29XAbbA4369J1PA", "notes": { "notes_key_1": "Tea, Earl Grey, Hot", "notes_key_2": "Tea, Earl Grey… decaf." @@ -167,7 +166,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** From 3edb7f728c44f3b8d12cc638325bcd2633441a50 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:00:38 +0530 Subject: [PATCH 26/49] card doc correction --- documents/card.md | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/documents/card.md b/documents/card.md index 4f531dc..0543a20 100644 --- a/documents/card.md +++ b/documents/card.md @@ -53,7 +53,7 @@ Razorpay::Customer.create(para_attr) ### Create Order ```rb -param_attr = { +para_attr = { "amount":100, "currency": "INR", "customer_id": "cust_4xbQrmEoA5WJ01", @@ -150,8 +150,7 @@ Razorpay::SubscriptionRegistration.create(para_attr) | 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. | @@ -344,7 +343,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** @@ -493,7 +492,7 @@ Razorpay::Payment.fetch(paymentId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -578,7 +577,7 @@ Razorpay::Card.fetch(cardId) "sub_type": "consumer", "token_iin": null } - +``` ------------------------------------------------------------------------------------------------------- ## Delete tokens @@ -605,6 +604,38 @@ Razorpay::fetch(customerId).deleteToken(tokenId) ``` ------------------------------------------------------------------------------------------------------- +### Fetch card + +```rb +cardId = "card_JXPULjlKqC5j0i" + +Razorpay::Card.fetch(cardId) +``` + +**Parameters:** + +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| cardId* | string | card id to be fetched | + +**Response:** +```json +{ + "id": "card_JXPULjlKqC5j0i", + "entity": "card", + "name": "Gaurav", + "last4": "4366", + "network": "Visa", + "type": "credit", + "issuer": "UTIB", + "international": false, + "emi": true, + "sub_type": "consumer", + "token_iin": null +} +``` +------------------------------------------------------------------------------------------------------- + **PN: * indicates mandatory fields**

From 81bbd1e27301a6f843c14d86d34cea0a38acb3c6 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:13:06 +0530 Subject: [PATCH 27/49] method name correction --- documents/card.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/card.md b/documents/card.md index 0543a20..a9443cc 100644 --- a/documents/card.md +++ b/documents/card.md @@ -303,7 +303,7 @@ para_attr = { "note_key 2": "Tea. Earl Gray. Hot." } } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** From db46849bad67c518ee8351d2d453563aff3e67e6 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:21:44 +0530 Subject: [PATCH 28/49] papernach doc correction --- documents/papernach.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/documents/papernach.md b/documents/papernach.md index e4d0657..b101598 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -12,7 +12,6 @@ para_attr = { "contact": 9123456780, "email": "gaurav.kumar@example.com", "fail_existing": 0, - "gstin": "29XAbbA4369J1PA", "notes": { "notes_key_1": "Tea, Earl Grey, Hot", "notes_key_2": "Tea, Earl Grey… decaf." @@ -30,6 +29,7 @@ Razorpay::Customer.create(para_attr) | 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 @@ -315,7 +315,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** @@ -556,7 +556,7 @@ Razorpay::Payment.fetch(paymentId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -602,7 +602,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** @@ -683,7 +683,7 @@ para_attr = { "note_key 2": "Tea. Earl Gray. Hot." } } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** From 7e37cec12462be8e7e8bc85252c01a935427cf72 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:24:44 +0530 Subject: [PATCH 29/49] delete token correction --- documents/card.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/card.md b/documents/card.md index a9443cc..49bd088 100644 --- a/documents/card.md +++ b/documents/card.md @@ -587,7 +587,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** From 715128156dc2d9f9f66ec07f76f49a5b93f36f65 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:28:47 +0530 Subject: [PATCH 30/49] update param --- documents/papernach.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/documents/papernach.md b/documents/papernach.md index b101598..f045bd4 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -212,17 +212,29 @@ para_attr = { Razorpay::SubscriptionRegistration.create(para_attr) ``` - **Parameters:** -All parameters listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/authorization-transaction/#121-create-a-registration-link) are supported + +| Name | Type | Description | +|-----------------|---------|------------------------------------------------------------------------------| +| customer | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) | +| 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 | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) | +| 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. | +| receipt | string | Your system order reference id. | +| notes | object | A key-value pair | **Response:** ```json { "id": "inv_FHrZiAubEzDdaq", "entity": "invoice", - "receipt": "Receipt No. 1", - "invoice_number": "Receipt No. 1", + "receipt": "Receipt No. 27", + "invoice_number": "Receipt No. 27", "customer_id": "cust_BMB3EwbqnqZ2EI", "customer_details": { "id": "cust_BMB3EwbqnqZ2EI", From e1795058f8502cf5012fcbe1bcb559f262713a0c Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 00:39:56 +0530 Subject: [PATCH 31/49] create order param update --- documents/papernach.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/documents/papernach.md b/documents/papernach.md index f045bd4..067bfd3 100644 --- a/documents/papernach.md +++ b/documents/papernach.md @@ -53,28 +53,33 @@ Razorpay::Customer.create(para_attr) ```rb para_attr = { - "amount": 0, + "amount":0, "currency": "INR", - "method": "emandate", + "method": "nach", "customer_id": "cust_1Aa00000000001", "receipt": "Receipt No. 1", "notes": { "notes_key_1": "Beam me up Scotty", "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": { + "bank_account":{ + "account_number": "11214311215411", + "ifsc_code": "HDFC0000001", "beneficiary_name": "Gaurav Kumar", - "account_number": 1121431121541121, - "account_type": "savings", - "ifsc_code": "HDFC0000001" + "account_type": "savings" + }, + "nach":{ + "form_reference1": "Recurring Payment for Gaurav Kumar", + "form_reference2": "Method Paper NACH", + "description": "Paper NACH Gaurav Kumar" } } } @@ -638,6 +643,7 @@ Razorpay::Customer.fetch(customerId).deleteToken(tokenId) para_attr{ "amount": 1000, "currency": "INR", + "payment_capture": true, "receipt": "Receipt No. 1", "notes": { "notes_key_1": "Tea, Earl Grey, Hot", @@ -649,10 +655,12 @@ Razorpay::Order.create(para_attr) **Parameters:** + | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| -| amount* | integer | Amount of the order to be paid | +| amount* | integer | Amount in currency subunits. For cards, the minimum value is `100` (₹1). | | 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 | **Response:** From 4f21149e0abd9e2682bf77b0aac0031039d66901 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 13:40:48 +0530 Subject: [PATCH 32/49] added note param --- documents/transfers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/transfers.md b/documents/transfers.md index 73ee441..b3d1b8d 100644 --- a/documents/transfers.md +++ b/documents/transfers.md @@ -208,6 +208,7 @@ Razorpay::Transfer.create(para_attr) | accountId* | string | The id of the account to be fetched | | 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) | +| notes | object | | A key-value pair | **Response:** ```json From 9bd3f0105930258b304a897726a9cd06d29f0cf3 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 13:45:31 +0530 Subject: [PATCH 33/49] add param link --- documents/transfers.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/documents/transfers.md b/documents/transfers.md index b3d1b8d..a4d3f14 100644 --- a/documents/transfers.md +++ b/documents/transfers.md @@ -125,13 +125,7 @@ Razorpay::Order.create(para_attr) | amount* | integer | The transaction amount, in paise | | currency* | string | The currency of the payment (defaults to INR) | | receipt | string | A unique identifier provided by you for your internal reference. | -| transfers["account"]* | string | The id of the account to be fetched | -| transfers["amount"]* | integer | The transaction amount, in paise | -| transfers["currency"]* | string | The currency of the payment (defaults to INR) | -| transfers["notes"] | object | Key-value pair that can be used to store additional | -| transfers["linked_account_notes"] | array | A key-value pair | -| transfers["on_hold"]* | boolean | Possible values is `0` or `1` | -| transfers["on_hold_until"] | integer | Timestamp, in Unix, that indicates until when the settlement of the transfer must be put on hold | +| transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#create-transfers-from-orders) are supported | **Response:** ```json From 8ee349504d608c20322529f9757fe78b355736c5 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 16:27:22 +0530 Subject: [PATCH 34/49] updated response --- documents/items.md | 72 ++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/documents/items.md b/documents/items.md index 3c46784..896abf7 100644 --- a/documents/items.md +++ b/documents/items.md @@ -73,34 +73,28 @@ Razorpay::Item.all(options) **Response:** ```json { - "entity": "collection", - "count": 3, - "items": [ - { - "id": "item_7Oy8OMV6BdEAac", - "active": true, - "name": "Book / Ignited Minds", - "description": null, - "amount": 15000, - "currency": "INR" - }, - { - "id": "item_7Oxp4hmm6T4SCn", - "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" - } - ] + "entity": "collection", + "count": 1, + "items": [ + { + "id": "item_JnjKnSWxjILdWu", + "active": true, + "name": "Book / English August", + "description": "An indian story, Booker prize winner.", + "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": 1656597363 + } + ] } ``` ------------------------------------------------------------------------------------------------------- @@ -120,12 +114,22 @@ Razorpay::Item.fetch(itemId) **Response:** ```json { - "id": "item_7Oxp4hmm6T4SCn", - "active": true, - "name": "Book / English August", - "description": "An indian story, Booker prize winner.", - "amount": 20000, - "currency": "INR" + "id": "item_JnjKnSWxjILdWu", + "active": true, + "name": "Book / English August", + "description": "An indian story, Booker prize winner.", + "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": 1656597363 } ``` From 514f7d8ad5bd406851adde767d61ec3a4ab590d5 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 16:50:29 +0530 Subject: [PATCH 35/49] upi doc correction --- documents/upi.md | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/documents/upi.md b/documents/upi.md index f57fa77..1bac30c 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -10,6 +10,7 @@ Razorpay.setup('key_id', 'key_secret') para_attr = { "name": "Razorpay User", "email": "customer@razorpay.com", + "fail_existing": 0, "contact": 9123456780, "notes": { "notes_key_1": "Tea, Earl Grey, Hot", @@ -52,23 +53,19 @@ Razorpay::Customer.create(para_attr) ```rb para_attr = { - "amount": 0, + "amount": 100, "currency": "INR", + "customer_id": "cust_4xbQrmEoA5WJ01", "method": "upi", - "customer_id": "cust_1Aa00000000001", + "token": { + "max_amount": 200000, + "expire_at": 2709971120, + "frequency": "monthly" + }, "receipt": "Receipt No. 1", "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." - } + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." } } Razorpay.Order.create(para_attr) @@ -83,7 +80,7 @@ Razorpay.Order.create(para_attr) | 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 @@ -147,17 +144,16 @@ Razorpay::SubscriptionRegistration.create(para_attr) | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| -| customer | object | Details of the customer to whom the registration link will be sent. | +| customer | object | 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. | -|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 | object | 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 | object | A key-value pair | **Response:** @@ -227,7 +223,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** @@ -324,7 +320,7 @@ Razorpay::Invoice.cancel(invoiceId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -433,7 +429,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** @@ -458,6 +454,7 @@ para_attr{ "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." @@ -473,6 +470,7 @@ Razorpay::Order.create(para_attr) | 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. | +| receipt | string | Your system order reference id. | | notes | object | A key-value pair | **Response:** @@ -512,7 +510,7 @@ para_attr = { "description": "Creating recurring payment for Gaurav Kumar" } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** From e66d0ca659240baa15e57ceb66c927b7e1dcbff8 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 17:03:03 +0530 Subject: [PATCH 36/49] params update --- documents/upi.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/documents/upi.md b/documents/upi.md index 1bac30c..4fe50a7 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -318,9 +318,9 @@ Razorpay::Invoice.cancel(invoiceId) ### Fetch token by payment ID ```rb -customerId = "cust_1Aa00000000004" +paymentId = "pay_FHfAzEJ51k8NLj" -Razorpay::Customer.fetch(customerId).fetchTokens +Razorpay::Payment.fetch(paymentId) ``` **Parameters:** @@ -470,9 +470,8 @@ Razorpay::Order.create(para_attr) | 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. | -| 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 | - **Response:** ```json { From e09bf81dd953330e292a856ef2817e3fdecb6916 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 17:19:08 +0530 Subject: [PATCH 37/49] registeremandate doc correction --- documents/registerEmandate.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/documents/registerEmandate.md b/documents/registerEmandate.md index 9bffffd..95f39b5 100644 --- a/documents/registerEmandate.md +++ b/documents/registerEmandate.md @@ -53,31 +53,33 @@ Razorpay::Customer.create(para_attr) ```rb para_attr = { - "amount": 100, + "amount": 0, "currency": "INR", "method": "emandate", - "receipt": "Receipt No. 5", + "customer_id": "cust_1Aa00000000001", + "receipt": "Receipt No. 1", "notes": { - "note_key 1": "Beam me up Scotty", - "note_key 2": "Engage" + "notes_key_1": "Beam me up Scotty", + "notes_key_2": "Engage" }, "token": { - "first_payment_amount": 10000, + "first_payment_amount": 100, "auth_type": "netbanking", "max_amount": 9999900, "expire_at": 4102444799, "notes": { - "note_key 1": "Tea, Earl Grey… decaf.", - "note_key 2": "Tea. Earl Gray. Hot." + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." }, "bank_account": { "beneficiary_name": "Gaurav Kumar", - "account_number": 11214311215411, + "account_number": "1121431121541121", "account_type": "savings", - "ifsc_code": "HDFC0001233" + "ifsc_code": "HDFC0000001" } } } + Razorpay::Order.create(para_attr) ``` @@ -161,6 +163,7 @@ Razorpay::SubscriptionRegistration.create(para_attr) **Response:** For create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link) + ------------------------------------------------------------------------------------------------------- ## Create an order to charge the customer @@ -224,7 +227,7 @@ para_attr = { "key2": "value2" } } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** @@ -258,7 +261,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** @@ -369,7 +372,7 @@ For fetch token by payment id response please click [here](https://razorpay.com/ ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -422,7 +425,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** From 64e07a0e8ca6598d4e682dd394b5c757c250ab93 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 17:30:22 +0530 Subject: [PATCH 38/49] update params --- documents/registerEmandate.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documents/registerEmandate.md b/documents/registerEmandate.md index 95f39b5..d01b9c4 100644 --- a/documents/registerEmandate.md +++ b/documents/registerEmandate.md @@ -149,7 +149,7 @@ Razorpay::SubscriptionRegistration.create(para_attr) | 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) | @@ -173,6 +173,7 @@ para_attr ={ "amount": "100", "currency": "INR", "receipt": "Receipt No. 1", + "payment_capture": true, "notes": { "key1": "value3", "key2": "value2" From d850688ed5060472b68870b9a9df563bfc00d628 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 17:34:00 +0530 Subject: [PATCH 39/49] fetch tokens corrections --- documents/upi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/upi.md b/documents/upi.md index 4fe50a7..dd01ec0 100644 --- a/documents/upi.md +++ b/documents/upi.md @@ -378,7 +378,7 @@ Razorpay::Payment.fetch(paymentId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** From e7421d19562c94ead4642f4ad481ef5f89a4c63e Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 8 Jul 2022 17:59:10 +0530 Subject: [PATCH 40/49] register doc correction --- documents/registerNach.md | 93 +++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 52 deletions(-) diff --git a/documents/registerNach.md b/documents/registerNach.md index 2e983c4..e6f4217 100644 --- a/documents/registerNach.md +++ b/documents/registerNach.md @@ -48,30 +48,31 @@ Razorpay::Customer.create(para_attr) ```rb para_attr = { - "amount": 100, + "amount":0, "currency": "INR", "method": "nach", - "receipt": "Receipt No. 5", + "customer_id": "cust_1Aa00000000001", + "receipt": "Receipt No. 1", "notes": { - "note_key 1": "Beam me up Scotty", - "note_key 2": "Tea. Earl Gray. Hot." + "notes_key_1": "Beam me up Scotty", + "notes_key_2": "Engage" }, - "token": { + "token":{ "first_payment_amount": 10000, "auth_type": "physical", - "max_amount": 50000, - "expire_at": 1634215992, + "max_amount":10000000, + "expire_at":1580480689, "notes": { - "note_key 1": "Tea, Earl Grey… decaf.", - "note_key 2": "Tea. Earl Gray. Hot." + "notes_key_1": "Tea, Earl Grey, Hot", + "notes_key_2": "Tea, Earl Grey… decaf." }, - "bank_account": { + "bank_account":{ + "account_number": "11214311215411", + "ifsc_code": "HDFC0000001", "beneficiary_name": "Gaurav Kumar", - "account_number": 11214311215411, - "account_type": "savings", - "ifsc_code": "HDFC0001233" + "account_type": "savings" }, - "nach": { + "nach":{ "form_reference1": "Recurring Payment for Gaurav Kumar", "form_reference2": "Method Paper NACH", "description": "Paper NACH Gaurav Kumar" @@ -85,22 +86,12 @@ Razorpay.Order.create(para_attr) | Name | Type | Description | |-----------------|---------|------------------------------------------------------------------------------| -| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) | +| amount* | integer | Amount in currency subunits. For Paper NACH, the amount has to be `0` | | 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 | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported | | notes | object | A key-value pair | **Response:** @@ -171,37 +162,36 @@ Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-n ```rb para_attr = { - "customer": { + "customer":{ "name": "Gaurav Kumar", "email": "gaurav.kumar@example.com", - "contact": 9123456780 + "contact": "9123456780" }, - "amount": 100, - "type": "link", + "amount":0, "currency": "INR", - "description": "Registration Link for Gaurav Kumar", - "subscription_registration": { - "first_payment_amount": 100, + "type": "link", + "description": "12 p.m. Meals", + "subscription_registration":{ "method": "nach", "auth_type": "physical", - "max_amount": 50000, - "expire_at": 1634215992, - "bank_account": { + "bank_account":{ "beneficiary_name": "Gaurav Kumar", - "account_number": 11214311215411, + "account_number": "11214311215411", "account_type": "savings", "ifsc_code": "HDFC0001233" }, - "nach": { + "nach":{ "form_reference1": "Recurring Payment for Gaurav Kumar", "form_reference2": "Method Paper NACH" - } + }, + "expire_at":1947483647, + "max_amount":50000 }, - "receipt": "Receipt No. 5", - "email_notify": 1, - "sms_notify": 1, - "expire_by": 1634215992, - "notes": { + "receipt": "Receipt No. 1", + "sms_notify":1, + "email_notify":1, + "expire_by":1647483647, + "notes":{ "note_key 1": "Beam me up Scotty", "note_key 2": "Tea. Earl Gray. Hot." } @@ -213,8 +203,7 @@ Razorpay::SubscriptionRegistration.create(para_attr) | Name | Type | Description | |-----------------|---------|---------------------------------------------------------------| -| customer | object | Details of the customer to whom the registration link will be sent. | -| type* | object | the value is `link`. | +| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#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. | @@ -379,7 +368,7 @@ para_attr = { "key2": "value2" } } -Razorpay::Payment.createRecurringPayment(para_attr) +Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** @@ -413,7 +402,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7" medium = "email" -Razorpay::Invoice.notifyBy(invoiceId, medium) +Razorpay::Invoice.notify_by(invoiceId, medium) ``` **Parameters:** @@ -537,9 +526,9 @@ Razorpay::Invoice.cancel(invoiceId); ## Fetch token by payment id ```rb -customerId = "cust_1Aa00000000004" +paymentId = "pay_EnLNTjINiPkMEZ" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Payment.fetch(paymentId) ``` **Parameters:** @@ -593,7 +582,7 @@ Razorpay::Customer.fetchTokens(customerId) ```rb customerId = "cust_1Aa00000000004" -Razorpay::Customer.fetchTokens(customerId) +Razorpay::Customer.fetch(customerId).fetchTokens ``` **Parameters:** @@ -638,7 +627,7 @@ customerId = "cust_1Aa00000000004" tokenId = "token_Hxe0skTXLeg9pF" -Razorpay::fetch(customerId).deleteToken(tokenId) +Razorpay::Customer.fetch(customerId).deleteToken(tokenId) ``` **Parameters:** From fd3fe6ca8f2112427f7b1b7bd3eda9c333fb7eba Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 10:56:05 +0530 Subject: [PATCH 41/49] add manadatory to param --- documents/registerNach.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/registerNach.md b/documents/registerNach.md index e6f4217..2d2b262 100644 --- a/documents/registerNach.md +++ b/documents/registerNach.md @@ -329,7 +329,7 @@ Razorpay::Order.create(para_attr) | currency* | string | The currency of the payment (defaults to INR) | | 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 596ea9ac21c9f064d1e9bd833be7a1799337417e Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 11:21:57 +0530 Subject: [PATCH 42/49] update param --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index 941285b..bdccae6 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -656,7 +656,7 @@ Razorpay::Payment.create_json_payment(param_attr) | 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 f3247037461c71d2577d8795632ec06fcc152362 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 11:24:02 +0530 Subject: [PATCH 43/49] update param --- documents/order.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/order.md b/documents/order.md index c099537..f2f8145 100644 --- a/documents/order.md +++ b/documents/order.md @@ -79,6 +79,7 @@ Razorpay::Order.create(para_attr) | 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 | +| notes | object | A key-value pair | **Response:** From 871a228def8c8cec188a8dc90920d6e57a326908 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 11:48:41 +0530 Subject: [PATCH 44/49] syntax error resolved --- documents/order.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/documents/order.md b/documents/order.md index f2f8145..30454c6 100644 --- a/documents/order.md +++ b/documents/order.md @@ -55,7 +55,7 @@ Razorpay::Order.create(para_attr) ### Create order (Third party validation) ```rb -param_attr = { +para_attr = { "amount": 500, "method": "netbanking", "receipt": "BILL13375649", @@ -65,7 +65,6 @@ param_attr = { "name": "Gaurav Kumar", "ifsc": "HDFC0000053" } -) Razorpay::Order.create(para_attr) ``` From d4d528df702b0a649682c3eb6037cddbcb47aab6 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 12:41:55 +0530 Subject: [PATCH 45/49] resolve syntax issue --- documents/payment.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index bdccae6..c8afffe 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -676,7 +676,7 @@ Razorpay::Payment.create_json_payment(param_attr) ### Create Payment UPI s2s / VPA token (Third party validation) ```rb -param_attr = { +para_attr = { "amount": 200, "currency": "INR", "order_id": "order_GAWRjlWkVcRh0V", @@ -730,7 +730,7 @@ Razorpay::Payment.create_upi(para_attr) ### Create Payment UPI s2s / VPA token (Third party validation) ```rb -param_attr = { +para_attr = { "amount": 100, "currency": "INR", "order_id": "order_Ee0biRtLOqzRjP", @@ -745,7 +745,7 @@ param_attr = { "purpose": "UPI test payment" }, "upi": { - "flow" : "intent" + "flow": "intent" } } @@ -782,7 +782,7 @@ Razorpay::Payment.create_upi(para_attr) ### Valid VPA (Third party validation) ```rb -param_attr = { +para_attr = { "vpa": "gauravkumar@exampleupi" } Razorpay::Payment.validate_vpa(para_attr) From 9ed2cc2a46efefbe2dc581878616f1e02d441de9 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 12:48:59 +0530 Subject: [PATCH 46/49] syntax issue resolved --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index c8afffe..03e3c9e 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -13,7 +13,7 @@ paymentId = "pay_G8VQzjPLoAvm6D" para_attr = { "amount": 1000, - "currency" : "INR" + "currency": "INR" } Razorpay::Payment.capture(paymentId, para_attr) ``` From ac1dd17e4cfb563e1159b3fd536120333435f7d3 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 12:56:52 +0530 Subject: [PATCH 47/49] resolved syntax issue --- documents/order.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documents/order.md b/documents/order.md index 30454c6..73d218b 100644 --- a/documents/order.md +++ b/documents/order.md @@ -65,6 +65,7 @@ para_attr = { "name": "Gaurav Kumar", "ifsc": "HDFC0000053" } +} Razorpay::Order.create(para_attr) ``` From 1613113997d4a5d1e271cd2b108651276565c91c Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 14:27:35 +0530 Subject: [PATCH 48/49] readme corrections --- documents/card.md | 32 -------------------------------- documents/emandate.md | 2 ++ documents/fund.md | 10 +++++----- documents/items.md | 2 +- documents/payment.md | 13 ++++++------- documents/paymentLink.md | 2 +- documents/qrcode.md | 6 +++--- documents/refund.md | 4 ++-- documents/registerEmandate.md | 11 +++++++---- documents/registerNach.md | 11 +++++++---- documents/virtualAccount.md | 2 +- test.rb | 24 ------------------------ 12 files changed, 35 insertions(+), 84 deletions(-) delete mode 100644 test.rb diff --git a/documents/card.md b/documents/card.md index 49bd088..29fee36 100644 --- a/documents/card.md +++ b/documents/card.md @@ -548,38 +548,6 @@ Razorpay::Customer.fetch(customerId).fetchTokens ``` ------------------------------------------------------------------------------------------------------- -### Fetch card - -```rb -cardId = "" - -Razorpay::Card.fetch(cardId) -``` - -**Parameters:** - -| Name | Type | Description | -|-----------------|---------|------------------------------------------------------------------------------| -| cardId* | string | card id to be fetched | - -**Response:** -```json -{ - "id": "card_JXPULjlKqC5j0i", - "entity": "card", - "name": "gaurav.kumar", - "last4": "4366", - "network": "Visa", - "type": "credit", - "issuer": "UTIB", - "international": false, - "emi": true, - "sub_type": "consumer", - "token_iin": null -} -``` -------------------------------------------------------------------------------------------------------- - ## Delete tokens ```rb diff --git a/documents/emandate.md b/documents/emandate.md index dcbd82e..e44e53e 100644 --- a/documents/emandate.md +++ b/documents/emandate.md @@ -94,6 +94,7 @@ Razorpay::Order.create({ **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 @@ -157,6 +158,7 @@ Razorpay::SubscriptionRegistration.create(para_attr) **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 diff --git a/documents/fund.md b/documents/fund.md index 900ef0b..9eb1a0c 100644 --- a/documents/fund.md +++ b/documents/fund.md @@ -8,12 +8,12 @@ Razorpay.setup('key_id', 'key_secret') ### Create a fund account ```rb para_attr = { - "customer_id":"cust_Aa000000000001", - "account_type":"bank_account", + "customer_id": "cust_Aa000000000001", + "account_type": "bank_account", "bank_account":{ - "name":"Gaurav Kumar", - "account_number":"11214311215411", - "ifsc":"HDFC0000053" + "name": "Gaurav Kumar", + "account_number": "11214311215411", + "ifsc": "HDFC0000053" } } diff --git a/documents/items.md b/documents/items.md index 896abf7..ed058d4 100644 --- a/documents/items.md +++ b/documents/items.md @@ -167,7 +167,7 @@ Razorpay::Item.edit(itemId,para_attr) "id": "item_JInaSLODeDUQiQ", "active": true, "name": "Book / Ignited Minds - Updated name!", - "description": "New descirption too. :).", + "description": "New descirption too.", "amount": 20000, "unit_amount": 20000, "currency": "INR", diff --git a/documents/payment.md b/documents/payment.md index 8a1b384..0056a2f 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -13,7 +13,7 @@ paymentId = "pay_G8VQzjPLoAvm6D" para_attr = { "amount": 1000, - "currency" : "INR" + "currency": "INR" } Razorpay::Payment.capture(paymentId, para_attr) ``` @@ -23,8 +23,7 @@ Razorpay::Payment.capture(paymentId, para_attr) | Name | Type | Description | |-----------|---------|--------------------------------------------------------------------------------| | paymentId* | string | Id of the payment to capture | -| para_attr["amount"]* | integer | The amount to be captured (should be equal to the authorized amount, in paise) | -| para_attr["currency"]* | string | The currency of the payment (defaults to INR) | +| para_attr | object | All parameters listed [here](https://razorpay.com/docs/api/payments/#capture-a-payment) are supported | **Response:** ```json @@ -383,10 +382,10 @@ para_attr = { "currency": "INR", "receipt": "rcptid_11", "payment": { - "capture ": "automatic", - "capture_options ": { - "automatic_expiry_period ": 12, - "manual_expiry_period ": 7200, + "capture": "automatic", + "capture_options": { + "automatic_expiry_period": 12, + "manual_expiry_period": 7200, "refund_speed": "optimum" } } diff --git a/documents/paymentLink.md b/documents/paymentLink.md index 570dd24..225c099 100644 --- a/documents/paymentLink.md +++ b/documents/paymentLink.md @@ -139,7 +139,7 @@ paymentLinkId = "plink_ExjpAUN3gVHrPJ" para_attr = { "reference_id": "TS35", "expire_by": 1653347540, - "reminder_enable":false, + "reminder_enable": false, "notes":{ "policy_name": "Jeevan Saral" } diff --git a/documents/qrcode.md b/documents/qrcode.md index 555d1f1..ca31167 100644 --- a/documents/qrcode.md +++ b/documents/qrcode.md @@ -37,7 +37,7 @@ Razorpay::QrCode.create(para_attr) | customer_id | string | Unique identifier of the customer the QR code is linked with | | description | string | A brief description about the QR code. | | close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. | -| 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. | +| notes | object | 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 @@ -105,8 +105,8 @@ Razorpay::QrCode.create(para_attr) | customer_id | string | Unique identifier of the customer the QR code is linked with | | description | string | A brief description about the QR code. | | close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. | -| 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. | -| tax_invoice | array | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. | +| notes | object | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. | +| tax_invoice | object | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. | **Response:** ```json diff --git a/documents/refund.md b/documents/refund.md index f35584b..1c90773 100644 --- a/documents/refund.md +++ b/documents/refund.md @@ -31,7 +31,7 @@ Razorpay::Payment.fetch(paymentId).refund(para_attr) | paymentId* | string | The id of the payment | | amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) | | | speed | string | Here, it must be normal | -| notes | array | A key-value pair | +| notes | object | A key-value pair | | receipt | string | A unique identifier provided by you for your internal reference. | **Response:** @@ -292,7 +292,7 @@ Razorpay::Refund.fetch(refundId).edit(para_attr) | Name | Type | Description | |-------|-----------|--------------------------------------------------| | refundId* | string | The id of the refund to be fetched | -| notes* | array | A key-value pair | +| notes* | object | A key-value pair | **Response:** ```json diff --git a/documents/registerEmandate.md b/documents/registerEmandate.md index d01b9c4..abf9af3 100644 --- a/documents/registerEmandate.md +++ b/documents/registerEmandate.md @@ -218,14 +218,17 @@ Razorpay::Order.create(para_attr) ```rb para_attr = { "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." } } Razorpay::Payment.create_recurring_payment(para_attr) diff --git a/documents/registerNach.md b/documents/registerNach.md index 2d2b262..0d3daa5 100644 --- a/documents/registerNach.md +++ b/documents/registerNach.md @@ -6,8 +6,7 @@ para_attr = { "name": "Gaurav Kumar", "contact": 9123456780, "email": "gaurav.kumar@example.com", - "fail_existing": 0, - "gstin": "29XAbbA4369J1PA", + "fail_existing": "0", "notes": { "notes_key_1": "Tea, Earl Grey, Hot", "notes_key_2": "Tea, Earl Grey… decaf." @@ -361,13 +360,17 @@ para_attr = { "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." } } + Razorpay::Payment.create_recurring_payment(para_attr) ``` **Parameters:** diff --git a/documents/virtualAccount.md b/documents/virtualAccount.md index 5d398bf..01d6677 100644 --- a/documents/virtualAccount.md +++ b/documents/virtualAccount.md @@ -437,7 +437,7 @@ Razorpay::Payment.fetch(payment_id).refund(options) "receipt": "Receipt No. 31", "currency": "INR", "payment_id": "pay_FCXKPFtYfPXJPy", - "notes": [] + "notes": [], "receipt": null, "acquirer_data": { "arn": null diff --git a/test.rb b/test.rb deleted file mode 100644 index e68d998..0000000 --- a/test.rb +++ /dev/null @@ -1,24 +0,0 @@ - -require "razorpay" - -Razorpay.setup('rzp_test_k6uL897VPBz20q', 'EnLs21M47BllR3X8PSFtjtbd') - - -options = {"count":1} - -Razorpay::Item.all(options) - -# para_attr = { -# "amount": 100, -# "currency": "INR", -# "receipt": "receipt#1", -# "bank_account": { -# "account_number": "765432123456789", -# "name": "Gaurav Kumar", -# "ifsc": "HDFC0000053" -# } -# } - -# res = Razorpay::Order.create(para_attr) - -puts(res.to_json()) \ No newline at end of file From 5b5c5114ae37e00c903abf1f000d65a656afca54 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 11 Jul 2022 14:51:05 +0530 Subject: [PATCH 49/49] update version --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- lib/razorpay/constants.rb | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebb9a77..168da60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ Changelog for Razorpay-Ruby SDK. ## Unreleased +## [3.0.1] - 2022-07-11 + +### Added + +- Added Third party validation API for Payments (create_upi, validate_vpa) +- New API for Payment Methods +- Doc Updated + ## [3.0.0] - 2022-06-03 ### Added diff --git a/README.md b/README.md index 93e226d..685ea36 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Razorpay Ruby bindings -[![Build Status](https://travis-ci.org/razorpay/razorpay-ruby.svg?branch=master)](https://travis-ci.org/razorpay/razorpay-ruby) [![Gem Version](https://img.shields.io/badge/gem%20version-v3.0.0-dark%20green.svg)](http://badge.fury.io/rb/razorpay) [![Coverage Status](https://coveralls.io/repos/github/Razorpay/razorpay-ruby/badge.svg?branch=master)](https://coveralls.io/github/Razorpay/razorpay-ruby?branch=master) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) +[![Build Status](https://travis-ci.org/razorpay/razorpay-ruby.svg?branch=master)](https://travis-ci.org/razorpay/razorpay-ruby) [![Gem Version](https://img.shields.io/badge/gem%20version-v3.0.1-dark%20green.svg)](http://badge.fury.io/rb/razorpay) [![Coverage Status](https://coveralls.io/repos/github/Razorpay/razorpay-ruby/badge.svg?branch=master)](https://coveralls.io/github/Razorpay/razorpay-ruby?branch=master) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) This is the base ruby gem for interacting with the Razorpay API. This is primarily meant for users who wish to perform interactions with the Razorpay API programatically. diff --git a/lib/razorpay/constants.rb b/lib/razorpay/constants.rb index c99cd46..ce8aaa7 100644 --- a/lib/razorpay/constants.rb +++ b/lib/razorpay/constants.rb @@ -2,5 +2,5 @@ module Razorpay BASE_URI = 'https://api.razorpay.com/v1/'.freeze TEST_URL = 'https://api.razorpay.com/'.freeze - VERSION = '3.0.0'.freeze + VERSION = '3.0.1'.freeze end