Skip to content

Commit

Permalink
Merge pull request #299 from razorpay/doc_correction
Browse files Browse the repository at this point in the history
customer doc corrections
  • Loading branch information
ankitdas13 committed Jun 28, 2022
2 parents c2e8a2d + 63fcf4e commit 3f2edc1
Show file tree
Hide file tree
Showing 25 changed files with 1,394 additions and 622 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog for Razorpay-PHP SDK. Follows [keepachangelog.com](https://keepachange

## Unreleased

## [2.8.4] - 2022-06-28

- New APIs for Third party validation (createUpi, validateVpa, fetchPaymentMethods)
- Update documentation

## [2.8.3] - 2022-04-29

- PHP v8.1 is officially supported
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The resources can be accessed via the `$api` object. All the methods invocations
- [Payments](documents/payment.md)
- [Settlements](documents/settlement.md)
- [Refunds](documents/refund.md)
- [Fund](documents/fund.md)
- [Invoice](documents/invoice.md)
- [Plan](documents/plan.md)
- [Item](documents/item.md)
Expand Down
25 changes: 10 additions & 15 deletions documents/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ $api->subscription->fetch($subscriptionId)->createAddon(array('item' => array('n
| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
| items* | array | 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. |
| items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-an-add-on) |
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |

**Response:**
```json
Expand Down Expand Up @@ -56,10 +56,10 @@ $api->addon->all($options);

| Name | Type | Description |
|-------|-----------|--------------------------------------------------|
| 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) |
| from | timestamp | timestamp after which the addons were created |
| to | timestamp | timestamp before which the addons were created |
| count | integer | number of addons to fetch (default: 10) |
| skip | integer | number of addons to be skipped (default: 0) |

**Response:**
```json
Expand Down Expand Up @@ -110,6 +110,7 @@ $api->addon->fetch($addonId);
| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| addonId* | string | addon id to be fetched |

**Response:**
```json
{
Expand Down Expand Up @@ -146,19 +147,13 @@ $api->addon->fetch($addonId);

```php
$api->addon->fetch($addonId)->delete();

**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| addonId* | string | addon id to be fetched
```

**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| addonId* | string | addon id to be deleted |
| Name | Type | Description |
|-----------------|---------|--------------|
| addonId* | string | addon id to be deleted |

**Response:**
```json
Expand Down
35 changes: 21 additions & 14 deletions documents/emandate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Create customer
```php
$api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com','contact'=>'9123456780','notes'=> array('notes_key_1'=> 'Tea, Earl Grey, Hot','notes_key_2'=> 'Tea, Earl Grey… decaf'));
$api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com','contact'=>'9123456780', 'fail_existing'=> '0', 'notes'=> array('notes_key_1'=> 'Tea, Earl Grey, Hot','notes_key_2'=> 'Tea, Earl Grey… decaf')));
```

**Parameters:**
Expand Down Expand Up @@ -36,22 +36,25 @@ $api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@raz
### Create order

```php
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'emandate','customer_id' => 'cust_1Aa00000000001','receipt' => 'Receipt No. 1','notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage'),'token' => array('auth_type' => 'netbanking','max_amount' => 9999900,'expire_at' => 4102444799,'notes' => array('notes_key_1' => 'Tea, Earl Grey, Hot','notes_key_2' => 'Tea, Earl Grey… decaf.'),'bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '1121431121541121','account_type' => 'savings','ifsc_code' => 'HDFC0000001'))));
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'emandate','payment_capture' => true, 'customer_id' => 'cust_JdumbHq5F3kKu6','receipt' => 'Receipt No. #19','notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage'),'token' => array('auth_type' => 'netbanking','max_amount' => 9999900,'expire_at' => 4102444799,'notes' => array('notes_key_1' => 'Tea, Earl Grey, Hot','notes_key_2' => 'Tea, Earl Grey… decaf.'),'bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '1121431121541121','account_type' => 'savings','ifsc_code' => 'HDFC0000001'))));
```

**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| amount* | integer | Amount of the order to be paid |
| 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. |
| notes | array | A key-value pair |
| token | array | A key-value pair |
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
| currency* | string | The currency of the payment (defaults to INR) |
| customerId* | string | The id of the customer to be fetched |
| method* | string | Payment method used to make the registration transaction. Possible value is `emandate`. |
| 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. |
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|
| notes | object | A key-value pair |

**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 All @@ -63,23 +66,27 @@ Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/emandat
### Create registration link

```php
$api->subscription->createSubscriptionRegistration(array('customer'=>array('name'=>'Gaurav Kumar','email'=>'gaurav.kumar@example.com','contact'=>'9123456780'),'type'=>'link','amount'=>100,'currency'=>'INR','description'=>'Registration Link for Gaurav Kumar','subscription_registration'=>array('method'=>'emandate','max_amount'=>'500','expire_at'=>'1634215992'),'receipt'=>'Receipt No. 5','email_notify'=>1,'sms_notify'=>1,'expire_by'=>1634215992,'notes' => array('note_key 1' => 'Beam me up Scotty','note_key 2' => 'Tea. Earl Gray. Hot.')));
$api->subscription->createSubscriptionRegistration(array('customer'=>array('name'=>'Gaurav Kumar','email'=>'gaurav.kumar@example.com','contact'=>'9123456780'),'type'=>'link','amount'=>0,'currency'=>'INR','description'=>'Registration Link for Gaurav Kumar','subscription_registration'=>array('method'=>'emandate', 'auth_type'=>'netbanking', 'max_amount'=>'500', 'bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '1121431121541121','account_type' => 'savings','ifsc_code' => 'HDFC0001233'), 'expire_at'=>'1634215992'),'receipt'=>'Receipt No. 5','email_notify'=>1,'sms_notify'=>1,'expire_by'=>1634215992,'notes' => array('note_key 1' => 'Beam me up Scotty','note_key 2' => 'Tea. Earl Gray. Hot.')));
```

**Parameters:**

| Name | Type | Description |
|-----------------|---------|------------------------------------------------------------------------------|
| customer | array | Details of the customer to whom the registration link will be sent. |
| customer* | array | 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 | array | Details of the authorization payment. |
| notes | array | A key-value pair |
| subscription_registration | array | 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 | array | 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)
Create registration link response please click [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link)

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

### Send/Resend notifications
Expand Down Expand Up @@ -302,7 +309,7 @@ $api->customer->fetch($customerId)->tokens()->delete($tokenId);
### Create an order to charge the customer

```php
$api->order->create(array('receipt' => '123', 'amount' => 100, 'currency' => 'INR', 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
$api->order->create(array('amount' => 1000,'currency' => 'INR','payment_capture' => true,'receipt' => 'Receipt No. 1','notes'=> array('notes_key_1' => 'Tea, Earl Grey, Hot', 'notes_key_2' => 'Tea, Earl Grey… decaf.')));
```

**Parameters:**
Expand Down
60 changes: 35 additions & 25 deletions documents/fund.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Create a fund account
```php
$api->fundAccount->create(array('customer_id'=>$customerId,'account_type'=>'bank_account','bank_account'=>array('name'=>'Gaurav Kumar', 'account_number'=>'11214311215411', 'ifsc'=>'HDFC0000053')))
$api->fundAccount->create(array('customer_id'=>$customerId,'account_type'=>'bank_account','bank_account'=>array('name'=>'Gaurav Kumar', 'account_number'=>'11214311215411', 'ifsc'=>'HDFC0000053')));
```

**Parameters:**
Expand All @@ -16,18 +16,20 @@ $api->fundAccount->create(array('customer_id'=>$customerId,'account_type'=>'bank
**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"
},
"active":true,
"created_at":1543650891
"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"
},
"batch_id": null,
"active": true,
"created_at": 1654154246
}
```
-------------------------------------------------------------------------------------------------------
Expand All @@ -47,18 +49,26 @@ $api->fundAccount->all(array('customer_id'=>$customerIds));
**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"
},
"active":true,
"created_at":1543650891
"entity": "collection",
"count": 2,
"items": [
{
"id": "fa_JcXYtecLkhW74k",
"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"
},
"batch_id": null,
"active": true,
"created_at": 1654154163
}
]
}
```
-------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 3f2edc1

Please sign in to comment.