ocs  2.3.6
About: OCS (Open Conference System) is a Web publishing tool that will create a complete Web presence for your scholarly conference.
  Fossies Dox: ocs-2.3.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

PayPalDAO.inc.php
Go to the documentation of this file.
1 <?php
2 
17 //$Id$
18 
19 import('db.DAO');
20 
21 class PayPalDAO extends DAO {
22 
26  function PayPalDAO() {
27  parent::DAO();
28  }
29 
30  /*
31  * Insert a payment into the payments table
32  */
33  function insertTransaction($txn_id, $txn_type, $payer_email, $receiver_email, $item_number, $payment_date, $payer_id, $receiver_id) {
34  $ret = $this->update(
35  sprintf('INSERT INTO paypal_transactions (
36  txn_id,
37  txn_type,
38  payer_email,
39  receiver_email,
40  item_number,
41  payment_date,
42  payer_id,
43  receiver_id)
44  VALUES
45  (?, ?, ?, ?, ?, %s, ?, ?)',
46  $this->datetimeToDB($payment_date)
47  ),
48  array(
49  $txn_id,
50  $txn_type,
51  $payer_email,
52  $receiver_email,
53  $item_number,
54  $payer_id,
55  $receiver_id
56  )
57  );
58 
59  return true;
60  }
61 
62  function transactionExists($txn_id) {
63  $result =& $this->retrieve(
64  'SELECT count(*)
65  FROM paypal_transactions
66  WHERE txn_id = ?',
67  array($txn_id)
68  );
69 
70  $returner = false;
71  if (isset($result->fields[0]) && $result->fields[0] >= 1)
72  $returner = true;
73 
74  $result->Close();
75  return $returner;
76  }
77 }
78 
79 ?>
config TEMPLATE inc php
Definition: config.inc.php:4
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:30
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:62
transactionExists($txn_id)
insertTransaction($txn_id, $txn_type, $payer_email, $receiver_email, $item_number, $payment_date, $payer_id, $receiver_id)
datetimeToDB($dt)
Definition: DAO.inc.php:258
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:186
Class for PayPal Logging DAO. Operations for retrieving and modifying Transactions objects.