PHP code example of jedenweb / webpay

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

    

jedenweb / webpay example snippets


  use JedenWeb\Webpay;

  $request = new Webpay\Request('private.pem', 'password');
  $request->setWebPayUrl('https://test.3dsecure.gpwebpay.com/rb/order.do');
  $request->setResponseUrl('http://example.com/order.php');
  $request->setMerchantNumber(1234);
  $request->setOrderInfo(100001 /* webpay order number */, 12345678 /* eshop order number */);
  $request->setPayment(10.50); // optionally Request::CZK, Request::EUR, Request::USD as second parameter, CZK is default
  echo "<a href='{$request->getRequestUrl()}'>Pay</a>";