PHP code example of payby / payby-php

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

    

payby / payby-php example snippets






\PayBy\PayBy::setPrivateKey('YOUR-KEY');

\PayBy\Api\Order::placeOrder(
        [
            "merchantOrderNo" => $order_no,
            "subject" => "iPhone",
            'totalAmount' => [
	            'currency' => 'AED',
	            'amount' => '0.3',
	        ],
            "paySceneCode" => "DYNQR",
            "notifyUrl" => "http://yoursite.com/api/notification",
            "accessoryContent" => [
	            'amountDetail' => [
	            	'vatAmount' => [
		            	'currency' => 'AED',
		            	'amount' => '0.3',
		            ],
	            ],
	            'goodsDetail' => [
	            	'body' => 'Gifts',
	            	'goodsName' => 'candy flower',
	            	'goodsId' => 'GI1005',
	            ],
	            'terminalDetail' => [
	            	'merchantName' => 'candy home',
	            ],
            ],
        ]
    );

\PayBy\Api\Order::placeOrder();

\PayBy\Api\Order::getOrder();

\PayBy\Api\Refund::placeOrder();

\PayBy\Api\Refund::getOrder();

\PayBy\Api\Transfer::placeTransferOrder();

\PayBy\Api\Transfer::getTransferOrder();

\PayBy\Api\Transfer::placeTransferToBankOrder();

\PayBy\Api\Transfer::getTransferToBankOrder();

// TODO

composer