documents/payment.md in razorpay-3.0.0 vs documents/payment.md in razorpay-3.0.1
- old
+ new
@@ -11,22 +11,21 @@
```rb
paymentId = "pay_G8VQzjPLoAvm6D"
para_attr = {
"amount": 1000,
- "currency" : "INR"
+ "currency": "INR"
}
Razorpay::Payment.capture(paymentId, para_attr)
```
**Parameters:**
| 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
{
"id": "pay_G8VQzjPLoAvm6D",
@@ -79,11 +78,11 @@
|-------|-----------|--------------------------------------------------|
| 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) |
-| 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:**
```json
{
@@ -253,12 +252,12 @@
**Parameters:**
| 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
{
"id": "pay_CBYy6tLmJTzn3Q",
@@ -381,14 +380,14 @@
para_attr = {
"amount":50000,
"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"
}
}
}
Razorpay::Order.create(para_attr)
@@ -399,11 +398,12 @@
| Name | Type | Description |
|-------------|---------|--------------------------------------|
| 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:** <br>
```json
{
"id": "order_DBJOWzybf0sJbb",
@@ -495,16 +495,16 @@
| 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 `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
**Response:** <br>
```json
@@ -627,9 +627,199 @@
"razorpay_payment_id": "pay_JWaNvYmrx75sXo"
}
```
-------------------------------------------------------------------------------------------------------
+
+### 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:** <br>
+```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
+para_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:** <br>
+```json
+{
+ "razorpay_payment_id": "pay_EAm09NKReXi2e0"
+}
+```
+-------------------------------------------------------------------------------------------------------
+### Create Payment UPI s2s / VPA token (Third party validation)
+
+```rb
+para_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:** <br>
+```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
+para_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:** <br>
+```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:** <br>
+ 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**
<br>
<br>
**For reference click [here](https://razorpay.com/docs/api/payments/)**
\ No newline at end of file