1. Go to this page and download the library: Download flowinpay/flowinpay-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/ */
flowinpay / flowinpay-php example snippets
use FlowinPay\FlowinPay;
$fp = new FlowinPay('fpk_sua_chave_aqui');
// Cria uma cobrança PIX de R$ 100 com split
$res = $fp->charges->create([
'value' => 100,
'description' => 'Pedido #123',
'callbackUrl' => 'https://seusite.com/webhooks/flowinpay',
'split' => [
['type' => 'percentage', 'value' => 10, 'recipient' => 'PUBLIC_ID_DO_COPRODUTOR'],
],
]);
$charge = $res['charge'];
echo $charge['br_code']; // PIX copia-e-cola (exiba para o pagador)
echo $charge['payment_link_url']; // link de pagamento pronto
echo $charge['qr_code_image']; // URL do QR Code