本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::getId方法的具体用法?PHP Mage_Sales_Model_Order_Payment::getId怎么用?PHP Mage_Sales_Model_Order_Payment::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Payment
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Payment::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeSave
/**
* Verify data required for saving
* @return Mage_Sales_Model_Order_Payment_Transaction
* @throws Mage_Core_Exception
*/
protected function _beforeSave()
{
// set parent id
$this->_verifyPaymentObject();
$this->setPaymentId($this->_paymentObject->getId())->setOrderId($this->getOrderId());
return parent::_beforeSave();
}
示例2: _beforeSave
/**
* Verify data required for saving
* @return Mage_Sales_Model_Order_Payment_Transaction
* @throws Mage_Core_Exception
*/
protected function _beforeSave()
{
// set parent id
$this->_verifyPaymentObject();
if (!$this->getId()) {
// We need to set order and payment ids only for new transactions
if (null !== $this->_paymentObject) {
$this->setPaymentId($this->_paymentObject->getId());
}
if (null !== $this->_order) {
$this->setOrderId($this->_order->getId());
}
$this->setCreatedAt(Mage::getModel('core/date')->gmtDate());
}
return parent::_beforeSave();
}
示例3: addPayment
public function addPayment(Mage_Sales_Model_Order_Payment $payment)
{
$payment->setOrder($this)->setParentId($this->getId());
if (!$payment->getId()) {
$this->getPaymentsCollection()->addItem($payment);
}
return $this;
}
示例4: getTransactionFromPaymentObject
/**
* Get DESC list of specific transactions from payment object
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param array|string $type_filter
* @return array
*/
public function getTransactionFromPaymentObject($payment, $type_filter)
{
$transactions = array();
$collection = Mage::getModel('sales/order_payment_transaction')->getCollection()->setOrderFilter($payment->getOrder())->addPaymentIdFilter($payment->getId())->addTxnTypeFilter($type_filter)->setOrder('created_at', Varien_Data_Collection::SORT_ORDER_DESC);
/** @var Mage_Sales_Model_Order_Payment_Transaction $txn */
foreach ($collection as $txn) {
$transactions[] = $txn->setOrderPaymentObject($payment);
}
return $transactions;
}