Esempio n. 1
0
<?php

// Include the composer autoload file
include_once "../vendor/autoload.php";
include_once "settings.php";
$ccavenue = new \Ccavenue\CCAvenue();
$aes = new \Ccavenue\AESCrypt();
if ($segment->get('user_plan') != '' && $segment->get('phone_number') != '') {
    $plan = $capsule::table('couponplans')->where('id', '=', $hashids->decode($segment->get('user_plan')))->first();
    $order_id = 'OvalWiFi-' . \Carbon\Carbon::now()->format('YMd-Hi');
    $merchant_id = getenv('CCAVENUE_MERCHANT_KEY');
    $amount = $plan['price'];
    $url = urlencode(Config::$site_url . 'confirm-payment.php');
    $url_cancel = urlencode(Config::$site_url . 'cancel.php');
    $working_key = getenv('CCAVENUE_WORKING_KEY');
    $access_code = getenv('CCAVENUE_ACCESS_CODE');
    $merchant_data = '';
    $merchant_data .= 'tid=' . $segment->get('tid');
    $merchant_data .= '&merchant_id=' . $merchant_id;
    $merchant_data .= '&order_id=' . $order_id;
    $merchant_data .= '&amount=' . $amount;
    $merchant_data .= '&currency=' . 'INR';
    $merchant_data .= '&redirect_url=' . $url;
    $merchant_data .= '&cancel_url=' . $url_cancel;
    $merchant_data .= '&language=' . 'EN';
    $merchant_data .= '&customer_identifier=' . $segment->get('phone_number');
    // $merchant_data .= '&billing_name=""';
    // $merchant_data .= '&billing_address=""';
    // $merchant_data .= '&billing_city=""';
    // $merchant_data .= '&billing_state=""';
    // $merchant_data .= '&billing_zip=""';
Esempio n. 2
0
<?php

// Include the composer autoload file
include_once "../vendor/autoload.php";
include_once "settings.php";
$ccavenue = new \Ccavenue\CCAvenue();
$aes = new \Ccavenue\AESCrypt();
$encResponse = $_POST['encResp'];
$workingKey = getenv('CCAVENUE_WORKING_KEY');
$decrypted_response = $aes->decrypt($encResponse, $workingKey);
$ResponseBreakUp = explode('&', $decrypted_response);
$dataSize = sizeof($ResponseBreakUp);
for ($i = 0; $i < $dataSize; $i++) {
    $information = explode('=', $ResponseBreakUp[$i]);
    if ($i == 0) {
        $MerchantId = $information[1];
    }
    if ($i == 1) {
        $OrderId = $information[1];
    }
    if ($i == 2) {
        $Amount = $information[1];
    }
    if ($i == 3) {
        $AuthDesc = $information[1];
    }
    if ($i == 4) {
        $Checksum = $information[1];
    }
}
/*