https://github.com/mayoz/laravel-omnipay
An Omnipay bridge for Laravel 5.
https://github.com/mayoz/laravel-omnipay
Last synced: 6 months ago
JSON representation
An Omnipay bridge for Laravel 5.
- Host: GitHub
- URL: https://github.com/mayoz/laravel-omnipay
- Owner: mayoz
- License: mit
- Created: 2015-11-08T04:17:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-01-29T23:37:04.000Z (over 7 years ago)
- Last Synced: 2025-07-11T15:47:28.360Z (about 1 year ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel: Omnipay
**An Omnipay bridge for Laravel 5**
[](https://packagist.org/packages/mayoz/laravel-omnipay)
[](LICENSE.md)
## Install
Via Composer
``` bash
$ composer require mayoz/laravel-omnipay
```
### Configuration
After installing the Omnipay library, register the `Mayoz\Omnipay\OmnipayServiceProvider` in your `config/app.php` configuration file:
```php
'providers' => [
// Other service providers...
Mayoz\Omnipay\OmnipayServiceProvider::class,
],
```
Also, add the `Omnipay` facade to the `aliases` array in your `app` configuration file:
```php
'Omnipay' => Mayoz\Omnipay\Facades\Omnipay::class,
```
Finally, publish the configuration files via `php artisan vendor:publish`.
Open the `config/omnipay.php` configuration file and set the default provider connection with `default` key. Define the connections with initialize configurations you want in `providers` key.
```php
'providers' => [
'Stripe' => [
'ApiKey' => '',
'testMode' => false,
],
'Iyzico' => [
'ApiKey' => '',
'ApiSecret' => '',
'testMode' => false,
]
],
```
## Omnipay Driver
This package supports when yours driver has been using the Omnipay infrastructure.
Now, add the omnipay provider you want to use. For example:
``` bash
$ composer require omnipay/stripe
# or
$ composer require mayoz/omnipay-iyzico
```
## Usage
Next, you are ready to use. Please see the following examples.
```php
'10.00',
'currency' => 'USD',
'card' => [
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
]
])->send();
// Process response
if ($response->isSuccessful()) {
// Payment was successful
print_r($response);
} elseif ($response->isRedirect()) {
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed
echo $response->getMessage();
}
}
}
```
## Support
If you are having general issues with Omnipay, we suggest posting on
[Stack Overflow](http://stackoverflow.com/). Be sure to add the
[omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.
If you want to keep up to date with release anouncements, discuss ideas for the project,
or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which
you can subscribe to.
If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/mayoz/laravel-omnipay/issues),
or better yet, fork the library and submit a pull request.
## Security
If you discover any security related issues, please email srcnckr@gmail.com instead of using the issue tracker.
## License
THis package is licensed under [The MIT License (MIT)](LICENSE).