Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
/ laravel-sofortlib Public archive

Laravel SofortLib integration, communicate with the SOFORT API

License

Notifications You must be signed in to change notification settings

codedge/laravel-sofortlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads License

Laravel integration for Sofortlib

This repository implements a simple ServiceProvider that creates a singleton instance of the Sofortlib client easily accessible via a Facade.

See SofortLib for more information about the usage.

Installation

$ composer require codedge/laravel-sofortlib

The package registers itself.

Next run
php artisan vendor:publish --provider="Codedge\Sofortlib\SofortlibServiceProvider" --tag=config
to publish the configuration file for the SOFORT API to config/sofortlib.php.

Note: Open this file and enter your correct API credentials and other settings.

Usage

To use the static interfaces (facades) you need to add the following lines to your config/app.php.

Sofortüberweisung

// app/Http/routes.php

Route::get('/', function () {

    Sofortueberweisung::setAmount(5);
    Sofortueberweisung::setCurrencyCode('EUR');
    Sofortueberweisung::sendRequest();

    if(Sofortueberweisung::isError()) {
        // do something...
    }

});

Billcode

// app/Http/routes.php

Route::get('/', function () {

    Billcode::setAmount(47.11);
    Billcode::setCurrencyCode('USD');
    Billcode::createBillcode();

    if(Billcode::isError()) {
        // do something...
    }

});