function _uc_recurring_hosted_paypal_ipn_is_duplicate in UC Recurring Payments and Subscriptions 7.2
Same name and namespace in other branches
- 6.2 modules/uc_recurring_hosted/uc_recurring_hosted.paypal_ipn.inc \_uc_recurring_hosted_paypal_ipn_is_duplicate()
Check if we have already recieved a IPN with the same details.
1 call to _uc_recurring_hosted_paypal_ipn_is_duplicate()
- _uc_recurring_hosted_paypal_ipn_validate in modules/
uc_recurring_hosted/ uc_recurring_hosted.paypal_ipn.inc - Validate Paypal IPN.
File
- modules/
uc_recurring_hosted/ uc_recurring_hosted.paypal_ipn.inc, line 284 - Handle paypal IPN callbacks for recurring payments
Code
function _uc_recurring_hosted_paypal_ipn_is_duplicate($ipn) {
if (isset($ipn->txn_id)) {
$duplicate = db_query("SELECT COUNT(*) FROM {uc_payment_paypal_ipn} WHERE txn_id = :txn_id AND txn_type = :txn_type AND status <> :status", array(
':txn_id' => $ipn->txn_id,
':txn_type' => $ipn->txn_type,
':status' => 'Pending',
))
->fetchField();
if ($duplicate > 0) {
watchdog('uc_recurring_hosted', 'IPN (Order:@order_id Txn: @txn_id) has been processed before.', array(
'@order_id' => $ipn->order_id,
'@txn_id' => $ipn->txn_id,
), WATCHDOG_NOTICE);
return TRUE;
}
}
return FALSE;
}