Skip to content

Commit

Permalink
Merge pull request #1 from flyingluscas/feature/update-readme-and-cha…
Browse files Browse the repository at this point in the history
…ngelog

Update README and CHANGELOG
  • Loading branch information
flyingluscas authored Jun 1, 2017
2 parents 2308286 + 80fc4a4 commit a7e6314
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All Notable changes to `pagarme-laravel` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 0.2.0 - 2017-06-01

### Added
- Blade directive to build the checkout button.

## 0.1.0 - 2017-05-17

### Added
Expand Down
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ composer require flyingluscas/pagarme-laravel

## Usage

#### 1. Service Provider and Facade
#### Set up

Set up the **service provider** and the **facade** in your **config/app.php** file.

Expand All @@ -34,17 +34,41 @@ Set up the **service provider** and the **facade** in your **config/app.php** fi
],
```

#### 2. Configurations
#### Configurations

Publish the **config/pagarme.php** file and set [your keys from the Pagar.me API][link-pagarme-dash].

``` bash
$ php artisan vendor:publish --provider="FlyingLuscas\PagarMeLaravel\PagarMeServiceProvider"
```

#### 3. Ready to go
#### Checkout Directive

Use the blade directive `@checkout` to easily set up the checkout form.

``` blade
<form action="/payment" method="post">
@checkout([
'button-text' => 'Pay',
'amount' => '1000',
'customer-data' => 'true',
'payment-methods' => 'boleto,credit_card',
'ui-color' => '#bababa',
'postback-url' => 'requestb.in/1234',
'create-token' => 'true',
'interest-rate' => '12',
'free-installments' => '3',
'default-installment' => '5',
'header-text' => 'Title',
])
</form>
```

More examples on how to use the checkout form please visit the [official documentation][link-pagarme-checkout-form].

#### Facade

You are ready to start creating your transactions using the PagarMe facade, see a quick example below.
You can easily interact with the SDK using the `PagarMeFacade` class, see an quick example.

``` php
PagarMe::transaction()
Expand All @@ -56,7 +80,7 @@ PagarMe::transaction()
);
```

For more examples please visit the original [documentation available here][link-pagarme-wiki].
More examples on how to use the SDK please visit the official [documentation available here][link-pagarme-wiki].

## Change log

Expand Down Expand Up @@ -103,3 +127,4 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[link-contributors]: ../../contributors
[link-pagarme-wiki]: https://github.com/pagarme/pagarme-php/wiki
[link-pagarme-dash]: https://dashboard.pagar.me/#/myaccount/apikeys
[link-pagarme-checkout-form]: https://docs-beta.pagar.me/docs/inserindo-o-formulario

0 comments on commit a7e6314

Please sign in to comment.