Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php defined('BASEPATH') or exit('No direct script access allowed'); class upi extend..

Decoded Output download

<?php 
defined('BASEPATH') or exit('No direct script access allowed'); 
 
class upi extends MX_Controller 
{ 
    public $tb_users; 
    public $tb_transaction_logs; 
    public $tb_payments; 
    public $tb_payments_bonuses; 
    public $upi; 
    public $payment_type; 
    public $payment_id; 
    public $currency_code; 
    public $mode; 
    public $payment_lib; 
    public $upi_mid; 
    public $sec_key; 
    public $tnx_fee; 
    public $upi_add; 
    public $rate_to_usd; 
    public function __construct($payment = "") 
    { 
        parent::__construct(); 
        $this->load->model('add_funds_model', 'model'); 
 
        $this->tb_users = USERS; 
        $this->payment_type = 'upi'; 
        $this->tb_transaction_logs = TRANSACTION_LOGS; 
        $this->tb_payments = PAYMENTS_METHOD; 
        $this->tb_payments_bonuses = PAYMENTS_BONUSES; 
        $this->currency_code = get_option("currency_code", "USD"); 
        if ($this->currency_code == "") { 
            $this->currency_code = 'USD'; 
        } 
 
        if (!$payment) { 
            $payment = $this->model->get('id, type, name, params', $this->tb_payments, ['type' => $this->payment_type]); 
        } 
        $this->payment_id = $payment->id; 
        $params                   = $payment->params; 
        $option                   = get_value($params, 'option'); 
        $this->mode               = get_value($option, 'environment'); 
        $this->tnx_fee = get_value($params, 'tnx_fee'); 
        //options 
        $this->upi_mid          = get_value($option, 'upi_mid'); 
        $this->sec_key         = get_value($option, 'sec_key'); 
                $this->upi_add         = get_value($option, 'upi_add'); 
                $this->rate         = get_value($option, 'rate_to_usd'); 
 
 
 
    } 
 
    public function index() 
    { 
        redirect(cn("add_funds")); 
    } 
 
    /** 
     * 
     * Create payment 
     * 
     */ 
    public function create_payment($data_payment = "") 
    { 
        _is_ajax($data_payment['module']); 
        $amount = $data_payment['amount']; 
        if (!$amount) { 
            _validation('error', lang('There_was_an_error_processing_your_request_Please_try_again_later')); 
        } 
         
include 'PopsWebCheckSum.php'; 
$users= $this->model->get('*', $this->tb_users, ['id' => session('uid')]); 
 
         $orderId = md5(rand(1,99)); 
    $token = $this->upi_mid; // Your Token,which  you got  
$secret = $this->sec_key; // Your Secret Key, which you got  
$POPSWEB_ENVIRONMENT = 'PROD'; // PROD, TEST 
 
$checkSum = ""; 
$upiuid = ""; 
$paramList = array(); 
 
$cust_Mobile = '1818188181'; 
$cust_Email = $users->email; 
 
$txnAmount = $amount; 
$txnNote = $users->first_name; 
 
 $data=cn("add_funds/upi/complete?tr=$orderId"); 
 
$POPSWEB_TXN_URL = "https://popscheckout.in/order/paytm"; 
 
$upiuid = $this->upi_add; // Its Paytm Business UPI Unique ID. Put your Paytm Business UPI Unique ID 
 
$paramList["cust_Mobile"] = $cust_Mobile; 
$paramList["cust_Email"] = $cust_Email; 
 
 
 
// Create an array having all required parameters for creating checksum. 
$paramList["upiuid"] = $upiuid; 
$paramList["token"] = $token; 
$paramList["orderId"] = $orderId ; 
$paramList["txnAmount"] = $txnAmount; 
$paramList["txnNote"] = $txnNote; 
$paramList["callback_url"] =  $data; 
$tx_amount=$amount/$this->rate; 
         $data_tnx_log = array( 
                        "ids" => ids(), 
                        "uid" => session("uid"), 
                        "type" => $this->payment_type, 
                        "transaction_id" => $paramList["orderId"], 
  "amount" 	        => $tx_amount, 
                'txn_fee'           => $tx_amount * ($this->tnx_fee / 100),                        "status" => 0, 
                        "created" => NOW, 
                    ); 
 
                    $transaction_log_id = $this->db->insert($this->tb_transaction_logs, $data_tnx_log); 
$checkSum = PopsWebCheckSum::generateSignature($paramList,$secret); 
	  
echo '<form method="post" action="' . $POPSWEB_TXN_URL . '" name="f1"> 
        <table border="1"> 
            <tbody>'; 
foreach($paramList as $name => $value) { 
    echo '<input type="hidden" name="' . $name .'" value="' . $value . '">'; 
} 
echo '<input type="hidden" name="checksum" value="' . $checkSum . '"> 
            </tbody> 
        </table> 
              <center> <input class="btn round btn-primary btn-min-width mr-1 mb-1" type="submit" value="Checkout"></center> 
 
    </form>'; 
 
    } 
 
