PHP code example of leonardjke / omnipay-yoomoney

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

    

leonardjke / omnipay-yoomoney example snippets

 php 
$gateway = Omnipay::create('Yoomoney');

$gateway->setReceiver('410011122244470');
$gateway->setPaymentType('PC');
$gateway->setQuickpayForm('shop');
$gateway->setSuccessUrl('https://example.com');

$response = $gateway->purchase([
    'amount' => $payment->price,
    'transactionId' => $payment->id,
    'description' => 'Оплата товара',
    'currency' => 'RUB',
])->send();
 php 
$gateway = Omnipay::create('Yoomoney');

$gateway->setReceiver('410011122244470');
$gateway->setPaymentType('PC');
$gateway->setQuickpayForm('shop');
$gateway->setSuccessUrl('https://example.com');

$response = $gatewayManager->acceptNotification();

// Impotant! Verify hash of the request
if (!$response->isValid()) {
  // return error
}

$data   = $response->getData();
$status = $response->getTransactionStatus();
$id     = $response->getTransactionReference();