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!"; +}