PHP code example of clanmax / tinkoff-autopay

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

    

clanmax / tinkoff-autopay example snippets


use ClanMax\TinkoffAutopay;

$payment = [
  'OrderId'       => '2223',
  'Amount'        => '1000',
  'Language'      => 'ru',
  'Reccurent'     => 'Y',
  'CustomerKey'   => "clanmax",
  'Description'   => 'One month pay',
  'Email'         => '[email protected]',
  'Phone'         => '+79517474837',
  'Name'          => 'Vlad',
  'Taxation'      => 'usn_income'
];

$items[] = [
  'Name'  => 'Something you gonna pay',
  'Price' => '1000',    
  'Tax'   => 'none',
];

$bank->Init($payment,$items);

$charge = $bank->Charge($PaymentId,$RebillId);

$customer = $bank->AddCustomer($CustomerKey);

$customer = $bank->GetCustomer($CustomerKey);

$customer = $bank->RemoveCustomer($CustomerKey);

$cards = $bank->GetCardList($CustomerKey);

$cards = $bank->RemoveCard($CardId, $CustomerKey);

$bank->error ?:  

use ClanMax\TinkoffKey;

$test = new TinkoffKey;

return $test;