PHP code example of sakhnovkrg / wooppay

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

    

sakhnovkrg / wooppay example snippets


$wooppay = new \Sakhnovkrg\Wooppay\WooppayClient(
    'https://www.wooppay.com/api/xml',
    'username',
    'password'
);

$invoice = $wooppay->createInvoiceByService(
    ...
);

$operationUrl = $invoice->operationUrl;
$operationId = $invoice->operationId;

$status = $wooppay->getOperationStatus($operationId);

if($status == \Sakhnovkrg\Wooppay\WooppayClient::STATUS_DONE) {
    \Sakhnovkrg\Wooppay\WooppayClient::sendCompleteResponse();
}