PHP code example of payconn / wirecard
1. Go to this page and download the library: Download payconn/wirecard 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/ */
payconn / wirecard example snippets
use Payconn\Common\CreditCard;
use Payconn\Wirecard;
use Payconn\Wirecard\Model\Purchase;
use Payconn\Wirecard\Token;
$token = new Token('<YOUR-USER-CODE>', '<YOUR-PIN>');
$purchase = new Purchase();
$purchase->setTestMode(true);
$purchase->setAmount(100);
$purchase->setInstallment(1);
$purchase->setDescription('<YOUR-DESCRIPTION>');
$purchase->setCreditCard((new CreditCard('4111111111111111', '2024', '01', '123'))
->setHolderName('<CARD-HOLDER-NAME>'));
$purchase->generateOrderId();
$response = (new Wirecard($token))->purchase($purchase);