Skip to content

Commit cc81181

Browse files
authored
Merge pull request #11 from razorpay/sdk_update
Updated PHP SDK
2 parents 24b68c0 + 190793e commit cc81181

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+9296
-10903
lines changed

razorpay-payment-buttons.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Razorpay Payment Button for Elementor
44
* Plugin URI: https://github.com/razorpay/payment-button-elementor-plugin
55
* Description: Razorpay Payment Button for Elementor
6-
* Version: 1.2.1
6+
* Version: 1.2.2
77
* Author: Razorpay
88
* Author URI: https://razorpay.com
99
*/

razorpay-sdk/CHANGELOG.md

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Change Log
2+
3+
Changelog for Razorpay-PHP SDK. Follows [keepachangelog.com](https://keepachangelog.com/en/1.0.0/) for formatting.
4+
5+
## Unreleased
6+
7+
## [2.8.1] - 2021-11-08
8+
9+
### Added
10+
11+
- Added Item Api
12+
- Added Unit Tests
13+
14+
## [2.8.0][2.8.0] - 2021-10-07
15+
16+
### Added
17+
- QR code end point API [[#235](https://github.com/razorpay/razorpay-php/pull/235)]
18+
- Update, cancel, create subscription link,fetch details of a Pending Update,cancel, pause and resume subscription API[[#236](https://github.com/razorpay/razorpay-php/pull/236)]
19+
- Smart Collect(Virtual Account) TPV API's [[#238](https://github.com/razorpay/razorpay-php/pull/238)]
20+
- Add/Delete TPV Bank Account [[#239](https://github.com/razorpay/razorpay-php/pull/239)]
21+
- Card end point api [[#240](https://github.com/razorpay/razorpay-php/pull/240)]
22+
- Route end point api [[#241](https://github.com/razorpay/razorpay-php/pull/241)]
23+
- Register emandate and charge first payment together [[#245](https://github.com/razorpay/razorpay-php/pull/245)]
24+
- PaperNACH/Register NACH and charge first payment together [[#246](https://github.com/razorpay/razorpay-php/pull/246)]
25+
- Added payment and Settlements methods [[#247](https://github.com/razorpay/razorpay-php/pull/247)]
26+
- Added edit and notify API's for payment links [[#248](https://github.com/razorpay/razorpay-php/pull/248)]
27+
- Added fetch, fetch multiple refund,edit and notify API's for refunds [[#250](https://github.com/razorpay/razorpay-php/pull/250)]
28+
- Added edit order API [[#251](https://github.com/razorpay/razorpay-php/pull/251)]
29+
- Fund API's end point [[#252](https://github.com/razorpay/razorpay-php/pull/252)]
30+
- UPI [[#253](https://github.com/razorpay/razorpay-php/pull/253)]
31+
- Added payment link paymentverification [[#255](https://github.com/razorpay/razorpay-php/pull/255)]
32+
- Update readme file [[#254](https://github.com/razorpay/razorpay-php/pull/254)]
33+
34+
## [2.7.1][2.7.1] - 2021-09-16
35+
36+
### Added
37+
38+
- Added Payment Link end point API [[#233](https://github.com/razorpay/razorpay-php/pull/233)]
39+
40+
## [2.7.0][2.7.0] - 2021-05-07
41+
42+
### Added
43+
44+
- Adds support for payment page enity API [[#224](https://github.com/razorpay/razorpay-php/pull/224)]
45+
46+
## [2.6.1][2.6.1] - 2021-04-30
47+
48+
### Changed
49+
50+
- Upgrades [requests](https://github.com/rmccue/Requests/) to v1.8. [[#221](https://github.com/razorpay/razorpay-php/pull/221)]
51+
52+
## [2.6.0][2.6.0] - 2021-04-05
53+
54+
### Added
55+
56+
- Adds support for webhook enity API [[#212](https://github.com/razorpay/razorpay-php/pull/212)]
57+
58+
## [2.4.0-beta][2.4.0-beta] - 2018-11-28
59+
60+
### Changed
61+
62+
- Upgrades [requests](https://github.com/rmccue/Requests/) to v1.7. [[#89](https://github.com/razorpay/razorpay-php/pull/89)]
63+
- Enforces TLS1.1+ for all requests. Workaround for a bug in RHEL 6. [[#76](https://github.com/razorpay/razorpay-php/pull/76)]
64+
65+
## [2.3.0][2.3.0] - 2018-09-15
66+
67+
### Added
68+
69+
- Add parameters to Subscription Cancel API
70+
- Support for fetching Settlements
71+
72+
## [2.2.1][2.2.1] - 2018-05-28
73+
74+
### Added
75+
76+
- Support for fetching all customer entities
77+
78+
## [2.2.0][2.2.0] - 2017-10-23
79+
80+
### Added
81+
82+
- Support for VirtualAccount entity
83+
- Support for Subscriptions
84+
85+
## [2.1.0][2.1.0] - 2017-10-10
86+
87+
### Added
88+
89+
- Support for new actions(cancel, notifyBy, edit, issue, delete) on invoices
90+
- Removes PHP 5.3 from list of versions to test build against
91+
92+
## [2.0.2][2.0.2] - 2017-08-03
93+
94+
### Added
95+
96+
- Support for creating and fetching Transfers
97+
- Support for creating Reversals on transfers
98+
99+
## [2.0.1][2.0.1] - 2017-07-31
100+
101+
### Fixed
102+
103+
- Webhook signature verification
104+
- Conditional require of Request class
105+
106+
## [2.0.0][2.0.0] - 2017-03-07
107+
108+
### Added
109+
110+
- Support for custom Application header
111+
- Support for card entity
112+
- Support for Webhook and Order Signature verification
113+
- Support for direct refund creation via Razorpay\Api\Refund::create()
114+
- Support for Utility functions via Razorpay\Api\Utility::verifyPaymentSignature and Razorpay\Api\Utility::verifyWebhookSignature
115+
- Support for case insensitive error codes
116+
- Support for 2xx HTTP status codes
117+
118+
### Changed
119+
120+
- Razorpay\Api\Payment::refunds() now returns a Razorpay\Api\Collection object instead of Razorpay\Api\Refund object
121+
- Razorpay\Api\Api::$baseUrl, Razorpay\Api\Api::$key and Razorpay\Api\Api::$secret are now `protected` instead of `public`
122+
123+
## [1.2.9][1.2.9] - 2017-01-03
124+
125+
### Added
126+
127+
- Support for creating and fetching Invoices
128+
129+
## [1.2.8][1.2.8] - 2016-10-12
130+
131+
### Added
132+
133+
- Support for Customer and Token entities
134+
135+
## [1.2.7][1.2.7] - 2016-09-21
136+
137+
### Added
138+
139+
- Increases the request timeout to 30 seconds for all requests.
140+
141+
## [1.2.6][1.2.6] - 2016-03-28
142+
143+
### Added
144+
145+
- Adds better tracing when client is not able to recognize server response.
146+
147+
## [1.2.5][1.2.5] - 2016-03-28
148+
149+
### Added
150+
151+
- Add support for overriding request headers via setHeader
152+
153+
## [1.2.3][1.2.3] - 2016-02-24
154+
155+
### Added
156+
157+
- Add support for Orders
158+
159+
## [1.2.2][1.2.2] - 2016-02-17
160+
161+
### Changed
162+
163+
- Razorpay\Api\Request::checkErrors is now `protected` instead of `private`
164+
- The final build is now leaner and includes just requests, instead of entire vendor directory
165+
166+
## [1.2.1][1.2.1] - 2016-01-21
167+
168+
### Added
169+
170+
- Add version.txt in release with current git tag
171+
- This changelog file
172+
- `Api\Request::getHeaders()` method
173+
174+
## [1.2.0][1.2.0] - 2015-10-23
175+
176+
### Added
177+
178+
- Add version string to User Agent
179+
180+
### Changed
181+
182+
- New release process that pushes pre-packaged zip files to GitHub
183+
184+
## 1.0.0 - 2015-01-18
185+
186+
### Added
187+
188+
- Initial Release
189+
190+
[unreleased]: https://github.com/razorpay/razorpay-php/compare/2.5.0...HEAD
191+
[1.2.1]: https://github.com/razorpay/razorpay-php/compare/1.2.0...1.2.1
192+
[1.2.0]: https://github.com/razorpay/razorpay-php/compare/1.1.0...1.2.0
193+
[1.2.2]: https://github.com/razorpay/razorpay-php/compare/1.2.1...1.2.2
194+
[1.2.3]: https://github.com/razorpay/razorpay-php/compare/1.2.2...1.2.3
195+
[1.2.4]: https://github.com/razorpay/razorpay-php/compare/1.2.3...1.2.4
196+
[1.2.5]: https://github.com/razorpay/razorpay-php/compare/1.2.4...1.2.5
197+
[1.2.6]: https://github.com/razorpay/razorpay-php/compare/1.2.5...1.2.6
198+
[1.2.7]: https://github.com/razorpay/razorpay-php/compare/1.2.6...1.2.7
199+
[1.2.8]: https://github.com/razorpay/razorpay-php/compare/1.2.7...1.2.8
200+
[1.2.9]: https://github.com/razorpay/razorpay-php/compare/1.2.8...1.2.9
201+
[2.0.0]: https://github.com/razorpay/razorpay-php/compare/1.2.9...2.0.0
202+
[2.0.1]: https://github.com/razorpay/razorpay-php/compare/2.0.0...2.0.1
203+
[2.0.2]: https://github.com/razorpay/razorpay-php/compare/2.0.1...2.0.2
204+
[2.1.0]: https://github.com/razorpay/razorpay-php/compare/2.0.2...2.1.0
205+
[2.2.0]: https://github.com/razorpay/razorpay-php/compare/2.1.0...2.2.0
206+
[2.2.1]: https://github.com/razorpay/razorpay-php/compare/2.2.0...2.2.1
207+
[2.3.0]: https://github.com/razorpay/razorpay-php/compare/2.2.1...2.3.0
208+
[2.4.0-beta]: https://github.com/razorpay/razorpay-php/compare/2.3.0...2.4.0-beta
209+
[2.5.0]: https://github.com/razorpay/razorpay-php/compare/2.4.0-beta...2.5.0
210+
[2.8.0]: https://github.com/razorpay/razorpay-php/compare/2.7.1...2.8.0

razorpay-sdk/README.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# razorpay-php
2+
3+
[![Build Status](https://travis-ci.org/razorpay/razorpay-php.svg?branch=master)](https://travis-ci.org/razorpay/razorpay-php) [![Latest Stable Version](https://poser.pugx.org/razorpay/razorpay/v/stable.svg)](https://packagist.org/packages/razorpay/razorpay) [![License](https://poser.pugx.org/razorpay/razorpay/license.svg)](https://packagist.org/packages/razorpay/razorpay)
4+
5+
Official PHP library for [Razorpay API](https://docs.razorpay.com/docs/payments).
6+
7+
Read up here for getting started and understanding the payment flow with Razorpay: <https://docs.razorpay.com/docs/getting-started>
8+
9+
### Prerequisites
10+
- A minimum of PHP 5.3 is required
11+
12+
13+
## Installation
14+
15+
- If your project using composer, run the below command
16+
17+
```
18+
composer require razorpay/razorpay:2.*
19+
```
20+
21+
- If you are not using composer, download the latest release from [the releases section](https://github.com/razorpay/razorpay-php/releases).
22+
**You should download the `razorpay-php.zip` file**.
23+
After that, include `Razorpay.php` in your application and you can use the API as usual.
24+
25+
##Note:
26+
This PHP library follows the following practices:
27+
28+
- Namespaced under `Razorpay\Api`
29+
- API throws exceptions instead of returning errors
30+
- Options are passed as an array instead of multiple arguments wherever possible
31+
- All requests and responses are communicated over JSON
32+
33+
## Documentation
34+
35+
Documentation of Razorpay's API and their usage is available at <https://docs.razorpay.com>
36+
37+
## Basic Usage
38+
39+
Instantiate the razorpay php instance with `key_id` & `key_secret`. You can obtain the keys from the dashboard app ([https://dashboard.razorpay.com/#/app/keys](https://dashboard.razorpay.com/#/app/keys))
40+
41+
```php
42+
use Razorpay\Api\Api;
43+
44+
$api = new Api($api_key, $api_secret);
45+
```
46+
47+
The resources can be accessed via the `$api` object. All the methods invocations follows the following pattern
48+
49+
```php
50+
// $api->class->function() to access the API
51+
//Example
52+
$api->payment->fetch($paymentId);
53+
```
54+
## Supported Resources
55+
- [Customer](documents/customer.md)
56+
- [Token](documents/token.md)
57+
- [Order](documents/order.md)
58+
- [Payments](documents/payment.md)
59+
- [Settlements](documents/settlement.md)
60+
- [Refunds](documents/refund.md)
61+
- [Invoice](documents/invoice.md)
62+
- [Item](documents/item.md)
63+
- [Subscriptions](documents/subscription.md)
64+
- [Add-on](documents/addon.md)
65+
- [Payment Links](documents/paymentLink.md)
66+
- [Smart Collect](documents/virtualaccount.md)
67+
- [Route](documents/transfer.md)
68+
- [QR Code](documents/qrcode.md)
69+
- [Emandate](documents/emandate.md)
70+
- [Cards](documents/card.md)
71+
- [Paper NACH](documents/papernach.md)
72+
- [UPI](documents/upi.md)
73+
- [Register Emandate and Charge First Payment Together](documents/registeremandate.md)
74+
- [Register NACH and Charge First Payment Together](documents/registernach.md)
75+
- [Payment Verification](documents/paymentVerfication.md)
76+
77+
## Development
78+
79+
See the [doc.md](doc.md) file for getting started with development.
80+
81+
## Release
82+
83+
Steps to follow for a release:
84+
85+
0. Merge the branch with the new code to master.
86+
1. Bump the Version in `src/Api.php`.
87+
2. Rename Unreleased to the new tag in `CHANGELOG.md`
88+
3. Add a new empty "Unreleased" section at the top of `CHANGELOG.md`
89+
4. Fix links at bottom in `CHANGELOG.md`
90+
5. Commit
91+
6. Tag the release and push to GitHub
92+
7. A release should automatically be created once the travis build passes. Edit the release to add some description.
93+
94+
## License
95+
96+
The Razorpay PHP SDK is released under the MIT License. See [LICENSE](LICENSE) file for more details.

razorpay-sdk/Razorpay.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Include Requests only if not already defined
44
if (class_exists('Requests') === false)
55
{
6-
require_once __DIR__.'/libs/Requests-1.7.0/library/Requests.php';
6+
require_once __DIR__.'/libs/Requests-1.8.0/library/Requests.php';
77
}
88

99
try

razorpay-sdk/composer.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "razorpay/razorpay",
3+
"description": "Razorpay PHP Client Library",
4+
"keywords": ["razorpay", "api", "php", "client"],
5+
"authors": [
6+
{
7+
"name": "Abhay Rana",
8+
"email": "[email protected]",
9+
"homepage": "https://captnemo.in",
10+
"role": "Developer"
11+
},
12+
{
13+
"name": "Shashank Kumar",
14+
"email": "[email protected]",
15+
"role": "Developer"
16+
}
17+
],
18+
"support": {
19+
"email": "[email protected]",
20+
"issues": "https://github.com/Razorpay/razorpay-php/issues",
21+
"source": "https://github.com/Razorpay/razorpay-php"
22+
},
23+
"homepage": "https://docs.razorpay.com",
24+
"license": "MIT",
25+
"require": {
26+
"php": ">=5.3.0",
27+
"rmccue/requests": "v1.8.0",
28+
"ext-json": "*"
29+
},
30+
"require-dev": {
31+
"raveren/kint": "1.*",
32+
"phpunit/phpunit": "~4.8|~5.0"
33+
},
34+
"autoload": {
35+
"psr-4": {
36+
"Razorpay\\Api\\": "src/",
37+
"Razorpay\\Tests\\": "tests/"
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)