codedge / laravel-sofortlib
Laravel package for use with SofortLib/SOFORT API, provides a facade to work with.
Fund package maintenance!
codedge
Installs: 2 623
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 3
Open Issues: 5
Requires
- php: ^7.3|^8.0
- illuminate/support: ^6.0|^7.0|^8.0
- sofort/sofortlib-php: ^3.3
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2023-08-25 13:36:26 UTC
README
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... } });