PHP code example of californiamountainsnake / php-yandex-payment

1. Go to this page and download the library: Download californiamountainsnake/php-yandex-payment 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/ */

    

californiamountainsnake / php-yandex-payment example snippets



use CaliforniaMountainSnake\PhpYandexPayment\HttpPaymentNotice\YandexHttpPaymentNotice;
use CaliforniaMountainSnake\PhpYandexPayment\Exceptions\PaymentException;

try {
    $secretToken = 'your_secret_yandex_http_notice_token';
    $notice = new YandexHttpPaymentNotice($_POST, $secretToken);
} catch (PaymentException $e) {
    return $e->getMessage();
}

// If we didn't get exceptions above it means that a payment is correct and we can get payment details.
$notice->getAmount();
$notice->getCurrency();
$notice->getLabel();

json
{
    "name": "yourproject/yourproject",
    "type": "project",
    "ment": "*"
    }
}
bash
composer