Package Data | |
---|---|
Maintainer Username: | flyingluscas |
Maintainer Contact: | lucas.pires.mattos@gmail.com (Lucas Pires) |
Package Create Date: | 2017-05-15 |
Package Last Update: | 2021-12-11 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-24 15:01:52 |
Package Statistics | |
---|---|
Total Downloads: | 2,579 |
Monthly Downloads: | 79 |
Daily Downloads: | 0 |
Total Stars: | 27 |
Total Watchers: | 3 |
Total Forks: | 6 |
Total Open Issues: | 1 |
Pagar.me SDK for Laravel applications.
Via Composer
$ composer require flyingluscas/pagarme-laravel
Set up the service provider and the facade in your config/app.php file.
You can skip this step on Laravel 5.5 due to the self-discovery package feature.
'providers' => [
FlyingLuscas\PagarMeLaravel\PagarMeServiceProvider::class,
],
'aliases' => [
'PagarMe' => FlyingLuscas\PagarMeLaravel\PagarMeFacade::class,
],
Publish the config/pagarme.php file and set your authentication keys, you can get them here.
$ php artisan vendor:publish --provider="FlyingLuscas\PagarMeLaravel\PagarMeServiceProvider"
Use the blade directive @checkout
to easily set up the checkout form.
<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.
You can easily interact with the SDK using the facade class, see a quick example.
PagarMe::transaction()
->boletoTransaction(
1000,
$customer,
'http://requestb.in/pkt7pgpk',
['id_product' => 13933139]
);
More examples on how to use the SDK please visit the official documentation available here.
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email lucas.pires.mattos@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.