PHP code example of didipay / merchant-php-sdk

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

    

didipay / merchant-php-sdk example snippets




use DidiPay\client\merchantClient;

class MerchantClientTest
{

    public function test_pay_query()
    {
        
        $params = ['merchant_order_id' => $merchantOrderId,
            'pay_order_id' => $payOrderId];


        $domain = "https://api.99pay.com.br";
        $defaultOption = ['app_id' => $appId, 'merchant_id' => $merchantId, 'private_key' => $privateKeyContent, 'domain' => $domain];

        $client = new merchantClient($defaultOption);
        $ret = $client->payQuery($params);
        echo $ret;
    }
}
 
shell
shell
composer 
shell
php merchant_client_test.php