[guadec-web] Refining the update query
- From: Saumya Dwivedi <saumyad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [guadec-web] Refining the update query
- Date: Wed, 9 Jul 2014 09:36:35 +0000 (UTC)
commit 04e05cf8e4eda3c12230cde7e3771b08469cc552
Author: Saumya Dwivedi <saumya zero gmail com>
Date: Wed Jul 9 15:05:47 2014 +0530
Refining the update query
guadec/ipn.php | 2 +-
guadec/ipnlistener.php | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/guadec/ipn.php b/guadec/ipn.php
index 0a8c864..c9d6c12 100755
--- a/guadec/ipn.php
+++ b/guadec/ipn.php
@@ -97,7 +97,7 @@ if ($verified) {
mail($_POST['payer_email'], 'GUADEC-2014 Registration Payment:Waiting for Confirmation', $body,
$headers);
} else {
- $body = $listener->updateCompleted($reg_email, $_POST['payment_status']);
+ $body = $listener->updateCompleted($reg_email, 'Completed');
$body .= "Registration Payment Successful for ";
$body .= $cvar['name'];
$body .= " with email ";
diff --git a/guadec/ipnlistener.php b/guadec/ipnlistener.php
index cd353ad..eb197ca 100755
--- a/guadec/ipnlistener.php
+++ b/guadec/ipnlistener.php
@@ -317,20 +317,21 @@ class IpnListener {
public function updateCompleted($reg_email='dummy mail com', $status='Pending') {
global $wpdb;
$table_name = $wpdb->prefix .'guadec2014_registrations';
+ // check if the record exists: with a status to be changed
$up = $wpdb->update(
$table_name,
array(
- 'payment' => 'Completed'
+ 'payment' => $status
),
array(
'email' => $reg_email
)
);
- if(!($up)){
- throw new Exception("Database Error: Not Updated");
- }
- return (var_dump(($wpdb)));
+ // if(!($up)){
+ // throw new Exception("Database Error: Not Updated");
+ // }
+ // return (var_dump(($wpdb)));
}
}
?>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]