Add poll system for Patrons Circle

This commit is contained in:
Alex Cabal 2022-06-29 16:51:45 -05:00
parent 3555d53615
commit 2ef5ce6551
44 changed files with 717 additions and 98 deletions

View file

@ -17,7 +17,7 @@ $lastPushHashFlag = '';
try{
$log->Write('Received GitHub webhook.');
if($_SERVER['REQUEST_METHOD'] != 'POST'){
if(HttpInput::RequestMethod() != HTTP_POST){
throw new Exceptions\WebhookException('Expected HTTP POST.');
}

View file

@ -15,7 +15,7 @@ try{
$log->Write('Received Postmark webhook.');
if($_SERVER['REQUEST_METHOD'] != 'POST'){
if(HttpInput::RequestMethod() != HTTP_POST){
throw new Exceptions\WebhookException('Expected HTTP POST.');
}
@ -36,7 +36,7 @@ try{
// Received when a user marks an email as spam
$log->Write('Event type: spam complaint.');
Db::Query('delete from NewsletterSubscribers where Email = ?', [$post->Email]);
Db::Query('DELETE from NewsletterSubscribers where Email = ?', [$post->Email]);
}
elseif($post->RecordType == 'SubscriptionChange' && $post->SuppressSending){
// Received when a user clicks Postmark's "Unsubscribe" link in a newsletter email
@ -45,7 +45,7 @@ try{
$email = $post->Recipient;
// Remove the email from our newsletter list
Db::Query('delete from NewsletterSubscribers where Email = ?', [$email]);
Db::Query('DELETE from NewsletterSubscribers where Email = ?', [$email]);
// Remove the suppression from Postmark, since we deleted it from our own list we will never email them again anyway
$handle = curl_init();

View file

@ -1,6 +1,7 @@
<?
require_once('Core.php');
use Safe\DateTime;
use function Safe\file_get_contents;
use function Safe\preg_match;
use function Safe\preg_replace;
@ -15,7 +16,7 @@ $log = new Log(ZOHO_WEBHOOK_LOG_FILE_PATH);
try{
$log->Write('Received Zoho webhook.');
if($_SERVER['REQUEST_METHOD'] != 'POST'){
if(HttpInput::RequestMethod() != HTTP_POST){
throw new Exceptions\WebhookException('Expected HTTP POST.');
}
@ -53,7 +54,7 @@ try{
$payment->Create();
}
else{
Db::Query('insert into PendingPayments (Timestamp, ChannelId, TransactionId) values (utc_timestamp(), ?, ?);', [PAYMENT_CHANNEL_FA, $transactionId]);
Db::Query('INSERT into PendingPayments (Timestamp, ChannelId, TransactionId) values (utc_timestamp(), ?, ?);', [PAYMENT_CHANNEL_FA, $transactionId]);
}
$log->Write('Donation ID: ' . $transactionId);