Payconiq API client for PHP
, (*1)
Accepting Payconiq payments with the use of the QR code., (*2)
To use the Payconiq API client, the following things are required:, (*3)
The best way to install the Payconiq API client is to require it with Composer., (*4)
$ composer require eventsquare/payconiq
You may also git checkout or download all the files, and include the Payconiq API client manually., (*5)
We use the following parameters in the examples below:, (*6)
$merchant_id = ''; // The merchant ID registered with Payconiq. $access_token = ''; // Used to secure request between merchant backend and Payconiq backend. $amount = 1000; // Transaction amount in cents $currency = 'EUR'; // Currency $callbackUrl = 'http://yoursite.com/postback'; // Callback where Payconiq needs to POST confirmation status
To learn more about how, when and what Payconiq will POST to your callbackUrl, please refer to the developer documentation right here., (*7)
use Payconiq\Client; $payconiq = new Client($merchant_id, $access_token); // Create a new transaction $transaction_id = $payconiq->createTransaction($amount, $currency, $callbackUrl); // Assemble QR code content $qrcode = 'https://payconiq.com/pay/1/' . $transaction_id;
use Payconiq\Client; $payconiq = new Client($merchant_id, $access_token); // Retrieve a transaction $transaction = $payconiq->retrieveTransaction($transaction_id);
We have provided a service provider to use this class with Laravel > 5.1., (*8)
Add the following line to the Framework Service Providers in config/app.php, (*9)
Payconiq\Support\Laravel\PayconiqServiceProvider::class,
Add the following entry to the aliases, (*10)
'Payconiq' => Payconiq\Support\Laravel\PayconiqFacade::class,
Publish the Payconiq config file with the artisan command and fill in your credentials in the config/payconiq.php config file., (*11)
php artisan vendor:publish
use Payconiq; // Create a new transaction $transaction_id = Payconiq::createTransaction($amount, $currency, $callbackUrl); // Assemble QR code content $qrcode = 'https://payconiq.com/pay/1/' . $transaction_id;
use Payconiq; // Retrieve a transaction $transaction = Payconiq::retrieveTransaction($transaction_id);