当前位置: 首页>>代码示例>>PHP>>正文


PHP payment::insert方法代码示例

本文整理汇总了PHP中payment::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP payment::insert方法的具体用法?PHP payment::insert怎么用?PHP payment::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在payment的用法示例。


在下文中一共展示了payment::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: payment

     $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";
     $payment_type->domain_id = '1';
     $payment->ac_payment_type = $payment_type->select_or_insert_where();
     $logger->log('ACH - payment_type=' . $payment->ac_payment_type, Zend_Log::INFO);
     $payment->insert();
     $invoiceobj = new invoice();
     $invoice = $invoiceobj->select($_POST['pg_consumerorderid']);
     $biller = getBiller($invoice['biller_id']);
     //send email
     $body = "A PaymentsGateway.com payment of " . $_POST['pg_total_amount'] . " was successfully received into Simple Invoices\n";
     $body .= "for invoice: " . $_POST['pg_consumerorderid'];
     $body .= " from " . $_POST['pg_billto_postal_name_company'] . " on " . date('m/d/Y');
     $body .= " at " . date('g:i A') . "\n\nDetails:\n";
     $body .= $paypal_data;
     $email = new email();
     $email->notes = $body;
     $email->to = $biller['email'];
     $email->from = "simpleinvoices@localhost.localdomain";
     $email->subject = 'PaymentsGateway.com -Instant Payment Notification - Recieved Payment';
     $email->send();
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:ach.php

示例2: payment

<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
# Deal with op and add some basic sanity checking
#insert - process payment
#op=pay_selected_invoice means the user came from the print_view or manage_invoces
#op=pay_invoice means the user came from the process_paymen page
global $db_server;
global $auth_session;
if (isset($_POST['process_payment'])) {
    $payment = new payment();
    $payment->ac_inv_id = $_POST['invoice_id'];
    $payment->ac_amount = $_POST['ac_amount'];
    $payment->ac_notes = $_POST['ac_notes'];
    $payment->ac_date = SqlDateWithTime($_POST['ac_date']);
    $payment->ac_payment_type = $_POST['ac_payment_type'];
    $result = $payment->insert();
    $saved = !empty($result) ? "true" : "false";
    if ($saved == 'true') {
        $display_block = $LANG['save_payment_success'];
    } else {
        $display_block = $LANG['save_payment_failure'] . "<br />" . $sql;
    }
    $refresh_total = "<meta http-equiv='refresh' content='27;url=index.php?module=payments&view=manage' />";
}
$smarty->assign('display_block', $display_block);
$smarty->assign('pageActive', 'payment');
$smarty->assign('active_tab', '#money');
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:29,代码来源:save.php

示例3: payment

 public function payment()
 {
     global $config;
     global $logger;
     //set customer,biller and preference if not defined
     if (empty($this->customer)) {
         $this->customer = getCustomer($this->invoice['customer_id'], $this->domain_id);
     }
     if (empty($this->biller)) {
         $this->biller = getBiller($this->invoice['biller_id'], $this->domain_id);
     }
     if (empty($this->preference)) {
         $this->preference = getPreference($this->invoice['preference_id'], $this->domain_id);
     }
     $eway = new ewaylib($this->biller['eway_customer_id'], 'REAL_TIME', false);
     //Eway only accepts amount in cents - so times 100
     $value = $this->invoice['total'] * 100;
     $eway_invoice_total = htmlsafe(trim($value));
     $logger->log("eway total: " . $eway_invoice_total, Zend_Log::INFO);
     $enc = new encryption();
     $key = $config->encryption->default->key;
     $credit_card_number = $enc->decrypt($key, $this->customer['credit_card_number']);
     $eway->setTransactionData("TotalAmount", $eway_invoice_total);
     //mandatory field
     $eway->setTransactionData("CustomerFirstName", $this->customer['name']);
     $eway->setTransactionData("CustomerLastName", "");
     $eway->setTransactionData("CustomerAddress", "");
     $eway->setTransactionData("CustomerPostcode", "");
     $eway->setTransactionData("CustomerInvoiceDescription", "");
     $eway->setTransactionData("CustomerEmail", $this->customer['email']);
     $eway->setTransactionData("CustomerInvoiceRef", $this->invoice['index_name']);
     $eway->setTransactionData("CardHoldersName", $this->customer['credit_card_holder_name']);
     //mandatory field
     $eway->setTransactionData("CardNumber", $credit_card_number);
     //mandatory field
     $eway->setTransactionData("CardExpiryMonth", $this->customer['credit_card_expiry_month']);
     //mandatory field
     $eway->setTransactionData("CardExpiryYear", $this->customer['credit_card_expiry_year']);
     //mandatory field
     $eway->setTransactionData("Option1", "");
     $eway->setTransactionData("Option2", "");
     $eway->setTransactionData("Option3", "");
     $eway->setTransactionData("TrxnNumber", $this->invoice['id']);
     //special preferences for php Curl
     //pass a long set to zero value stops curl from verifying peer's certificate
     $eway->setCurlPreferences(CURLOPT_SSL_VERIFYPEER, 0);
     $ewayResponseFields = $eway->doPayment();
     $this->message = $ewayResponseFields;
     $message = "";
     if ($ewayResponseFields["EWAYTRXNSTATUS"] == "False") {
         $logger->log("Transaction Error: " . $ewayResponseFields["EWAYTRXNERROR"] . "<br>\n", Zend_Log::INFO);
         foreach ($ewayResponseFields as $key => $value) {
             $message .= "\n<br>\$ewayResponseFields[\"{$key}\"] = {$value}";
         }
         $logger->log("Eway message: " . $message . "<br>\n", Zend_Log::INFO);
         //header("Location: trasnactionerrorpage.php");
         //exit();
         $return = 'false';
     } else {
         if ($ewayResponseFields["EWAYTRXNSTATUS"] == "True") {
             $logger->log("Transaction Success: " . $ewayResponseFields["EWAYTRXNERROR"] . "<br>\n", Zend_Log::INFO);
             foreach ($ewayResponseFields as $key => $value) {
                 $message .= "\n<br>\$ewayResponseFields[\"{$key}\"] = {$value}";
             }
             $logger->log("Eway message: " . $message . "<br>\n", Zend_Log::INFO);
             //header("Location: trasnactionsuccess.php");
             //exit();
             $payment = new payment();
             $payment->ac_inv_id = $this->invoice['id'];
             #$payment->ac_inv_id = $_POST['invoice'];
             $payment->ac_amount = $this->invoice['total'];
             #$payment->ac_amount = $ewayResponseFields['EWAYRETURNAMOUNT']/100;
             #$payment->ac_amount = $_POST['mc_gross'];
             $payment->ac_notes = $message;
             $payment->ac_date = date('Y-m-d');
             $payment->online_payment_id = $ewayResponseFields['EWAYTRXNNUMBER'];
             $payment->domain_id = $this->domain_id;
             $payment_type = new payment_type();
             $payment_type->type = "Eway";
             $payment_type->domain_id = $this->domain_id;
             $payment->ac_payment_type = $payment_type->select_or_insert_where();
             $logger->log('Paypal - payment_type=' . $payment->ac_payment_type, Zend_Log::INFO);
             $payment->insert();
             #echo $db->lastInsertID();
             $return = 'true';
         }
     }
     return $return;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:89,代码来源:eway.php


注:本文中的payment::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。