PHP code example of cosna / wallet

1. Go to this page and download the library: Download cosna/wallet 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/ */

    

cosna / wallet example snippets

 bash
composer 

namespace App\Http\Controllers;
use cosnaWallet\PhpSdk\Cosnawallet;

class payment extends Controller
{
    public function objet()
    {
        return new LoovPay('private_key', 'master_key');
    }

    public function index()
    {

        $data = array(
            'amount' => 2000,
            'currency' => '',
            'hash' => '',
            'return_url' => '',
            'cancel_url' => '',
            'callback_url' => '',
        );

        $this->objet()->initPayment($data);
    }