PHP code example of hochstrasserio / wirecard-bundle

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

    

hochstrasserio / wirecard-bundle example snippets


// AppKernel.php
$bundles = [
    …
    new Hochstrasser\WirecardBundle\HochstrasserWirecardBundle(),
    …
];



$context = $this->get('hochstrasser_wirecard.context');



$request->setConfirmUrl($this->generateUrl('wirecard_confirm'), [], UrlGeneratorInterface::ABSOLUTE_URL);



use Hochstrasser\WirecardBundle\Event\ConfirmPaymentEvent;

$listener = function (ConfirmPaymentEvent $event) {
    // Response parameters
    // See: https://guides.wirecard.at/response_parameters
    $data = $event->getData();

    if ($event->isPaymentState(ConfirmPaymentEvent::SUCCESS)) {
        // We got the payment, queue order confirmation email
    } else if ($event->isPaymentState(ConfirmPaymentEvent::FAILURE)) {
        // Notify the user that something went wrong with the payment, and order
        // is on hold
    }
};