Thank you, Friend.
Your generosity funds real care for real patients. Here’s a summary of your donation for your records.
Generating…
—
—
General Fund
Chemo medication, funded
Your donation covers one full round of essential chemotherapy medication for a patient who cannot afford it.
An 80G donation receipt (PDF) has been emailed to your inbox. It may take a few minutes to arrive — please check your spam folder if you don’t see it.
We couldn’t confirm this donation automatically.
This can happen if you refreshed this page, opened it without completing checkout, or came back after a delay. Don’t worry — if your payment did go through, it’s already been recorded and your receipt is on its way by email regardless of what this page shows.
Check your email for a receipt from donations@vhhf.org.in. If it’s been more than 30 minutes and you don’t see one but you were charged, contact us directly — we can look up your payment by phone number or card/UPI reference.
/**
* Real production logic: looks up the donation via the server-side,
* webhook-verified REST endpoint (see
* includes/class-vhhf-dc-public-api.php) rather than trusting the
* URL alone. Falls back to the honest “couldn’t confirm” state if
* no matching verified record is found.
*
* REST endpoint (once the plugin is active on your live site):
* GET /wp-json/vhhf-dc/v1/donation-summary?payment_id=pay_XXXXXXXX
*
* Configure Razorpay’s Payment Button “Post payment experience”
* redirect to point here, e.g.:
* https://yourdomain.com/thank-you/?razorpay_payment_id={payment_id}
* (check your installed plugin version’s exact redirect-URL templating
* syntax — some versions append razorpay_payment_id automatically on
* successful redirect without needing a template token at all).
*/
(function () {
var params = new URLSearchParams(window.location.search);
var paymentId = params.get(‘razorpay_payment_id’);
var successEl = document.getElementById(‘success-state’);
var errorEl = document.getElementById(‘error-state’);
var IMPACT_MAP = {
500: { title: ‘One screening, funded’, text: ‘Your ₹500 funds one cancer screening test for someone who couldn’t otherwise access early detection.’ },
1500: { title: ‘Chemo medication, funded’, text: ‘Your ₹1,500 covers one full round of essential chemotherapy medication for a patient who cannot afford it.’ },
5000: { title: ‘A week of home care, funded’, text: ‘Your ₹5,000 sponsors a full week of home-based palliative care for a patient in advanced stages.’ }
};
function showFallback() {
successEl.classList.add(‘hidden’);
errorEl.classList.add(‘visible’);
}
function renderDonation(donation) {
document.getElementById(‘donor-first-name’).textContent = donation.donor_first_name;
document.getElementById(‘display-amount’).textContent = ‘₹’ + donation.amount.toLocaleString(‘en-IN’);
document.getElementById(‘display-frequency’).textContent = donation.frequency === ‘monthly’ ? ‘Monthly recurring donation’ : ‘One-time donation’;
document.getElementById(‘display-receipt-number’).textContent = donation.receipt_number;
document.getElementById(‘display-payment-id’).textContent = donation.payment_id;
document.getElementById(‘display-date’).textContent = donation.date;
document.getElementById(‘display-purpose’).textContent = donation.purpose;
document.getElementById(‘display-email’).textContent = donation.receipt_sent ? ‘your inbox’ : ‘your inbox shortly’;
var impact = IMPACT_MAP[donation.amount];
if (impact) {
document.getElementById(‘impact-title’).textContent = impact.title;
document.getElementById(‘impact-text’).textContent = impact.text;
}
}
if (!paymentId) {
// No payment_id in the URL at all. In production this is correct
// fallback behaviour for a visitor landing here without one.
//
// PREVIEW EXCEPTION: since this static file has no live WP REST
// API to call, default to showing the success design so you can
// review it — use the bottom-right toggle button to see the
// fallback state instead. Remove the isPreviewFile check below
// once this is a real page on your WordPress site.
var isPreviewFile = window.location.protocol === ‘file:’ || window.location.hostname === ” || window.location.hostname === ‘localhost’;
if (isPreviewFile) {
renderDonation({
donor_first_name: ‘Aisha’,
amount: 1500,
frequency: ‘once’,
receipt_number: ‘VHHF/2026-27/000482’,
payment_id: ‘pay_QX7k9mZLbR2s4T’,
date: new Date().toLocaleDateString(‘en-IN’, { day: ‘numeric’, month: ‘long’, year: ‘numeric’ }),
purpose: ‘Treatment Support Fund’,
receipt_sent: true,
});
return;
}
showFallback();
return;
}
var apiBase = window.location.origin; // On the real site this resolves to your WP domain.
fetch(apiBase + ‘/wp-json/vhhf-dc/v1/donation-summary?payment_id=’ + encodeURIComponent(paymentId))
.then(function (res) {
if (!res.ok) throw new Error(‘not_found’);
return res.json();
})
.then(function (donation) {
renderDonation(donation);
})
.catch(function () {
showFallback();
});
})();