1. Go to this page and download the library: Download barzahlen/barzahlen-php 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/ */
use Barzahlen\Request\CreateRequest;
$request = new CreateRequest();
$request->setSlipType('payment');
$request->setCustomerKey('LDFKHSLFDHFL');
$request->setTransaction('14.95', 'EUR');
use Barzahlen\Request\CreateRequest;
$request = new CreateRequest();
$request->setSlipType('refund');
$request->setForSlipId('slp-1b41145c-2dd3-4e3f-bbe1-72c09fbf3f94');
$request->setTransaction('-14.95', 'EUR');
use Barzahlen\Request\CreateRequest;
$request = new CreateRequest();
$request->setSlipType('payout');
$request->setCustomerKey('LDFKHSLFDHFL');
$request->setTransaction('-14.95', 'EUR');
use Barzahlen\Request\UpdateRequest;
$request = new UpdateRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f');
$request->setCustomer(array(
'email' => '[email protected]',
'cell_phone' => '012345678910'
));
$request->setExpiresAt('2016-01-10T12:34:56Z');
$request->setTransaction('4729294329', '150.00');
$request->setReferenceKey('NEWKEY');
use Barzahlen\Request\RetrieveRequest;
use Barzahlen\Request\ResendRequest;
use Barzahlen\Request\InvalidateRequest;
// get current information on the slip
$request = new RetrieveRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f');
// resend email / text message to customer
$request = new ResendRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f', 'email');
$request = new ResendRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f', 'text_message');
// invalidate slip immediately
$request = new InvalidateRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f');
use Barzahlen\Request\RetrievePdfRequest;
$request = new RetrievePdfRequest('slp-f26bcd0b-556b-4285-b0b3-ba54052df97f');
// contains pdf data
$response = $client->handle($request);
use Barzahlen\Webhook;
$header = $_SERVER;
$body = file_get_contents('php://input');
$webhook = new Webhook('f2a173a210c7c8e7e439da7dc2b8330b6c06fc04');
if ($webhook->verify($header, $body)) {
$stdClass = json_decode($body);
$array = json_decode($body, true);
// @TODO: send 200 status code, update order
} else {
// @TODO: send 400 status code, log error
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.