本文整理汇总了PHP中unknown_type::getPayment方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown_type::getPayment方法的具体用法?PHP unknown_type::getPayment怎么用?PHP unknown_type::getPayment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown_type
的用法示例。
在下文中一共展示了unknown_type::getPayment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _paymentMethodCode
/**
* @since 0.0.2
* @param unknown_type $order
*/
protected function _paymentMethodCode($order)
{
return $order->getPayment()->getMethod();
}
示例2: getDetailsForOrder
/**
* Retourne sous la forme de texte les détails pour une commande
*
* @param unknown_type $order
*/
public function getDetailsForOrder($order, $ShowInvoiceShipment = true)
{
//gernere la chaine et retourne
$retour = '';
$retour .= '' . mage::helper('Orderpreparation')->__('Total') . ': ' . number_format($order->getgrand_total(), 2);
$retour .= "<br>Date: " . mage::helper('core')->formatDate($order->getcreated_at(), 'long');
//Définit l'etat du paiement
$retour .= "<br>" . mage::helper('Orderpreparation')->__('Payment') . ": ";
if ($order->getpayment_validated() == 1) {
$retour .= '<font color="green">' . mage::helper('Orderpreparation')->__('Yes') . '</font>';
} else {
$retour .= '<font color="red">' . mage::helper('Orderpreparation')->__('No') . '</font>';
}
$retour .= "<br>" . mage::helper('Orderpreparation')->__('Status') . ": " . $order->getstatus();
$retour .= "<br>" . mage::helper('Orderpreparation')->__('Carrier') . ": " . $order->getshipping_description();
if ($order->getPayment()) {
$retour .= "<br>" . mage::helper('Orderpreparation')->__('Payment') . ": " . $order->getPayment()->getMethodInstance()->gettitle();
}
if ($ShowInvoiceShipment) {
$OrderToPrepare = mage::getModel('Orderpreparation/ordertoprepare')->load($order->getId(), 'order_id');
if ($OrderToPrepare) {
$invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($OrderToPrepare->getinvoice_id());
$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($OrderToPrepare->getshipment_id());
if ($OrderToPrepare->getinvoice_id() != '') {
$retour .= '<br>' . mage::helper('Orderpreparation')->__('Invoice') . ': <a target="_new" href="' . Mage::helper('adminhtml')->getUrl('adminhtml/sales_order_invoice/print', array('invoice_id' => $invoice->getId())) . '"> ' . $OrderToPrepare->getinvoice_id() . '</a>';
}
if ($OrderToPrepare->getshipment_id()) {
$retour .= '<br>' . mage::helper('Orderpreparation')->__('Shipment') . ': <a target="_new" href="' . Mage::helper('adminhtml')->getUrl('adminhtml/sales_order_shipment/print', array('invoice_id' => $shipment->getId())) . '"> ' . $OrderToPrepare->getshipment_id() . '</a>';
}
}
//Rajoute les no de tracking
$tracking_txt = '';
foreach ($order->getTracksCollection() as $track) {
$obj = $track->getNumberDetail();
if (is_object($obj)) {
$tracking_txt .= $track->getNumberDetail()->gettracking() . '<br>';
} else {
if (is_array($obj)) {
$tracking_txt .= $obj["number"] . '<br>';
} else {
$tracking_txt .= $obj . '<br>';
}
}
}
if ($tracking_txt != '') {
$retour .= "<br>Tracking: " . $tracking_txt;
}
}
return $retour;
}
示例3: _updateInvoices
/**
* Set the invoice status to "Paid" after a successful payment
*
* @param unknown_type $order
*/
private function _updateInvoices($order, $message)
{
$invoices = $order->getInvoiceCollection();
$state = Mage_Sales_Model_Order::STATE_PROCESSING;
$payment = $order->getPayment();
$transaction;
$session = Mage::getSingleton('checkout/session');
$szNewCrossReference;
$transactionId = $payment->getLastTransId();
$transaction = $payment->getTransaction($transactionId);
$transactionType = $transaction->getTxnType();
if ($session->getNewCrossReference()) {
$szNewCrossReference = $session->getNewCrossReference();
$value = $transaction->setTxnId($szNewCrossReference);
$transaction->save();
$payment->setLastTransId($szNewCrossReference);
$session->setNewCrossReference(null);
}
foreach ($invoices as $invoice) {
// set the invoice state to be "Paid"
$invoice->pay()->save();
}
// add a comment to the order comments
if ($transactionType == 'authorization') {
$order->setState($state, 'csv_preauth', $message, true);
} else {
if ($transactionType == 'capture') {
$order->setState($state, 'csv_paid', $message, true);
} else {
Mage::throwException('invalid transaction type [' . $transactionType . '] for invoice updating');
}
}
$order->save();
}