Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
PayPalDAO.inc.php
1 <?php
2 
16 import('lib.pkp.classes.db.DAO');
17 
18 class PayPalDAO extends DAO {
22  function PayPalDAO() {
23  parent::DAO();
24  }
25 
37  function insertTransaction($txnId, $txnType, $payerEmail, $receiverEmail, $itemNumber, $paymentDate, $payerId, $receiverId) {
38  $ret = $this->update(
39  sprintf(
40  'INSERT INTO paypal_transactions (
41  txn_id,
42  txn_type,
43  payer_email,
44  receiver_email,
45  item_number,
46  payment_date,
47  payer_id,
48  receiver_id
49  ) VALUES (
50  ?, ?, ?, ?, ?, %s, ?, ?
51  )',
52  $this->datetimeToDB($paymentDate)
53  ),
54  array(
55  $txnId,
56  $txnType,
57  $payerEmail,
58  $receiverEmail,
59  $itemNumber,
60  $payerId,
61  $receiverId
62  )
63  );
64 
65  return true;
66  }
67 
73  function transactionExists($txnId) {
74  $result =& $this->retrieve(
75  'SELECT count(*) FROM paypal_transactions WHERE txn_id = ?',
76  array($txnId)
77  );
78 
79  $returner = false;
80  if (isset($result->fields[0]) && $result->fields[0] >= 1) $returner = true;
81 
82  $result->Close();
83  return $returner;
84  }
85 }
86 
87 ?>
Operations for retrieving and modifying objects from a database.
Definition: DAO.inc.php:29
transactionExists($txnId)
& retrieve($sql, $params=false, $callHooks=true)
Definition: DAO.inc.php:83
datetimeToDB($dt)
Definition: DAO.inc.php:296
update($sql, $params=false, $callHooks=true, $dieOnError=true)
Definition: DAO.inc.php:211
insertTransaction($txnId, $txnType, $payerEmail, $receiverEmail, $itemNumber, $paymentDate, $payerId, $receiverId)
Operations for retrieving and modifying Transactions objects.