    /** 
     * 
     * Call Execute payment after creating payment 
     * 
     */ 
    public function complete() 
    { 
include 'PopsWebCheckSum.php'; 
$verifySignature = ''; 
$array = array(); 
$paramList = array(); 
 
 
$secret = $this->sec_key; // Your Secret Key. 
$status = $_POST['status']; // Its Payment Status Only, Not Txn Status. 
$message = $_POST['message']; // Txn Message. 
$cust_Mobile = $_POST['cust_Mobile']; // Txn Message. 
$cust_Email = $_POST['cust_Email']; // Txn Message. 
$hash = $_POST['hash']; // Encrypted Hash / Generated Only SUCCESS Status. 
$checksum = $_POST['checksum'];  // Checksum verifySignature / Generated Only SUCCESS Status. 
  $transaction = $this->model->get('*', $this->tb_transaction_logs, ['transaction_id' => $_GET["tr"], 'status' => 0, 'type' => $this->payment_type]); 
 
        if (!$transaction) { 
            redirect(cn("add_funds")); 
        } 
 
            
 if($status=="SUCCESS"){ 
	 
$paramList = hash_decrypt($hash,$secret); 
$verifySignature = PopsWebCheckSum::verifySignature($paramList, $secret, $checksum); 
 
// Checksum verify. 
if($verifySignature){ 
	$this->db->update($this->tb_transaction_logs, ['status' => 1, 'transaction_id' =>$_GET["tr"]],  ['id' => $transaction->id]); 
 
			// Update Balance  
     
    	  $this->model->add_funds_bonus_email($transaction, $this->payment_id); 
             
 
			redirect(cn("add_funds")); 
 
		} else { 
		     
			$this->db->update($this->tb_transaction_logs, ['status' => -1, 'transaction_id' =>$_GET["tr"]],  ['id' => $transaction->id]); 
		; 
			redirect(cn("add_funds/unsuccess")); 
		} 
    
} 
 
 
 
    } 
 
     
   
} 
 ?>

Did this file decode correctly?

Original Code

<?php
defined('BASEPATH') or exit('No direct script access allowed');

class upi extends MX_Controller
{
    public $tb_users;
    public $tb_transaction_logs;
    public $tb_payments;
    public $tb_payments_bonuses;
    public $upi;
    public $payment_type;
    public $payment_id;
    public $currency_code;
    public $mode;
    public $payment_lib;
    public $upi_mid;
    public $sec_key;
    public $tnx_fee;
    public $upi_add;
    public $rate_to_usd;
    public function __construct($payment = "")
    {
        parent::__construct();
        $this->load->model('add_funds_model', 'model');

        $this->tb_users = USERS;
        $this->payment_type = 'upi';
        $this->tb_transaction_logs = TRANSACTION_LOGS;
        $this->tb_payments = PAYMENTS_METHOD;
        $this->tb_payments_bonuses = PAYMENTS_BONUSES;
        $this->currency_code = get_option("currency_code", "USD");
        if ($this->currency_code == "") {
            $this->currency_code = 'USD';
        }

        if (!$payment) {
            $payment = $this->model->get('id, type, name, params', $this->tb_payments, ['type' => $this->payment_type]);
        }
        $this->payment_id = $payment->id;
        $params                   = $payment->params;
        $option                   = get_value($params, 'option');
        $this->mode               = get_value($option, 'environment');
        $this->tnx_fee = get_value($params, 'tnx_fee');
        //options
        $this->upi_mid          = get_value($option, 'upi_mid');
        $this->sec_key         = get_value($option, 'sec_key');
                $this->upi_add         = get_value($option, 'upi_add');
                $this->rate         = get_value($option, 'rate_to_usd');



    }

    public function index()
    {
        redirect(cn("add_funds"));
    }

