Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27a8097

Browse files
authored
Update readme for readability
1 parent 83f6740 commit 27a8097

File tree

1 file changed

+45
-59
lines changed

1 file changed

+45
-59
lines changed

‎README.md

Lines changed: 45 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,34 @@ Omnipay for Laravel & Lumen
66

77
Integrates the [Omnipay](https://github.com/adrianmacneil/omnipay) PHP library with Laravel to make Configuring multiple payment tunnels a breeze!
88

9-
### Composer Configuration
9+
##Installation
1010

1111
Include the laravel-omnipay package as a dependency in your `composer.json`:
1212

1313
composer require ignited/laravel-omnipay "3.*"
1414

15-
**Note:** You don't need to include the `omnipay/common` in your composer.json - it is a requirement of the `laravel-omnipay` package.
15+
**Note:** You don't need to include the `omnipay/common` in your composer.json - it has already been included `laravel-omnipay`.
1616

17-
Omnipay recently went refactoring that made it so that each package is now a seperate repository. The `omnipay/common` package includes the core framework. You will then need to include each gateway as you require. For example:
17+
### Install Required Providers
1818

19-
composer require omnipay/eway "3.*"
19+
Now just include each gateway as you require, to included PayPal for example:
20+
21+
composer require omnipay/paypal "3.*"
2022

21-
Alternatively you can include every gateway by requring:
23+
Alternatively you can include every gateway by the following:
2224

2325
composer require omnipay/omnipay "3.*"
2426

2527
**Note:** this requires a large amount of composer work as it needs to fetch each seperate repository. This is not recommended.
2628

27-
#### Laravel 5
28-
29-
Add a ServiceProvider to your providers array in `config/app.php`:
30-
31-
```php
32-
'providers' => [
33-
34-
Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider::class
35-
36-
]
37-
```
38-
39-
Add the `Omnipay` facade to your facades array:
29+
## Configuration
4030

41-
```php
42-
'Omnipay' => Ignited\LaravelOmnipay\Facades\OmnipayFacade::class
43-
```
44-
45-
Finally, publish the configuration files:
31+
You can publish the configuration files using the `vendor:publish` command.
4632

4733
```
4834
php artisan vendor:publish --provider="Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider" --tag=config
4935
```
5036

51-
#### Lumen
52-
53-
For `Lumen` add the following in your bootstrap/app.php
54-
```php
55-
$app->register(Ignited\LaravelOmnipay\LumenOmnipayServiceProvider::class);
56-
```
57-
58-
Copy the laravel-omnipay.php file from the config directory to config/laravel-omnipay.php
59-
60-
And also add the following to bootstrap/app.php
61-
```php
62-
$app->configure('laravel-omnipay');
63-
```
64-
65-
### Guzzle 6
66-
67-
If you are using Guzzle 6 you need to require the following package.
68-
69-
composer require php-http/guzzle6-adapter
70-
71-
Guzzle 7 now implements a PSR http client compliant adapter. So there is no need to include this.
72-
73-
### Configuration
74-
7537
Once you have published the configuration files, you can add your gateway options to the config file in `config/laravel-omnipay.php`.
7638

7739
#### PayPal Express Example
@@ -83,22 +45,22 @@ Here is an example of how to configure password, username and, signature with pa
8345
'paypal' => [
8446
'driver' => 'PayPal_Express',
8547
'options' => [
86-
'username' => env( 'OMNIPAY_PAYPAL_EXPRESS_USERNAME', '' ),
87-
'password' => env( 'OMNIPAY_PAYPAL_EXPRESS_PASSWORD', '' ),
88-
'signature' => env( 'OMNIPAY_PAYPAL_EXPRESS_SIGNATURE', '' ),
89-
'solutionType' => env( 'OMNIPAY_PAYPAL_EXPRESS_SOLUTION_TYPE', '' ),
90-
'landingPage' => env( 'OMNIPAY_PAYPAL_EXPRESS_LANDING_PAGE', '' ),
91-
'headerImageUrl' => env( 'OMNIPAY_PAYPAL_EXPRESS_HEADER_IMAGE_URL', '' ),
48+
'username' => 'coolusername',
49+
'password' => 'strongpassword',
50+
'signature' => '',
51+
'solutionType' => '',
52+
'landingPage' => '',
53+
'headerImageUrl' => '',
9254
'brandName' => 'Your app name',
93-
'testMode' => env( 'OMNIPAY_PAYPAL_TEST_MODE', true )
55+
'testMode' => true
9456
]
9557
],
9658
]
9759
...
9860
```
9961

10062

101-
### Usage
63+
## Usage
10264

10365
```php
10466
$cardInput = [
@@ -110,6 +72,7 @@ $cardInput = [
11072
];
11173

11274
$card = Omnipay::creditCard($cardInput);
75+
11376
$response = Omnipay::purchase([
11477
'amount' => '100.00',
11578
'returnUrl' => 'http://bobjones.com/payment/return',
@@ -125,7 +88,7 @@ This will use the gateway specified in the config as `default`.
12588
However, you can also specify a gateway to use.
12689

12790
```php
128-
Omnipay::setGateway('eway');
91+
Omnipay::setGateway('paypal');
12992

13093
$response = Omnipay::purchase([
13194
'amount' => '100.00',
@@ -135,11 +98,34 @@ $response = Omnipay::purchase([
13598
dd($response->getMessage());
13699
```
137100

138-
In addition you can take an instance of the gateway.
101+
In addition you can make an instance of the gateway.
139102

140103
```php
141-
$gateway = Omnipay::gateway('eway');
104+
$gateway = Omnipay::gateway('paypal');
142105
```
143106

144-
### License
107+
## Installation on Other Frameworks
108+
### Lumen
109+
110+
For `Lumen` add the following in your bootstrap/app.php
111+
```php
112+
$app->register(Ignited\LaravelOmnipay\LumenOmnipayServiceProvider::class);
113+
```
114+
115+
Copy the laravel-omnipay.php file from the config directory to config/laravel-omnipay.php
116+
117+
And also add the following to bootstrap/app.php
118+
```php
119+
$app->configure('laravel-omnipay');
120+
```
121+
122+
## Guzzle
123+
124+
If you are using Guzzle 6 you need to require the following package.
125+
126+
composer require php-http/guzzle6-adapter
127+
128+
Guzzle 7 now implements a PSR http client compliant adapter. So there is no need to include this.
129+
130+
## License
145131
This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /