diff --git a/public_html/classes/paymentrequest.php b/public_html/classes/paymentrequest.php index 053a739..68a431c 100644 --- a/public_html/classes/paymentrequest.php +++ b/public_html/classes/paymentrequest.php @@ -18,6 +18,7 @@ class PaymentRequest extends CPHPDatabaseRecordClass public $table_name = "payment_requests"; public $fill_query = "SELECT * FROM payment_requests WHERE `Id` = :Id"; public $verify_query = "SELECT * FROM payment_requests WHERE `Id` = :Id"; + public $query_cache = 0; public $prototype = array( 'string' => array( diff --git a/public_html/modules/payment/bitcoin.php b/public_html/modules/payment/bitcoin.php new file mode 100644 index 0000000..af03253 --- /dev/null +++ b/public_html/modules/payment/bitcoin.php @@ -0,0 +1,38 @@ +sCampaign->GetPaymentMethod(PaymentMethod::BITCOIN); +} +catch (NotFoundException $e) +{ + throw new RouterException("No such payment method found."); +} + +if($sPaymentRequest->sCurrency != "btc") +{ + $sAmount = Currency::Convert("btc", $sPaymentRequest->sCurrency, $sPaymentRequest->sAmount); +} +else +{ + $sAmount = $sPaymentRequest->sAmount; +} + +$sPageContents = NewTemplater::Render("payment/bitcoin", $locale->strings, array( + "address" => $sPaymentMethod->sAddress, + "amount" => Currency::Format("btc", $sAmount), + "done-url" => "/pay/{$sPaymentRequest->sSubscription->sEmailAddress}/{$sPaymentRequest->sId}/{$sPaymentRequest->sKey}/bitcoin/done" +)); diff --git a/public_html/modules/payment/other.php b/public_html/modules/payment/other.php new file mode 100644 index 0000000..b705152 --- /dev/null +++ b/public_html/modules/payment/other.php @@ -0,0 +1,31 @@ + $sPaymentRequest->sCampaign->sId, ":Id" => $router->uParameters[4]), 0, true); +} +catch (NotFoundException $e) +{ + throw new RouterException("No such payment method found."); +} + +$sPageContents = NewTemplater::Render("payment/other", $locale->strings, array( + "name" => $sPaymentMethod->sCustomName, + "address" => $sPaymentMethod->sAddress, + "amount" => Currency::Format($sPaymentRequest->sCurrency, $sPaymentRequest->sAmount), + "done-url" => "/pay/{$sPaymentRequest->sSubscription->sEmailAddress}/{$sPaymentRequest->sId}/{$sPaymentRequest->sKey}/{$sPaymentMethod->sId}/done" +)); diff --git a/public_html/templates/payment/bitcoin.tpl b/public_html/templates/payment/bitcoin.tpl new file mode 100644 index 0000000..e4a1982 --- /dev/null +++ b/public_html/templates/payment/bitcoin.tpl @@ -0,0 +1,18 @@ +
+

Donate using Bitcoin

+ +

+ Please send {%?amount} to the address {%?address}. +

+ +

+ We cannot automatically detect when you've sent your donation. To help us improve our statistics, + please click the button below after you've donated. +

+ +

+

+ +
+

+
diff --git a/public_html/templates/payment/other.tpl b/public_html/templates/payment/other.tpl new file mode 100644 index 0000000..18ab62a --- /dev/null +++ b/public_html/templates/payment/other.tpl @@ -0,0 +1,19 @@ +
+

Donate using {%?name}

+ +

+ Please send {%?amount} to this address or account number:
+ {%?address}. +

+ +

+ We cannot automatically detect when you've sent your donation. To help us improve our statistics, + please click the button below after you've donated. +

+ +

+

+ +
+

+