Skip to content

Commit

Permalink
Merge branch 'master' of github.com:razorpay/razorpay-opencart into z…
Browse files Browse the repository at this point in the history
…ones
  • Loading branch information
mayankamencherla committed Feb 27, 2017
2 parents 4d66257 + 8677851 commit 585bc82
Show file tree
Hide file tree
Showing 111 changed files with 13,613 additions and 0 deletions.
Binary file added catalog/controller/.DS_Store
Binary file not shown.
41 changes: 41 additions & 0 deletions catalog/controller/razorpay-sdk/Razorpay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

// Include Requests
require_once __DIR__.'/libs/Requests-1.6.1/library/Requests.php';

// Register requests autoloader
Requests::register_autoloader();

spl_autoload_register(function ($class)
{
// project-specific namespace prefix
$prefix = 'Razorpay\Api';

// base directory for the namespace prefix
$base_dir = __DIR__ . '/src/';

// does the class use the namespace prefix?
$len = strlen($prefix);

if (strncmp($prefix, $class, $len) !== 0)
{
// no, move to the next registered autoloader
return;
}

// get the relative class name
$relative_class = substr($class, $len);

//
// replace the namespace prefix with the base directory,
// replace namespace separators with directory separators
// in the relative class name, append with .php
//
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

// if the file exists, require it
if (file_exists($file))
{
require $file;
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src_dir: library
coverage_clover: tests/clover.xml
json_path: tests/coveralls.json
service_name: travis-ci
19 changes: 19 additions & 0 deletions catalog/controller/razorpay-sdk/libs/Requests-1.6.1/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: php
before_script:
- phpenv local 5.4
- composer install --dev --no-interaction
- phpenv local --unset
- cd tests
script:
- phpunit --coverage-clover clover.xml
after_script:
- cd ..
- phpenv local 5.4
- php vendor/bin/coveralls -v
- phpenv local --unset
php:
- 5.2
- 5.3
- 5.4
- 5.5
- hhvm
56 changes: 56 additions & 0 deletions catalog/controller/razorpay-sdk/libs/Requests-1.6.1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Changelog
=========

1.6.1
-----
- [Fix compatibility with HHVM][#121] - Using HHVM with Requests would
previously cause either exceptions with SSL or segfaults with the cURL
handler. Props Ozh for his work here.

[#121]: https://github.com/rmccue/Requests/issues/121

1.6.0
-----
- [Add multiple request support][#23] - Send multiple HTTP requests with both
fsockopen and cURL, transparently falling back to synchronous when
not supported.

- [Add proxy support][#70] - HTTP proxies are now natively supported via a
[high-level API][docs/proxy]. Major props to Ozh for his fantastic work
on this.

- [Verify host name for SSL requests][#63] - Requests is now the first and only
standalone HTTP library to fully verify SSL hostnames even with socket
connections. Thanks to Michael Adams, Dion Hulse, Jon Cave, and Pádraic Brady
for reviewing the crucial code behind this.

- [Add cookie support][#64] - Adds built-in support for cookies (built entirely
as a high-level API)

- [Add sessions][#62] - To compliment cookies, [sessions][docs/usage-advanced]
can be created with a base URL and default options, plus a shared cookie jar.

- Add [PUT][#1], [DELETE][#3], and [PATCH][#2] request support

- [Add Composer support][#6] - You can now install Requests via the
`rmccue/requests` package on Composer

[docs/proxy]: http://requests.ryanmccue.info/docs/proxy.html
[docs/usage-advanced]: http://requests.ryanmccue.info/docs/usage-advanced.html

[#1]: https://github.com/rmccue/Requests/issues/1
[#2]: https://github.com/rmccue/Requests/issues/2
[#3]: https://github.com/rmccue/Requests/issues/3
[#6]: https://github.com/rmccue/Requests/issues/6
[#9]: https://github.com/rmccue/Requests/issues/9
[#23]: https://github.com/rmccue/Requests/issues/23
[#62]: https://github.com/rmccue/Requests/issues/62
[#63]: https://github.com/rmccue/Requests/issues/63
[#64]: https://github.com/rmccue/Requests/issues/64
[#70]: https://github.com/rmccue/Requests/issues/70

[View all changes][https://github.com/rmccue/Requests/compare/v1.5.0...v1.6.0]

1.5.0
-----
Initial release!
49 changes: 49 additions & 0 deletions catalog/controller/razorpay-sdk/libs/Requests-1.6.1/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Requests
========

Copyright (c) 2010-2012 Ryan McCue and contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


ComplexPie IRI Parser
=====================

Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the SimplePie Team nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
146 changes: 146 additions & 0 deletions catalog/controller/razorpay-sdk/libs/Requests-1.6.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
Requests for PHP
================

Requests is a HTTP library written in PHP, for human beings. It is roughly
based on the API from the excellent [Requests Python
library](http://python-requests.org/). Requests is [ISC
Licensed](https://github.com/rmccue/Requests/blob/master/LICENSE) (similar to
the new BSD license) and has no dependencies, except for PHP 5.2+.

Despite PHP's use as a language for the web, its tools for sending HTTP requests
are severely lacking. cURL has an
[interesting API](http://php.net/manual/en/function.curl-setopt.php), to say the
least, and you can't always rely on it being available. Sockets provide only low
level access, and require you to build most of the HTTP response parsing
yourself.

We all have better things to do. That's why Requests was born.

```php
$headers = array('Accept' => 'application/json');
$options = array('auth' => array('user', 'pass'));
$request = Requests::get('https://api.github.com/gists', $headers, $options);

var_dump($request->status_code);
// int(200)

var_dump($request->headers['content-type']);
// string(31) "application/json; charset=utf-8"

var_dump($request->body);
// string(26891) "[...]"
```

Requests allows you to send **HEAD**, **GET**, **POST**, **PUT**, **DELETE**,
and **PATCH** HTTP requests. You can add headers, form data, multipart files,
and parameters with simple arrays, and access the response data in the same way.
Requests uses cURL and fsockopen, depending on what your system has available,
but abstracts all the nasty stuff out of your way, providing a consistent API.


Features
--------

- International Domains and URLs
- Browser-style SSL Verification
- Basic/Digest Authentication
- Automatic Decompression
- Connection Timeouts


Installation
------------

### Install with Composer
If you're using [Composer](https://github.com/composer/composer) to manage
dependencies, you can add Requests with it.

{
"require": {
"rmccue/requests": ">=1.0"
},
"autoload": {
"psr-0": {"Requests": "library/"}
}
}

### Install source from GitHub
To install the source code:

$ git clone git://github.com/rmccue/Requests.git

And include it in your scripts:

require_once '/path/to/Requests/library/Requests.php';

You'll probably also want to register an autoloader:

Requests::register_autoloader();


### Install source from zip/tarball
Alternatively, you can fetch a [tarball][] or [zipball][]:

$ curl -L https://github.com/rmccue/Requests/tarball/master | tar xzv
(or)
$ wget https://github.com/rmccue/Requests/tarball/master -O - | tar xzv

[tarball]: https://github.com/rmccue/Requests/tarball/master
[zipball]: https://github.com/rmccue/Requests/zipball/master


### Using a Class Loader
If you're using a class loader (e.g., [Symfony Class Loader][]) for
[PSR-0][]-style class loading:

$loader->registerPrefix('Requests', 'path/to/vendor/Requests/library');

[Symfony Class Loader]: https://github.com/symfony/ClassLoader
[PSR-0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md


Documentation
-------------
The best place to start is our [prose-based documentation][], which will guide
you through using Requests.

After that, take a look at [the documentation for
`Requests::request()`][request_method], where all the parameters are fully
documented.

Requests is [100% documented with PHPDoc](http://requests.ryanmccue.info/api/).
If you find any problems with it, [create a new
issue](https://github.com/rmccue/Requests/issues/new)!

[prose-based documentation]: https://github.com/rmccue/Requests/blob/master/docs/README.md
[request_method]: http://requests.ryanmccue.info/api/class-Requests.html#_request

Testing
-------
[![Build Status](https://secure.travis-ci.org/rmccue/Requests.png?branch=master)](http://travis-ci.org/rmccue/Requests)
[![Coverage Status](https://coveralls.io/repos/rmccue/Requests/badge.png?branch=master)][coveralls]

Requests strives to have 100% code-coverage of the library with an extensive
set of tests. We're not quite there yet, but [we're getting close][coveralls].

[coveralls]: https://coveralls.io/r/rmccue/Requests?branch=master

To run the test suite, simply:

$ cd tests
$ phpunit

If you'd like to run a single set of tests, specify just the name:

$ phpunit Transport/cURL

Contribute
----------

1. Check for open issues or open a new issue for a feature request or a bug
2. Fork [the repository][] on Github to start making your changes to the
`master` branch (or branch off of it)
3. Write a test which shows that the bug was fixed or that the feature works as expected
4. Send a pull request and bug me until I merge it

[the repository]: https://github.com/rmccue/Requests
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* PEAR package builder
*
* Inspired by Twig's create_pear_package.php.
* @link https://raw.github.com/fabpot/Twig/master/bin/create_pear_package.php
* @author Twig Team
* @license BSD license
*/

if (!isset($argv[1]) || $argv[1] === '-h' || $argv[1] === '--help') {
echo 'usage: php ' . $argv[0] . ' <version> <stability>' . PHP_EOL;
echo PHP_EOL;
echo ' version:' . PHP_EOL;
echo ' Version of the package, in the form of major.minor.bug' . PHP_EOL;
echo PHP_EOL;
echo ' stability:' . PHP_EOL;
echo ' One of alpha, beta, stable' . PHP_EOL;
die();
}

if (!isset($argv[2])) {
die('You must provide the stability (alpha, beta, or stable)');
}

$context = array(
'date' => gmdate('Y-m-d'),
'time' => gmdate('H:m:00'),
'version' => $argv[1],
'api_version' => $argv[1],
'stability' => $argv[2],
'api_stability' => $argv[2],
);

$context['files'] = '';
$path = realpath(dirname(__FILE__).'/../library/Requests');
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
if (preg_match('/\.php$/', $file)) {
$name = str_replace($path . DIRECTORY_SEPARATOR, '', $file);
$name = str_replace(DIRECTORY_SEPARATOR, '/', $name);
$context['files'][] = "\t\t\t\t\t" . '<file install-as="Requests/' . $name . '" name="' . $name . '" role="php" />';
}
}

$context['files'] = implode("\n", $context['files']);

$template = file_get_contents(dirname(__FILE__).'/../package.xml.tpl');
$content = preg_replace_callback('/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/', 'replace_parameters', $template);
file_put_contents(dirname(__FILE__).'/../package.xml', $content);

function replace_parameters($matches) {
global $context;

return isset($context[$matches[1]]) ? $context[$matches[1]] : null;
}
Loading

0 comments on commit 585bc82

Please sign in to comment.