PHP code example of lzaplata / thepay

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

    

lzaplata / thepay example snippets


use LZaplata\ThePay\Service;

/** @var Service @inject */
public $thepay;

$paymentParams = new CreatePaymentParams($amount, $currencyCode, $uid);
$paymentParams->setReturnUrl("some return URL");

$payment = $this->thepay->createPayment($paymentParams);

$this->sendResponse(new RedirectResponse($payment->getPayUrl()));