本文整理匯總了PHP中payment::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP payment::count方法的具體用法?PHP payment::count怎麽用?PHP payment::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類payment
的用法示例。
在下文中一共展示了payment::count方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
$logger->log('ACH API page called', Zend_Log::INFO);
if ($_POST['pg_response_code'] == 'A01') {
$logger->log('ACH validate success', Zend_Log::INFO);
//insert into payments
$paypal_data = "";
foreach ($_POST as $key => $value) {
$paypal_data .= "\n{$key}: {$value}";
}
$logger->log('ACH Data:', Zend_Log::INFO);
$logger->log($paypal_data, Zend_Log::INFO);
$check_payment = new payment();
$check_payment->filter = 'online_payment_id';
$check_payment->online_payment_id = $_POST['pg_consumerorderid'];
$check_payment->domain_id = '1';
$number_of_payments = $check_payment->count();
$logger->log('ACH - number of times this payment is in the db: ' . $number_of_payments, Zend_Log::INFO);
if ($number_of_payments > 0) {
$xml_message = 'Online payment for invoices: ' . $_POST['pg_consumerorderid'] . ' has already been entered into Simple Invoices';
$logger->log($xml_message, Zend_Log::INFO);
}
if ($number_of_payments == '0') {
$payment = new payment();
$payment->ac_inv_id = $_POST['pg_consumerorderid'];
$payment->ac_amount = $_POST['pg_total_amount'];
$payment->ac_notes = $paypal_data;
$payment->ac_date = date('Y-m-d');
$payment->online_payment_id = $_POST['pg_consumerorderid'];
$payment->domain_id = '1';
$payment_type = new payment_type();
$payment_type->type = "ACH";