    /**
     *
     * Create payment
     *
     */
    public function create_payment($data_payment = "")
    {
        _is_ajax($data_payment['module']);
        $amount = $data_payment['amount'];
        if (!$amount) {
            _validation('error', lang('There_was_an_error_processing_your_request_Please_try_again_later'));
        }
        
include 'PopsWebCheckSum.php';
$users= $this->model->get('*', $this->tb_users, ['id' => session('uid')]);

         $orderId = md5(rand(1,99));
    $token = $this->upi_mid; // Your Token,which  you got 
$secret = $this->sec_key; // Your Secret Key, which you got 
$POPSWEB_ENVIRONMENT = 'PROD'; // PROD, TEST

$checkSum = "";
$upiuid = "";
$paramList = array();

$cust_Mobile = '1818188181';
$cust_Email = $users->email;

$txnAmount = $amount;
$txnNote = $users->first_name;

 $data=cn("add_funds/upi/complete?tr=$orderId");

$POPSWEB_TXN_URL = "https://popscheckout.in/order/paytm";

$upiuid = $this->upi_add; // Its Paytm Business UPI Unique ID. Put your Paytm Business UPI Unique ID

$paramList["cust_Mobile"] = $cust_Mobile;
$paramList["cust_Email"] = $cust_Email;



// Create an array having all required parameters for creating checksum.
$paramList["upiuid"] = $upiuid;
$paramList["token"] = $token;
$paramList["orderId"] = $orderId ;
$paramList["txnAmount"] = $txnAmount;
$paramList["txnNote"] = $txnNote;
$paramList["callback_url"] =  $data;
$tx_amount=$amount/$this->rate;
         $data_tnx_log = array(
                        "ids" => ids(),
                        "uid" => session("uid"),
                        "type" => $this->payment_type,
                        "transaction_id" => $paramList["orderId"],
  "amount" 	        => $tx_amount,
                'txn_fee'           => $tx_amount * ($this->tnx_fee / 100),                        "status" => 0,
                        "created" => NOW,
                    );

                    $transaction_log_id = $this->db->insert($this->tb_transaction_logs, $data_tnx_log);
$checkSum = PopsWebCheckSum::generateSignature($paramList,$secret);
	 
echo '<form method="post" action="' . $POPSWEB_TXN_URL . '" name="f1">
        <table border="1">
            <tbody>';
foreach($paramList as $name => $value) {
    echo '<input type="hidden" name="' . $name .'" value="' . $value . '">';
}
echo '<input type="hidden" name="checksum" value="' . $checkSum . '">
            </tbody>
        </table>
              <center> <input class="btn round btn-primary btn-min-width mr-1 mb-1" type="submit" value="Checkout"></center>

    </form>';

    }

    /**
     *
     * Call Execute payment after creating payment
     *
     */
    public function complete()
    {
include 'PopsWebCheckSum.php';
$verifySignature = '';
$array = array();
$paramList = array();


$secret = $this->sec_key; // Your Secret Key.
$status = $_POST['status']; // Its Payment Status Only, Not Txn Status.
$message = $_POST['message']; // Txn Message.
$cust_Mobile = $_POST['cust_Mobile']; // Txn Message.
$cust_Email = $_POST['cust_Email']; // Txn Message.
$hash = $_POST['hash']; // Encrypted Hash / Generated Only SUCCESS Status.
$checksum = $_POST['checksum'];  // Checksum verifySignature / Generated Only SUCCESS Status.
  $transaction = $this->model->get('*', $this->tb_transaction_logs, ['transaction_id' => $_GET["tr"], 'status' => 0, 'type' => $this->payment_type]);

        if (!$transaction) {
            redirect(cn("add_funds"));
        }

           
 if($status=="SUCCESS"){
	
$paramList = hash_decrypt($hash,$secret);
$verifySignature = PopsWebCheckSum::verifySignature($paramList, $secret, $checksum);

// Checksum verify.
if($verifySignature){
	$this->db->update($this->tb_transaction_logs, ['status' => 1, 'transaction_id' =>$_GET["tr"]],  ['id' => $transaction->id]);

			// Update Balance 
    
    	  $this->model->add_funds_bonus_email($transaction, $this->payment_id);
            

			redirect(cn("add_funds"));

		} else {
		    
			$this->db->update($this->tb_transaction_logs, ['status' => -1, 'transaction_id' =>$_GET["tr"]],  ['id' => $transaction->id]);
		;
			redirect(cn("add_funds/unsuccess"));
		}
   
}



    }

    
  
}

Function Calls

None

Variables

None

Stats

MD5 d5b350036e64e18d296ab5ed1635805d
Eval Count 0
Decode Time 44 ms