PHP code example of rodgermd / sofort2-bundle

1. Go to this page and download the library: Download rodgermd/sofort2-bundle 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/ */

    

rodgermd / sofort2-bundle example snippets


public function registerBundles()
{
    $bundles = array(
    ...
    new Sofort\SofortBundle(),
    ...
}
 php
  $manager = $container->get('sofort.manager')
  $manager->setConfigKey($sofortConfigKey);
 php
// Prepares model

$model = new PaymentRequestModel();
$model
  ->setAmount(0.1)
  ->setReason('test reason')
  ->setCountry('DE')
  ->setName('Max Mustermann')
  ->setAccountNumber('88888888')
  ->setBankCode('12345678');

// Call manager

$event = $manager->createTransaction($model);
 php
$response = $manager->requestTransaction($transactionId);