PHP code example of jackmartin / popolniclub

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

    

jackmartin / popolniclub example snippets




use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');
// $pophone = new Pophone();
// $pophone
//     ->setLogin()
//     ->setPassword()
//     ->setAPI()
//     ->setSandbox();



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API', true);



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

print_r(

    $pophone->sendPayment(

        [

            'transactionId' => 1000000001,
            'amount'        => 100,
            'msisdn'        => '380000000000',
            'templateID'    => 0

        ]

    )

);




use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

print_r(

    $pophone
        ->setTransactionID()
        ->setSumm(1)
        ->setPhone('380000000000')
        ->setTemplateID()
        ->addPayment()
        ->sendPayment()

);



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

foreach (

    [
        [
            'phone' => '380000000000',
            'summ'  => 1
        ],
        [
            'phone' => '380000000001',
            'summ'  => 1
        ]
    ] 
    as 
    $key => $item

) {

    $pophone
        ->setTransactionID()
        ->setPhone($item['phone'])
        ->setSumm($item['summ'])
        ->setTemplateID()
        ->addPayment();

}

print_r(

    $pophone->sendPayment()->getData()

);



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

print_r(

    $pophone->statusPayment(

        [

            [

                'transactionId' => 1000000001,
                'status'        => 0,

            ],

        ]
    )

);



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

print_r(

    $pophone
        ->addTransaction(1000000001)
        ->statusPayment()

);



use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

foreach (

        [

            1000000001,
            1000000002,

        ] as $id

    ) {

        $pophone->addTransaction($id);

}

print_r(

    $pophone->statusPayment()->getData()
    // $pophone->statusPayment()->getRaw()
    // $pophone->statusPayment()->transaction()
    // $pophone->statusPayment()->status()

);




use PopolniClub\Pophone;

$pophone = new Pophone('Ваш логин', 'Ваш пароль API');

print_r(

    $pophone->currentBalance()->getData()
    // $pophone->currentBalance()->getRaw()
    // $pophone->currentBalance()->balance()
    // $pophone->currentBalance()->balance(true)
    // $pophone->currentBalance()->credit()

);