Skip to content

Commit

Permalink
Merge pull request #166 from razorpay/customer_doc_correction
Browse files Browse the repository at this point in the history
customer doc correction
  • Loading branch information
ankitdas13 authored Jul 11, 2022
2 parents 9e057a2 + 5b5c511 commit a563d73
Show file tree
Hide file tree
Showing 34 changed files with 1,250 additions and 509 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
14 changes: 11 additions & 3 deletions documents/Invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -507,7 +515,7 @@ invoiceId = "inv_E7q0tqkxBRzdau"

medium = "email"

Razorpay::Invoice.notifyBy(invoiceId,medium)
Razorpay::Invoice.notify_by(invoiceId,medium)
```

**Parameters:**
Expand Down
24 changes: 23 additions & 1 deletion documents/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -161,6 +161,28 @@ 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 deleted |

**Response:**

```json
[]
```
-------------------------------------------------------------------------------------------------------

**PN: * indicates mandatory fields**
Expand Down
61 changes: 30 additions & 31 deletions documents/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Razorpay::Customer.create(para_attr)
### Create Order

```rb
param_attr = {
para_attr = {
"amount":100,
"currency": "INR",
"customer_id": "cust_4xbQrmEoA5WJ01",
Expand Down Expand Up @@ -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. |
Expand Down Expand Up @@ -304,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:**

Expand Down Expand Up @@ -344,7 +343,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"

medium = "email"

Razorpay::Invoice.notifyBy(invoiceId, medium)
Razorpay::Invoice.notify_by(invoiceId, medium)
```
**Parameters:**

Expand Down Expand Up @@ -493,7 +492,7 @@ Razorpay::Payment.fetch(paymentId)
```rb
customerId = "cust_1Aa00000000004"

Razorpay::Customer.fetchTokens(customerId)
Razorpay::Customer.fetch(customerId).fetchTokens
```
**Parameters:**

Expand Down Expand Up @@ -549,58 +548,58 @@ Razorpay::Customer.fetchTokens(customerId)
```
-------------------------------------------------------------------------------------------------------

### Fetch card
## Delete tokens

```rb
cardId = ""
customerId = "cust_1Aa00000000004"

Razorpay::Card.fetch(cardId)
```
tokenId = "token_Hxe0skTXLeg9pF"

Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
```
**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| cardId* | string | card id to be fetched |
| customerId* | string | The id of the customer to be fetched |
| tokenId* | string | The id of the token 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
"deleted": true
}

```
-------------------------------------------------------------------------------------------------------

## Delete tokens
### Fetch card

```rb
customerId = "cust_1Aa00000000004"

tokenId = "token_Hxe0skTXLeg9pF"
cardId = "card_JXPULjlKqC5j0i"

Razorpay::fetch(customerId).deleteToken(tokenId)
Razorpay::Card.fetch(cardId)
```

**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customerId* | string | The id of the customer to be fetched |
| tokenId* | string | The id of the token to be fetched |
| cardId* | string | card id to be fetched |

**Response:**
```json
{
"deleted": true
"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
}
```
-------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions documents/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
32 changes: 20 additions & 12 deletions documents/emandate.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Razorpay::Customer.create({
"contact": 9123456780,
"email": "[email protected]",
"fail_existing": 0,
"gstin": "29XAbbA4369J1PA",
"notes": {
"notes_key_1": "Tea, Earl Grey, Hot",
"notes_key_2": "Tea, Earl Grey… decaf."
Expand All @@ -28,6 +27,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
Expand All @@ -50,9 +50,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",
Expand All @@ -70,7 +71,7 @@ Razorpay::Customer.create({
},
"bank_account": {
"beneficiary_name": "Gaurav Kumar",
"account_number": 1121431121541121,
"account_number": "1121431121541121",
"account_type": "savings",
"ifsc_code": "HDFC0000001"
}
Expand All @@ -86,12 +87,14 @@ 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)

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

### Create an Authorization Payment
Expand Down Expand Up @@ -142,16 +145,20 @@ 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)

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

### Send/Resend notifications
Expand All @@ -161,7 +168,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"

medium = "email"

Razorpay::Invoice.notifyBy(invoiceId, medium)
Razorpay::Invoice.notify_by(invoiceId, medium)
```

**Parameters:**
Expand Down Expand Up @@ -313,7 +320,7 @@ Razorpay::Payment.fetch(paymentId)
```rb
customerId = "cust_1Aa00000000004"

Razorpay::Customer.fetchTokens(customerId)
Razorpay::Customer.fetch(customerId).fetchTokens
```

**Parameters:**
Expand Down Expand Up @@ -367,7 +374,7 @@ customerId = "cust_1Aa00000000004"

tokenId = "token_Hxe0skTXLeg9pF"

Razorpay::fetch(customerId).deleteToken(tokenId)
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
```

**Parameters:**
Expand Down Expand Up @@ -409,6 +416,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
Expand Down Expand Up @@ -450,7 +458,7 @@ para_attr = {
"note_key 2": "Tea. Earl Gray. Hot."
}
}
Razorpay::Payment.createRecurringPayment(para_attr)
Razorpay::Payment.create_recurring_payment(para_attr)
```

**Parameters:**
Expand Down
Loading

0 comments on commit a563d73

Please sign in to comment.