-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gopal-mac
committed
Feb 2, 2018
0 parents
commit bab5bb0
Showing
17 changed files
with
767 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; This file is for unifying the coding style for different editors and IDEs. | ||
; More information at http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 4 | ||
indent_style = space | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 @@ | ||
preset: psr2 |
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,22 @@ | ||
# Changelog | ||
|
||
All notable changes to `gopal-g/payment` will be documented in this file. | ||
|
||
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. | ||
|
||
## NEXT - 2018-02-02 | ||
|
||
### Added | ||
- 1.0.0-alpha release of the package | ||
|
||
### Deprecated | ||
- Nothing | ||
|
||
### Fixed | ||
- Nothing | ||
|
||
### Removed | ||
- Nothing | ||
|
||
### Security | ||
- Nothing |
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,74 @@ | ||
# Contributor Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to make participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, gender identity and expression, level of experience, | ||
nationality, personal appearance, race, religion, or sexual identity and | ||
orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at `c4gopal@gmail.com`. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
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,24 @@ | ||
# Contributing | ||
|
||
Contributions are **welcome** and will be fully **credited**. | ||
|
||
We accept contributions via Pull Requests on [Github](https://github.com/gopal-g/payment). | ||
|
||
|
||
## Pull Requests | ||
|
||
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer check-style`` and fix it with ``$ composer fix-style``. | ||
|
||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests. | ||
|
||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. | ||
|
||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. | ||
|
||
- **Create feature branches** - Don't ask us to pull from your master branch. | ||
|
||
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. | ||
|
||
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. | ||
|
||
**Happy coding**! |
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,21 @@ | ||
# The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Gopal G <c4gopal@gmail.com> | ||
|
||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
> THE SOFTWARE. |
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,156 @@ | ||
# CCAvenue Payment Gateway integration for Laravel 5.x (Supports PHP 7.1) | ||
|
||
[![Latest Version on Packagist][ico-version]][link-packagist] | ||
[![Software License][ico-license]](LICENSE.md) | ||
[![Total Downloads][ico-downloads]][link-downloads] | ||
|
||
|
||
This package is built to integrate CCAvenue payment gateway into your laravel | ||
project, It is developed keeping in mind other payment gateways also but is limited to ccavenue for at the time of release. | ||
|
||
## Important | ||
|
||
The code is originially a fork of similar package by [softon/indipay](https://github.com/softon/indipay). But this package uses the latest SDK released by CCAvenue for ```php 7.1``` Since their old SDK didn't support that version. | ||
|
||
|
||
## Installation | ||
|
||
<b>Step 1:</b> Install package using composer | ||
|
||
``` bash | ||
$ composer require gopal-g/payment | ||
``` | ||
<b>Step 2:</b> Add the service provider to the ``config/app.php`` file in Laravel | ||
|
||
``` | ||
Appnings\Payment\PaymentServiceProvider::class, | ||
``` | ||
<b>Step 3:</b> Add an alias for the Facade to the ``config/app.php`` file in Laravel | ||
``` | ||
'Payment' => Appnings\Payment\Facades\Payment::class | ||
``` | ||
|
||
<b>Step 4:</b> Publish the Config, Middleware & Views by running in your terminal | ||
``` | ||
php artisan vendor:publish | ||
``` | ||
This above step creates | ||
- `` config/payment.php `` | ||
- `` app/Http/Middlewares/VerifyCsrfToken.php `` | ||
- `` resources/views/vendor/payment/ccavenue.blade.php `` | ||
|
||
<b>Step 5:</b> Modify the ``app\Http\Kernel.php`` to use the new Middleware. | ||
This is required so as to avoid CSRF verification on the Response Url from the payment gateways. | ||
<b>You may adjust the routes in the config file ``config/payment.php`` to disable CSRF on your gateways response routes.</b> | ||
``` | ||
'App\Http\Middleware\VerifyCsrfToken', | ||
``` | ||
to | ||
``` | ||
'App\Http\Middleware\VerifyCsrfMiddleware', | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
Edit the ``config/payment.php``. Set the appropriate Gateway and its parameters. Then in your code... <br> | ||
|
||
``` | ||
use Appnings\Payment\Facades\Payment; | ||
``` | ||
|
||
Initiate Purchase Request and Redirect using the default gateway:- | ||
|
||
```php | ||
/* All Required Parameters by your Gateway */ | ||
|
||
$parameters = [ | ||
|
||
'tid' => '1233221223322', | ||
|
||
'order_id' => '1232212', | ||
|
||
'amount' => '1200.00', | ||
|
||
]; | ||
|
||
$order = Payment::prepare($parameters); | ||
return Payment::process($order); | ||
``` | ||
|
||
Initiate Purchase Request and Redirect using any of the configured gateway:- | ||
```php | ||
/* All Required Parameters by your Gateway */ | ||
|
||
$parameters = [ | ||
|
||
'tid' => '1233221223322', | ||
|
||
'order_id' => '1232212', | ||
|
||
'amount' => '1200.00', | ||
|
||
]; | ||
|
||
// gateway = CCAvenue / others | ||
|
||
$order = Payment::gateway('NameOfGateway')->prepare($parameters); | ||
return Payment::process($order); | ||
``` | ||
Get the Response from the Gateway (Add the Code to the Redirect Url Set in the config file. | ||
Also add the response route to the `remove_csrf_check` config item to remove CSRF check on these routes.):- | ||
<pre><code> | ||
public function response(Request $request) | ||
|
||
{ | ||
// For default Gateway | ||
$response = Payment::response($request); | ||
|
||
// For Otherthan Default Gateway | ||
$response = Payment::gateway('NameOfGatewayUsedDuringRequest')->response($request); | ||
|
||
dd($response); | ||
|
||
} | ||
</code></pre> | ||
|
||
## Change log | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. | ||
|
||
## Testing | ||
|
||
``` bash | ||
$ composer test | ||
``` | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details. | ||
|
||
## Security | ||
|
||
If you discover any security related issues, please email `c4gopal@gmail.com` instead of using the issue tracker. | ||
|
||
## Credits | ||
- [Appnings](http://www.appnings.com) | ||
- [Shiburaj Pappu](https://github.com/softon/indipay) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
|
||
[ico-version]: https://img.shields.io/packagist/v/gopal-g/payment.svg?style=flat-square | ||
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square | ||
[ico-travis]: https://img.shields.io/travis/gopal-g/payment/master.svg?style=flat-square | ||
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/gopal-g/payment.svg?style=flat-square | ||
[ico-code-quality]: https://img.shields.io/scrutinizer/g/gopal-g/payment.svg?style=flat-square | ||
[ico-downloads]: https://img.shields.io/packagist/dt/gopal-g/payment.svg?style=flat-square | ||
|
||
[link-packagist]: https://packagist.org/packages/gopal-g/payment | ||
[link-travis]: https://travis-ci.org/gopal-g/payment | ||
[link-scrutinizer]: https://scrutinizer-ci.com/g/gopal-g/payment/code-structure | ||
[link-code-quality]: https://scrutinizer-ci.com/g/gopal-g/payment | ||
[link-downloads]: https://packagist.org/packages/gopal-g/payment | ||
[link-author]: https://github.com/gopal-g | ||
[link-contributors]: ../../contributors |
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,58 @@ | ||
{ | ||
"name": "gopal-g/ccavenue", | ||
"type": "library", | ||
"description": "Laravel 5.3 Package for Integration of Latest CCAvenue Payment Gateway for PHP 7.1 (Released recently) ", | ||
"keywords": [ | ||
"Laravel 5", | ||
"CCAvenue Payment gateway", | ||
"PHP 7.1 Integration Kit", | ||
"Appnings Software Solutions" | ||
], | ||
"homepage": "https://github.com/gopal-g/ccavenue", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": ":Gopal G", | ||
"email": ":c4gopal@gmail.com", | ||
"homepage": ":https://github.com/gopal-g/ccavenue", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"illuminate/support": "~5.0|~6.0", | ||
"php": "~5.6|~7.1" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": ">=5.4.3", | ||
"squizlabs/php_codesniffer": "^2.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Appnings\\Payment\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Appnings\\Payment\\": "tests" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "phpunit", | ||
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests", | ||
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.0-dev" | ||
}, | ||
"laravel": { | ||
"providers": [ | ||
"Appnings\\Payment\\PaymentServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev" | ||
} |
Oops, something went wrong.