/
/
home
/
u523034047
/
domains
/
psassociate.org
/
public_html
/
phonepe
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.60
PHP 8.3.16
Dir:
/home/u523034047/domains/psassociate.org/public_html/phonepe
Edit:
/home/u523034047/domains/psassociate.org/public_html/phonepe/success.php
<?php /** * phonepe/success.php * Payment confirmation — standalone, proper A4 print, professional design. * Sends emails on first load. */ session_start(); require_once __DIR__ . '/phonepe_config.php'; // Helper: If session lost, recover via API Metadata if (empty($_SESSION['career']) || empty($_SESSION['career']['payment_status']) || $_SESSION['career']['payment_status'] !== 'SUCCESS') { $orderId = $_GET['merchantOrderId'] ?? $_SESSION['career']['order_id'] ?? ''; if (!empty($orderId)) { $token = getPhonePeToken(); $statusUrl = PHONEPE_STATUS_URL . '/' . urlencode($orderId) . '/status'; $ch = curl_init($statusUrl); curl_setopt_array($ch, [ CURLOPT_HTTPGET => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Authorization: O-Bearer ' . $token], CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_TIMEOUT => 30, ]); $response = curl_exec($ch); curl_close($ch); $res = json_decode($response, true); if (($res['state'] ?? '') === 'COMPLETED') { $meta = parseUdfData($res['metaInfo'] ?? []); if (!empty($meta)) { $_SESSION['career'] = $meta; $_SESSION['career']['order_id'] = $orderId; $_SESSION['career']['transaction_id'] = $res['orderId'] ?? $orderId; $_SESSION['career']['payment_status'] = 'SUCCESS'; } } } } // Final safety check if (!isset($_SESSION['career']) || empty($_SESSION['career']['payment_status']) || $_SESSION['career']['payment_status'] !== 'SUCCESS') { header("Location: ../post-resume.php"); exit; } $career = $_SESSION['career']; // Send emails ONCE if (empty($career['emails_sent'])) { $orderId = $career['order_id'] ?? ''; $planAmount = $career['plan_amount'] ?? 0; $planType = $career['plan_type'] ?? 'Unknown'; $paymentDate = $career['payment_date'] ?? date('d M Y, h:i A'); $resumeLink = "https://psassociate.org/admin/Career/" . ($career['resume'] ?? ''); $adminSubject = "New Resume + Rs.{$planAmount} Payment - " . ($career['name'] ?? 'User'); $adminBody = "New Resume Submission\n---------------------\n\n"; $adminBody .= "Name: " . ($career['name'] ?? '') . "\nEmail: " . ($career['email'] ?? '') . "\n"; $adminBody .= "Mobile: " . ($career['mobile'] ?? '') . "\nGender: " . ($career['gender'] ?? '') . "\n"; $adminBody .= "State: " . ($career['state'] ?? '') . "\nCity: " . ($career['city'] ?? '') . "\n"; $adminBody .= "Qualification: " . ($career['studying'] ?? '') . "\n\n"; $adminBody .= "Payment\n-------\nOrder ID: {$orderId}\nPlan: {$planType}\n"; $adminBody .= "Amount: Rs." . number_format($planAmount) . "\nDate: {$paymentDate}\nStatus: Paid\n\n"; $adminBody .= "Resume: {$resumeLink}\n"; sendEmail(ADMIN_EMAIL, $adminSubject, $adminBody, $career['email'] ?? ''); if (!empty($career['email'])) { $userSubject = "Payment Confirmation - PS Associate"; $userBody = "Hi " . ($career['name'] ?? '') . ",\n\nYour payment is confirmed.\n\n"; $userBody .= "Order ID: {$orderId}\nPlan: {$planType}\nAmount: Rs." . number_format($planAmount) . "\n"; $userBody .= "Date: {$paymentDate}\n\nOur team will review your resume and contact you.\n\n"; $userBody .= "PS Associate\nPhone: +91 9452530458\nEmail: psassociate@zohomail.in\n"; sendEmail($career['email'], $userSubject, $userBody, ADMIN_EMAIL); } $_SESSION['career']['emails_sent'] = true; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Success! Your Career Journey Starts Here - PS Associate</title> <link rel="shortcut icon" href="../ico-images/u.ico" type="image/x-icon" /> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script> <style> :root { --success: #22c55e; --success-dark: #16a34a; --primary: #5f259f; --bg: #f8fafc; --text: #0f172a; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; } .container { width: 100%; max-width: 600px; animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1); } @keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } } .receipt-card { background: #fff; border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05); overflow: hidden; position: relative; } .receipt-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(to right, var(--success), var(--primary)); } .header { padding: 40px 30px; text-align: center; background: linear-gradient(to bottom, #f0fdf4, #fff); } .check-circle { width: 80px; height: 80px; background: var(--success); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: #fff; box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3); animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s backwards; } @keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } } .header h1 { font-size: 26px; font-weight: 800; color: #1e293b; margin-bottom: 8px; } .header p { font-size: 15px; color: #64748b; font-weight: 500; } .content { padding: 30px; } .price-sticker { text-align: center; padding: 24px; background: #f8fafc; border-radius: 20px; margin-bottom: 30px; border: 1px dashed #e2e8f0; } .price-sticker label { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.5px; } .price-sticker .val { font-size: 38px; font-weight: 900; color: var(--success-dark); margin: 4px 0; } .price-sticker .plan { font-size: 14px; color: var(--primary); font-weight: 600; } .details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; } .detail-item { display: flex; flex-direction: column; gap: 4px; } .detail-item label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; } .detail-item span { font-size: 14px; font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; } .info-pill { background: #eff6ff; border: 1px solid #dbeafe; padding: 16px; border-radius: 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 30px; } .info-pill svg { color: var(--primary); flex-shrink: 0; } .info-pill p { font-size: 13px; color: #1e40af; font-weight: 500; line-height: 1.4; } .actions { display: flex; gap: 12px; } .btn { flex: 1; padding: 16px; border-radius: 14px; font-size: 14px; font-weight: 700; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; cursor: pointer; border: none; } .btn-print { background: #f1f5f9; color: #475569; } .btn-print:hover { background: #e2e8f0; } .btn-home { background: var(--text); color: #fff; } .btn-home:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); } .footer { margin-top: 24px; text-align: center; font-size: 13px; color: #94a3b8; } @media print { .actions, .celebrate, .no-print { display: none !important; } body { padding: 0; background: #fff; } .receipt-card { box-shadow: none; border: 1px solid #eee; } } @media (max-width: 480px) { .details-grid { grid-template-columns: 1fr; gap: 15px; } .header { padding: 30px 20px; } .actions { flex-direction: column; } } </style> </head> <body> <div class="container"> <div class="receipt-card"> <div class="header"> <div class="check-circle"> <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"> <polyline points="20 6 9 17 4 12" /> </svg> </div> <h1>Order Confirmed!</h1> <p>Welcome to the PS Associate family</p> </div> <div class="content"> <div class="price-sticker"> <label>Amount Paid</label> <div class="val"><?php echo htmlspecialchars($career['payment_amount'] ?? ''); ?></div> <div class="plan"><?php echo htmlspecialchars($career['plan_type'] ?? ''); ?> Premium Support</div> </div> <div class="details-grid"> <div class="detail-item"> <label>Application ID</label> <span>#<?php echo substr($career['order_id'] ?? '', -8); ?></span> </div> <div class="detail-item"> <label>Full Name</label> <span><?php echo htmlspecialchars($career['name'] ?? ''); ?></span> </div> <div class="detail-item"> <label>Date & Time</label> <span><?php echo htmlspecialchars($career['payment_date'] ?? date('d M, Y')); ?></span> </div> <div class="detail-item"> <label>Resume File</label> <span><?php echo htmlspecialchars($career['resume'] ?? 'Uploaded'); ?></span> </div> </div> <div class="info-pill"> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" /> <polyline points="22,6 12,13 2,6" /> </svg> <span>A detailed receipt and confirmation has been dispatched to <strong><?php echo htmlspecialchars($career['email'] ?? ''); ?></strong>. For any support, contact <strong>+91 9452530458</strong></span> </div> <div class="actions no-print"> <button class="btn btn-print" onclick="window.print()"> <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <polyline points="6 9 6 2 18 2 18 9" /> <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" /> <rect x="6" y="14" width="12" height="8" /> </svg> Print Receipt </button> <a href="#" class="btn btn-home" onclick="goHome(event)"> Complete Enrollment <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <path d="M5 12h14M12 5l7 7-7 7" /> </svg> </a> </div> </div> </div> <div class="footer"> Transaction Secured via 256-bit Encryption • PS Associate • +91 9452530458 </div> </div> <script> // Trigger celebration window.addEventListener('load', function () { const count = 200; const defaults = { origin: { y: 0.7 } }; function fire(particleRatio, opts) { confetti({ ...defaults, ...opts, particleCount: Math.floor(count * particleRatio) }); } fire(0.25, { spread: 26, startVelocity: 55 }); fire(0.2, { spread: 60 }); fire(0.35, { spread: 100, decay: 0.91, scalar: 0.8 }); fire(0.1, { spread: 120, startVelocity: 25, decay: 0.92, scalar: 1.2 }); fire(0.1, { spread: 120, startVelocity: 45 }); }); function goHome(e) { e.preventDefault(); fetch('destroy_session.php').finally(() => { window.location.href = '../index.php'; }); } </script> </body> </html>
Ukuran: 14.9 KB