PHP code example of nayax / php-sdk

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

    

nayax / php-sdk example snippets


    $merchantId = '{{ your merchant id }}';
    $hashCode = '{{ your hash code }}';
    
    $adapter = new Adapter($merchantId, $hashCode);
    
    // to get redirect url $redirectUrl
    $redirectUrl = $adapter->initiatePayment([
       'amount' => 1.23,
       'currency' => 'ACP', // for list of currencies view the website documentation
       'orderId' => uniqid(), // your system order id
       'methodCode' => 'visa', // what payment method to use
       'redirectUrl' => '{{ your redirect page}}',
       'notificationUrl' => '{{ your notification page}}',
    ]);