PHP code example of speakman / laravel-paymill

1. Go to this page and download the library: Download speakman/laravel-paymill 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/ */

    

speakman / laravel-paymill example snippets


'providers' => array(
  Threesquared\LaravelPaymill\LaravelPaymillServiceProvider::class
)

'aliases' => array(
  'Paymill'   => Threesquared\LaravelPaymill\Facades\Paymill::class
),

$transaction = Paymill::Transaction();

$transaction->setAmount(4200)
    ->setCurrency('EUR')
    ->setPayment('pay_2f82a672574647cd911d')
    ->setDescription('Test Transaction');

$transaction->create();

try {

    Paymill::Transaction()
        ->setAmount(4200)
        ->setCurrency('EUR')
        ->setPayment('pay_2f82a672574647cd911d')
        ->setDescription('Test Transaction')
        ->create();

} catch(PaymillException $e) {

    $e->getResponseCode();
    $e->getStatusCode();
    $e->getErrorMessage();

}

Paymill::Client('client_8127a65bf3c84676c918')->details();

Paymill::Payment()->create('098f6bcd4621d373cade4e832627b4f6');