-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from razorpay/new_version
new version update
- Loading branch information
Showing
48 changed files
with
271 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Backwards compatibility layer for Requests. | ||
* | ||
* Allows for Composer to autoload the old PSR-0 classes via the custom autoloader. | ||
* This prevents issues with _extending final classes_ (which was the previous solution). | ||
* | ||
* Please see the Changelog for the 2.0.0 release for upgrade notes. | ||
* | ||
* @package Requests | ||
* | ||
* @deprecated 2.0.0 Use the PSR-4 class names instead. | ||
*/ | ||
define("REQUESTS_SILENCE_PSR0_DEPRECATIONS",true); | ||
|
||
if (class_exists('WpOrg\Requests\Autoload') === false) { | ||
require_once __DIR__. 'libs/Requests-2.0.0/src/Autoload.php'; | ||
} | ||
|
||
WpOrg\Requests\Autoload::register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ $api->customer->create(array('name' => 'Razorpay User', 'email' => 'customer@raz | |
|---------------|-------------|---------------------------------------------| | ||
| name* | string | Name of the customer | | ||
| email | string | Email 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`| | ||
| contact | string | Contact number of the customer | | ||
| notes | array | A key-value pair | | ||
|
||
|
@@ -311,7 +312,8 @@ $api->order->create(array('receipt' => '123', 'amount' => 100, 'currency' => 'IN | |
| 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. | | ||
| notes | array | A key-value pair | | ||
| notes | array | 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 | ||
|
@@ -353,8 +355,8 @@ $api->payment->createRecurring(array('email'=>'[email protected]','contac | |
| customer_id* | string | The `customer_id` for the customer you want to charge. | | ||
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.| | ||
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:<br>* `1` - Recurring is enabled.* `0` - Recurring is not enabled.| | ||
| description* | string | A user-entered description for the payment.| | ||
| notes* | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. | | ||
| description | string | A user-entered description for the payment.| | ||
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. | | ||
|
||
**Response:** | ||
```json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,23 @@ | |
Request #1 | ||
In this example, an invoice is created using the customer and item details. Here, the customer and item are created while creating the invoice. | ||
```php | ||
$api->order->create(array ('type' => 'invoice','description' => 'Invoice for the month of January 2020','partial_payment' => true,'customer' =>array ('name' => 'Gaurav Kumar','contact' => 9999999999,'email' => '[email protected]','billing_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in'),'shipping_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in')),'line_items' => array (array ('name' => 'Master Cloud Computing in 30 Days','description' => 'Book by Ravena Ravenclaw','amount' => 399,'currency' => 'USD','quantity' => 1)),'sms_notify' => 1,'email_notify' => 1,'currency' => 'USD','expire_by' => 1589765167)); | ||
$api->invoice->create(array ('type' => 'invoice','description' => 'Invoice for the month of January 2020','partial_payment' => true,'customer' =>array ('name' => 'Gaurav Kumar','contact' => 9999999999,'email' => '[email protected]','billing_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in'),'shipping_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in')),'line_items' => array (array ('name' => 'Master Cloud Computing in 30 Days','description' => 'Book by Ravena Ravenclaw','amount' => 399,'currency' => 'USD','quantity' => 1)),'sms_notify' => 1,'email_notify' => 1,'currency' => 'USD','expire_by' => 1589765167)); | ||
``` | ||
**Parameters:** | ||
|
||
| Name | Type | Description | | ||
|-----------------|---------|------------------------------------------------------------------------------| | ||
|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 | array | customer details in a array format | | ||
|line_items* | 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. | | ||
|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. | | ||
|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) | | ||
|
||
|
||
Request #2 | ||
In this example, an invoice is created using existing `customer_id` and `item_id` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -560,8 +560,8 @@ $api->payment->createRecurring(array('email'=>'[email protected]','contac | |
| customer_id* | string | The `customer_id` for the customer you want to charge. | | ||
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.| | ||
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:<br>* `1` - Recurring is enabled.* `0` - Recurring is not enabled.| | ||
| description* | string | A user-entered description for the payment.| | ||
| notes* | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. | | ||
| description | string | A user-entered description for the payment.| | ||
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. | | ||
|
||
**Response:** | ||
```json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.