PkjSbankenBundle for Symfony
Create symfony based php apps with integration to Sbanken., (*1)
Uses https://github.com/peec/sbanken library. See that for docs of usage., (*2)
Install
Add to parameters.yml.dist:, (*3)
parameters:
#.......
sbanken_client_id: ~
sbanken_client_secret: ~
sbanken_customer_id: ~
Add to config.yml:, (*4)
pkj_sbanken:
client_id: '%sbanken_client_id%'
client_secret: '%sbanken_client_secret%'
customer_id: '%sbanken_customer_id%'
Add to AppKernel.php:, (*5)
new Pkj\Bundle\SbankenBundle\PkjSbankenBundle()
Run composer require, (*6)
composer require pkj/sbanken-bundle:^1.0
You will be asked to fill in client_id, client_secret and customer_id. Get these from sbanken website. (customer_id is your person number)., (*7)
Usage
This bundle exposes a new service pkj_sbanken.client which you have access to getApi()., (*8)
// Example, this can be run from controllers:
$bankAccountNumber = 11111111111;
$transactionRequest = new TransactionListRequest($bankAccountNumber);
$api = $transactions = $this->get('pkj_sbanken.client')->getApi();
$api->authorize();
$transactions = $api->Transactions()->getList($transactionRequest);
var_dump($transactions);
exit;