ini_set('display_errors','off'); include("settings/db_ini.php"); require 'phpaction/send_mail.php'; include '../include/conf.php'; include '../include/generate_oc_no.php'; require 'config.php'; require 'razorpay-php/Razorpay.php'; use Razorpay\Api\Api; use Razorpay\Api\Errors\SignatureVerificationError; $success = true; $error = "Payment Failed"; if (empty($_POST['razorpay_payment_id']) === false) { $api = new Api($keyId, $keySecret); try { // Please note that the razorpay order ID must // come from a trusted source (session here, but // could be database or something else) $attributes = array( 'razorpay_order_id' => $_SESSION['razorpay_order_id'], 'razorpay_payment_id' => $_POST['razorpay_payment_id'], 'razorpay_signature' => $_POST['razorpay_signature'], ); $api->utility->verifyPaymentSignature($attributes); } catch (SignatureVerificationError $e) { $success = false; $error = 'Razorpay Error : ' . $e->getMessage(); } } if ($success === true) { $razorpay_order_id = $_SESSION['razorpay_order_id']; $razorpay_payment_id = $_POST['razorpay_payment_id']; $email = $_SESSION['email']; $price = $_SESSION['price']; $msg_to_verify = $_SESSION['msg_to_verify']; $subject_to_verify = $_SESSION['subject_to_verify']; $subject = $subject_to_verify.' / '.$razorpay_payment_id; $table_gmail = '
Payment Id |
---|
'.$razorpay_payment_id.' |
|
Online Consultation Details | |||||||||||
ENERGY Foods #11,2nd Street, Radha Nagar Extn. Velachery,Chennai 600 042. State :Tamilnadu Code:33 Phone:044-2253 1316 Email : drganbuganapathi@gmail.com Website : www.drganbuganapathi.com |
GSTIN:33ACMPA1286A2Z7 PAN:ACMPA1286A Receipt No : OC-'.$tot_order_id.' Payment Mode-Payumoney |
Name:'.$firstname.' | Phone:'.$mobss.' | Age:'.$age.' | Date:'.$ap_date.' |
Consulting For:'.$consulting_for.' | Country:'.$country.' | Speak:'.$language.' | Time:'.$ap_hour.':'.$ap_min.''.$ap_sec.' |
Address: '.$user_address.' '.$user_city.' '.$user_state.'-'.$user_postcode.'.'.$user_country.' |
Fees:'.$amount.' |
Your payment was successful
Payment ID: {$_POST['razorpay_payment_id']}
"; } else { $html = "Your payment failed
{$error}
"; } $html; ?> if ($success === true) { ?>