PHP code example of destyk / umoney-quickpay-php

1. Go to this page and download the library: Download destyk/umoney-quickpay-php 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/ */

    

destyk / umoney-quickpay-php example snippets




$secretKey = 'saoZflUalRvI************';

try {
    $quickPay = new DestyK\UMoney\QuickPay($secretKey);
    $form = $quickPay->createForm([
        'receiver' => 410024568******,
        'quickpay-form' => 'shop',
        'paymentType' => 'MC',
        'targets' => 'Тестовый платёж',
        'sum' => 500
    ]);
    
    // Url для отправки данных методом POST: $form['url']
    // Данные формы для отправки: $form['form']
} catch(ErrorException $e) {
    echo $e->getMessage();
}



$sha1_hash = $_POST['sha1_hash'];
$body = $_POST;
$secretKey = 'saoZflUalRvI************';

try {
    $quickPay = new DestyK\UMoney\QuickPay($secretKey);
    // true, если подписи идентичны, false - если нет
    $result = $quickPay->checkNotificationSignature($sha1_hash, $body);
} catch(ErrorException $e) {
    echo $e->getMessage();
}
bash
$ composer