PHP code example of mincdev / wirecard-wrapper

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

    

mincdev / wirecard-wrapper example snippets


$adumo = new WirecardDelegate([
    'merchantUID'     => '9BA5008C-08EE-4286-A349-54AF91A621B0', // Your Merchant UID
    'applicationUID'  => '23ADADC0-DA2D-4DAC-A128-4845A5D71293', // Your Application UID
    'mode'            => Constants::WIRECARD_MODE_TEST // Specify Test or Live mode
]);

// Create the transaction
$transaction = new Transaction(9.95, "Your Merchant Reference");
$adumo->setTransaction($transaction);

// To use a test card, call one of the functions in the TestCards class
$card = (new TestCards())->visa3DSecure();

// To use a real card, assign it using the below
$card = new Card("Joe Soap", "4111111111111111", "10", "2027", 001);

$tdsLookupResult = $adumo->setCard($card)
                         ->lookup3DSecure();

if ($tdsLookupResult->getTdsLookupAuthRequired() == "Y") {
    $token = $adumo->createToken(); // Store this where you can access it from your return URL

    $adumo->

$tdsAuthenticateResult = $adumo->tdsAuthenticate($_POST["MD"], $_POST["PaRes"]);

if ($tdsAuthenticateResult->getTdsAuthCcAuthAllowed() == "Y" && 
    $tdsAuthenticateResult->getTdsAuthParesStatus() == "Y" && 
    $tdsAuthenticateResult->getTdsAuthSignatureVerification() == "Y") {
        $authorise = $adumo->setSalesItems($items) // Make sure you stored your items somewhere before calling the authentication
                            ->authoriseSale($tdsAuthenticateResult->getUidTransactionIndex(), Constants::ACTION_AUTHORISE, true);

        $capture = $adumo->capture($authorise->getUidTransactionIndex()); // Capture the sale

        $deleteToken = $adumo->deleteToken(); // Optional - Remove the token
}