From 3995f8af9f7a15c5f7bb67a69c40fb6aecdf98a6 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 16 Feb 2023 14:36:53 +0100 Subject: [PATCH] donations.php --- donations/donations.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/donations/donations.php b/donations/donations.php index 77d2785..740b21e 100644 --- a/donations/donations.php +++ b/donations/donations.php @@ -23,4 +23,14 @@ function createDonation($amount) { return $result; } -var_dump(createDonation(50)); \ No newline at end of file +function forwardToDonationPage($amount){ + $payment_link = "https://dolibarr.romanschenk.ch/public/payment/newpayment.php?source=donation&ref=".(createDonation($amount))."&securekey=NSmKzZ73HW1zWO8nAlpdq95mDt77Q32o"; + header('Location: '.$payment_link); +} + +$amount = (float)($_GET["amount"]); +if(is_numeric($amount)) { + forwardToDonationPage($amount); +} else { + echo "invalid amount!"; +}