Giter Club home page Giter Club logo

pagarme-laravel's Introduction

Pagar.me PHP SDK for Laravel

Latest Version on Packagist Software License Build Status StyleCI Coverage Status Quality Score Total Downloads

Pagar.me SDK for Laravel applications.

Install

Via Composer

$ composer require flyingluscas/pagarme-laravel

Usage

Set up

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,
],

Configurations

Publish the config/pagarme.php file and set your authentication keys, you can get them here.

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

Checkout Directive

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.

Facade

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.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

pagarme-laravel's People

Contributors

flyingluscas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pagarme-laravel's Issues

amount está dando erro com variável no blade

Olá,

Estou obtendo um erro ao tentar usar variável..

Estou tentando da seguinte maneira:

@checkout([
...
'amount' => "{{ number_format($total, 2,'','') }}",
...
])

minha pergunta é: como adiciono valor dinamico nesse parametro?

Desde já agradeço qualquer ajuda :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.