PHP code example of churakovmike / yii2-free-kassa

1. Go to this page and download the library: Download churakovmike/yii2-free-kassa 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/ */

    

churakovmike / yii2-free-kassa example snippets


composer 

"churakovmike/yii2-free-kassa": "~1.3"

'freeKassaComponent' => [
    'class' => \ChurakovMike\Freekassa\FreeKassaComponent::class,
    'merchantId' => 'merchant-id',
    'firstSecret' => 'your-first-secret',
    'secondSecret' => 'your-second-secret',
],

public function behaviors()
{
    return [
        ChurakovMike\Freekassa\filters\CheckIpFilter::class,
     ]
}

$form = new ChurakovMike\Freekassa\forms\SuccessPayForm();
$form->setAttributes(\Yii::$app->request->post());
$form->validate();

/** @var FreeKassaComponent $component */
$component = \Yii::$app->freeKassaComponent;

/** @var FreeKassaComponent $component */
$component = \Yii::$app->freeKassaComponent;
$component->validateSignature($amount, $orderId, $signature);

/** @var FreeKassaComponent $component */
$component = \Yii::$app->freeKassaComponent;
$component->generatePaymentLink($orderId, $sum, $description);

$orders = $component->exportOrders($limit, $offset, $status, $dateFrom, $dateTo);

$balance = $component->getBalance();

$balance = $component->getOrder($orderId, $intid);

$withdraw = $component->withdraw($amount, $currency);

$invoice = $component->invoice($email, $amount, $description);

$balance = $component->getWalletBalance();

$withdraw = $component->walletWithdraw($purse, $amount, $currency, $desc, $disableExchange);

$status = $component->getOperationStatus($paymentId);

$transfer = $component->transferMoney($purse, $amount);

$payment = $component->onlinePayment($serviceId, $account, $amount);

$list = $component->getOnlineServices();

$status = $component->getOnlinePaymentStatus($paymentId);

$btc = $component->createBTCAddress();
$ltc = $component->createLTCAddress();
$eth = $component->createETHAddress();

$btc = $component->getBTCAddress();
$ltc = $component->getLTCAddress();
$eth = $component->getETHAddress();

$btcTransaction = $component->getBTCTransaction();
$ltcTransaction = $component->getLTCTransaction();
$ethTransaction = $component->getETHTransaction();