Skip to content

Commit a563d73

Browse files
authored
Merge pull request #166 from razorpay/customer_doc_correction
customer doc correction
2 parents 9e057a2 + 5b5c511 commit a563d73

34 files changed

+1250
-509
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Changelog for Razorpay-Ruby SDK.
44

55
## Unreleased
66

7+
## [3.0.1] - 2022-07-11
8+
9+
### Added
10+
11+
- Added Third party validation API for Payments (create_upi, validate_vpa)
12+
- New API for Payment Methods
13+
- Doc Updated
14+
715
## [3.0.0] - 2022-06-03
816

917
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Razorpay Ruby bindings
22

3-
[![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)
3+
[![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)
44

55
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.
66

documents/Invoice.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,16 @@ Razorpay::Invoice.create({
6767
|-----------------|---------|------------------------------------------------------------------------------|
6868
|type* | string | entity type (here its invoice) |
6969
|description | string | A brief description of the invoice. |
70-
|customer_id | string | customer id for which invoice need be raised |
71-
|customer | object | customer details in a object format |
70+
|customer_id | string | customer id for which invoice need be raised |
71+
|draft | string | Invoice is created in draft state when value is set to `1` |
72+
| customer.name* | object | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
73+
| line_items | object | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
74+
75+
|expire_by | object | Details of the line item that is billed in the invoice. |
76+
|sms_notify | object | Details of the line item that is billed in the invoice. |
77+
|email_notify | object | Details of the line item that is billed in the invoice. |
78+
|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. |
79+
| currency* | string | The currency of the payment (defaults to INR) |
7280

7381
**Response:**
7482
For create invoice response please click [here](https://razorpay.com/docs/api/invoices/#create-an-invoice)
@@ -507,7 +515,7 @@ invoiceId = "inv_E7q0tqkxBRzdau"
507515

508516
medium = "email"
509517

510-
Razorpay::Invoice.notifyBy(invoiceId,medium)
518+
Razorpay::Invoice.notify_by(invoiceId,medium)
511519
```
512520

513521
**Parameters:**

documents/addon.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Razorpay::Addon.create(subscriptionId,{
2828
|-------|-----------|--------------------------------------------------|
2929
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
3030
| items* | object | Details of the add-on you want to create. |
31-
| quantity* | integer | This specifies the number of units of the add-on to be charged to the customer. |
31+
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |
3232

3333
**Response:**
3434
```json
@@ -161,6 +161,28 @@ Razorpay::Addon.fetch(addonId)
161161
"invoice_id":null
162162
}
163163
```
164+
----------------------------------------------------------------------------------------------------
165+
166+
### Delete an addon
167+
168+
```rb
169+
addonId = "ao_IrSY3UIqDRx7df"
170+
171+
Razorpay::Addon.delete(addonId)
172+
```
173+
174+
175+
**Parameters:**
176+
177+
| Name | Type | Description |
178+
|-----------------|---------|------------------------------------------------------------------------------|
179+
| addonId* | string | addon id to be deleted |
180+
181+
**Response:**
182+
183+
```json
184+
[]
185+
```
164186
-------------------------------------------------------------------------------------------------------
165187

166188
**PN: * indicates mandatory fields**

documents/card.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Razorpay::Customer.create(para_attr)
5353
### Create Order
5454

5555
```rb
56-
param_attr = {
56+
para_attr = {
5757
"amount":100,
5858
"currency": "INR",
5959
"customer_id": "cust_4xbQrmEoA5WJ01",
@@ -150,8 +150,7 @@ Razorpay::SubscriptionRegistration.create(para_attr)
150150

151151
| Name | Type | Description |
152152
|-----------------|---------|------------------------------------------------------------------------------|
153-
| customer | object | Details of the customer to whom the registration link will be sent. |
154-
| type* | string | the value is `link`. |
153+
| customer | object | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#121-create-a-registration-link) are supported |
155154
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
156155
| currency* | string | The currency of the payment (defaults to INR) |
157156
| description* | string | A brief description of the payment. |
@@ -304,7 +303,7 @@ para_attr = {
304303
"note_key 2": "Tea. Earl Gray. Hot."
305304
}
306305
}
307-
Razorpay::Payment.createRecurringPayment(para_attr)
306+
Razorpay::Payment.create_recurring_payment(para_attr)
308307
```
309308
**Parameters:**
310309

@@ -344,7 +343,7 @@ invoiceId = "inv_JDdNb4xdf4gxQ7"
344343

345344
medium = "email"
346345

347-
Razorpay::Invoice.notifyBy(invoiceId, medium)
346+
Razorpay::Invoice.notify_by(invoiceId, medium)
348347
```
349348
**Parameters:**
350349

@@ -493,7 +492,7 @@ Razorpay::Payment.fetch(paymentId)
493492
```rb
494493
customerId = "cust_1Aa00000000004"
495494

496-
Razorpay::Customer.fetchTokens(customerId)
495+
Razorpay::Customer.fetch(customerId).fetchTokens
497496
```
498497
**Parameters:**
499498

@@ -549,58 +548,58 @@ Razorpay::Customer.fetchTokens(customerId)
549548
```
550549
-------------------------------------------------------------------------------------------------------
551550

552-
### Fetch card
551+
## Delete tokens
553552

554553
```rb
555-
cardId = ""
554+
customerId = "cust_1Aa00000000004"
556555

557-
Razorpay::Card.fetch(cardId)
558-
```
556+
tokenId = "token_Hxe0skTXLeg9pF"
559557

558+
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
559+
```
560560
**Parameters:**
561561

562562
| Name | Type | Description |
563563
|-----------------|---------|------------------------------------------------------------------------------|
564-
| cardId* | string | card id to be fetched |
564+
| customerId* | string | The id of the customer to be fetched |
565+
| tokenId* | string | The id of the token to be fetched |
565566

566567
**Response:**
567568
```json
568569
{
569-
"id": "card_JXPULjlKqC5j0i",
570-
"entity": "card",
571-
"name": "gaurav.kumar",
572-
"last4": "4366",
573-
"network": "Visa",
574-
"type": "credit",
575-
"issuer": "UTIB",
576-
"international": false,
577-
"emi": true,
578-
"sub_type": "consumer",
579-
"token_iin": null
570+
"deleted": true
580571
}
581-
572+
```
582573
-------------------------------------------------------------------------------------------------------
583574

584-
## Delete tokens
575+
### Fetch card
585576

586577
```rb
587-
customerId = "cust_1Aa00000000004"
588-
589-
tokenId = "token_Hxe0skTXLeg9pF"
578+
cardId = "card_JXPULjlKqC5j0i"
590579

591-
Razorpay::fetch(customerId).deleteToken(tokenId)
580+
Razorpay::Card.fetch(cardId)
592581
```
582+
593583
**Parameters:**
594584

595585
| Name | Type | Description |
596586
|-----------------|---------|------------------------------------------------------------------------------|
597-
| customerId* | string | The id of the customer to be fetched |
598-
| tokenId* | string | The id of the token to be fetched |
587+
| cardId* | string | card id to be fetched |
599588

600589
**Response:**
601590
```json
602591
{
603-
"deleted": true
592+
"id": "card_JXPULjlKqC5j0i",
593+
"entity": "card",
594+
"name": "Gaurav",
595+
"last4": "4366",
596+
"network": "Visa",
597+
"type": "credit",
598+
"issuer": "UTIB",
599+
"international": false,
600+
"emi": true,
601+
"sub_type": "consumer",
602+
"token_iin": null
604603
}
605604
```
606605
-------------------------------------------------------------------------------------------------------

documents/customer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Razorpay::Customer.create({
2828
| name* | string | Name of the customer |
2929
| email | string | Email of the customer |
3030
| contact | string | Contact number of the customer |
31+
| 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`|
32+
| gstin | string | Customer's GST number, if available. For example, `29XAbbA4369J1PA` |
3133
| notes | object | A key-value pair |
3234

3335
**Response:**

documents/emandate.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Razorpay::Customer.create({
1212
"contact": 9123456780,
1313
"email": "gaurav.kumar@example.com",
1414
"fail_existing": 0,
15-
"gstin": "29XAbbA4369J1PA",
1615
"notes": {
1716
"notes_key_1": "Tea, Earl Grey, Hot",
1817
"notes_key_2": "Tea, Earl Grey… decaf."
@@ -28,6 +27,7 @@ Razorpay::Customer.create({
2827
| email | string | Email of the customer |
2928
| contact | string | Contact number of the customer |
3029
| notes | object | A key-value pair |
30+
| 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`|
3131

3232
**Response:**
3333
```json
@@ -50,9 +50,10 @@ Razorpay::Customer.create({
5050
### Create order
5151

5252
```rb
53-
Razorpay::Customer.create({
53+
Razorpay::Order.create({
5454
"amount": 0,
5555
"currency": "INR",
56+
"payment_capture": true,
5657
"method": "emandate",
5758
"customer_id": "cust_1Aa00000000001",
5859
"receipt": "Receipt No. 1",
@@ -70,7 +71,7 @@ Razorpay::Customer.create({
7071
},
7172
"bank_account": {
7273
"beneficiary_name": "Gaurav Kumar",
73-
"account_number": 1121431121541121,
74+
"account_number": "1121431121541121",
7475
"account_type": "savings",
7576
"ifsc_code": "HDFC0000001"
7677
}
@@ -86,12 +87,14 @@ Razorpay::Customer.create({
8687
| currency* | string | Currency of the order. Currently only `INR` is supported. |
8788
| method* | string | The authorization method. In this case the value will be `emandate` |
8889
| receipt | string | Your system order reference id. |
90+
| customer_id* | string | The `customer_id` for the customer you want to charge.|
8991
| 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. |
90-
| notes | object | A key-value pair |
91-
| token | object | A key-value pair |
92+
| notes | object | A key-value pair |
93+
| token | object | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|
9294

9395
**Response:**
9496
Create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#112-create-an-order)
97+
9598
-------------------------------------------------------------------------------------------------------
9699

97100
### Create an Authorization Payment
@@ -142,16 +145,20 @@ Razorpay::SubscriptionRegistration.create(para_attr)
142145

143146
| Name | Type | Description |
144147
|-----------------|---------|------------------------------------------------------------------------------|
145-
| customer | object | Details of the customer to whom the registration link will be sent. |
148+
| 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 |
146149
| type* | string | In this case, the value is `link`. |
147150
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
148151
| amount* | integer | The payment amount in the smallest currency sub-unit. |
149152
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
150-
| subscription_registration | object | Details of the authorization payment. |
151-
| notes | object | A key-value pair |
153+
| 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 |
154+
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : 1) |
155+
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
156+
| receipt | string | Your system order reference id. |
157+
| notes | object | A key-value pair |
152158

153159
**Response:**
154160
Create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#121-create-a-registration-link)
161+
155162
-------------------------------------------------------------------------------------------------------
156163

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

162169
medium = "email"
163170

164-
Razorpay::Invoice.notifyBy(invoiceId, medium)
171+
Razorpay::Invoice.notify_by(invoiceId, medium)
165172
```
166173

167174
**Parameters:**
@@ -313,7 +320,7 @@ Razorpay::Payment.fetch(paymentId)
313320
```rb
314321
customerId = "cust_1Aa00000000004"
315322

316-
Razorpay::Customer.fetchTokens(customerId)
323+
Razorpay::Customer.fetch(customerId).fetchTokens
317324
```
318325

319326
**Parameters:**
@@ -367,7 +374,7 @@ customerId = "cust_1Aa00000000004"
367374

368375
tokenId = "token_Hxe0skTXLeg9pF"
369376

370-
Razorpay::fetch(customerId).deleteToken(tokenId)
377+
Razorpay::Customer.fetch(customerId).deleteToken(tokenId)
371378
```
372379

373380
**Parameters:**
@@ -409,6 +416,7 @@ Razorpay::Order.create(para_attr)
409416
| currency* | string | Currency of the order. Currently only `INR` is supported. |
410417
| receipt | string | Your system order reference id. |
411418
| notes | object | A key-value pair |
419+
| 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. |
412420

413421
**Response:**
414422
```json
@@ -450,7 +458,7 @@ para_attr = {
450458
"note_key 2": "Tea. Earl Gray. Hot."
451459
}
452460
}
453-
Razorpay::Payment.createRecurringPayment(para_attr)
461+
Razorpay::Payment.create_recurring_payment(para_attr)
454462
```
455463

456464
**Parameters:**

0 commit comments

Comments
 (0)