PHP code example of gdbhosale / paywitheasebuzz-php

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

    

gdbhosale / paywitheasebuzz-php example snippets


composer 

    $postData = array ( 
        "txnid" => "T3SAT0B5OL", 
        "amount" => "100.0", 
        "firstname" => "jitendra", 
        "email" => "[email protected]", 
        "phone" => "1231231235", 
        "productinfo" => "Laptop", 
        "surl" => "http://localhost:3000/response.php", 
        "furl" => "http://localhost:3000/response.php", 
        "udf1" => "aaaa", 
        "udf2" => "aaaa", 
        "udf3" => "aaaa", 
        "udf4" => "aaaa", 
        "udf5" => "aaaa", 
        "address1" => "aaaa", 
        "address2" => "aaaa", 
        "city" => "aaaa", 
        "state" => "aaaa", 
        "country" => "aaaa", 
        "zipcode" => "123123" 
    );

    $easebuzzObj->initiatePaymentAPI($postData);    
    

    $postData = array ( 
        "txnid" => "TZIF0SS24C",
        "amount" => "1.03",
        "email" => "[email protected]",
        "phone" => "1231231235"
    );

    $result = $easebuzzObj->transactionAPI($postData);    
    

    $postData = array( 
        "merchant_email" => "[email protected]",
        "transaction_date" => "06-06-2018" 
    );

    $result = $easebuzzObj->transactionDateAPI($postData);
    

    $postData = array( 
        "txnid" => "ASD20088",
        "refund_amount" => "1.03",
        "phone" => "1231231235",
        "email" => "[email protected]",
        "amount" => "1.03" 
    );

    $result = $easebuzzObj->refundAPI($postData);    
    

    $postData = array( 
        "merchant_email" => "[email protected]",
        "payout_date" => "08-06-2018" 
    );

    $result = $easebuzzObj->payoutAPI($postData);
    

        function _paymentResponse($result){

            if ($result->status === 1){
                // first way (comment below line)
                // header( 'Location:' . $result->data );

                // second way (un-comment below code)
                echo "
                <script type='text/javascript'>
                        window.location ='".$result->data."'
                </script>
                ";


                exit(); 
            }else{
                //echo '<h3>'.$result['data'].'</h3>';
                print_r(json_encode($result));
            }
        }
        

        public function initiatePaymentAPI($params, $redirect=False) {
            return initiate_payment($params, $redirect, $this->MERCHANT_KEY, $this->SALT, $this->ENV);
        }