PHP code example of mprince / pagarme-laravel

1. Go to this page and download the library: Download mprince/pagarme-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mprince / pagarme-laravel example snippets

 php
'providers' => [
    FlyingLuscas\PagarMeLaravel\PagarMeServiceProvider::class,
],

'aliases' => [
    'PagarMe' => FlyingLuscas\PagarMeLaravel\PagarMeFacade::class,
],
 bash
$ php artisan vendor:publish --provider="FlyingLuscas\PagarMeLaravel\PagarMeServiceProvider"
 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>
 php
PagarMe::transaction()
    ->boletoTransaction(
        1000,
        $customer,
        'http://requestb.in/pkt7pgpk',
        ['id_product' => 13933139]
    );