本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::setIsTransactionClosed方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::setIsTransactionClosed方法的具体用法?PHP Mage_Sales_Model_Order_Payment::setIsTransactionClosed怎么用?PHP Mage_Sales_Model_Order_Payment::setIsTransactionClosed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Payment
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Payment::setIsTransactionClosed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doCancel
/**
* Call Cancel API, the transaction must be Authorized beforehand
*
* @param Mage_Sales_Model_Order_Payment $payment
* @return Eway_Rapid31_Model_Request_Direct
*/
public function doCancel(Mage_Sales_Model_Order_Payment $payment)
{
// Empty Varien_Object's data
$this->unsetData();
$transactionId = $payment->getLastTransId();
$this->setTransactionId($transactionId);
$response = $this->_doRapidAPI('CancelAuthorisation');
if ($response->isSuccess()) {
$payment->setTransactionId($response->getTransactionID());
$payment->setIsTransactionClosed(1);
return $this;
} else {
Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while doing the cancel. Please try again. (Error message: %s)', $response->getMessage()));
}
}
示例2: setPaymentTransactionInformation
/**
* Set Payment Transaction Information
*
* @param Mage_Sales_Model_Order_Payment $payment Sales Payment Model
* @param array $params Request params
* @param string $action Action (accept|cancel|decline|wait|exception)
*/
protected function setPaymentTransactionInformation(Mage_Sales_Model_Order_Payment $payment, $params, $action)
{
$payment->setTransactionId($params['PAYID']);
$code = $payment->getMethodInstance()->getCode();
$isInline = false;
/* In authorize mode we still have no authorization transaction for CC and DirectDebit payments,
* so capture or cancel won't work. So we need to create a new authorization transaction for them
* when a payment was accepted by Barclaycard
*
* In exception-case we create the authorization-transaction too because some exception-cases can turn into accepted
*/
if (('accept' === $action || 'exception' === $action) && in_array($code, array('ops_cc', 'ops_directDebit'))) {
$payment->setIsTransactionClosed(false);
$isInline = $this->isInlinePayment($payment);
/* create authorization transaction for non-inline pms */
if (false === $isInline || (array_key_exists('HTML_ANSWER', $params) || 0 < strlen($payment->getAdditionalInformation('HTML_ANSWER')))) {
$payment->addTransaction("authorization", null, true, $this->__("Process outgoing transaction"));
}
$payment->setLastTransId($params['PAYID']);
}
/* Barclaycard sends parameter HTML_ANSWER to trigger 3D secure redirection */
if (isset($params['HTML_ANSWER']) && 'ops_cc' == $code) {
$payment->setAdditionalInformation('HTML_ANSWER', $params['HTML_ANSWER']);
$payment->setIsTransactionPending(true);
}
$payment->setAdditionalInformation('paymentId', $params['PAYID']);
$payment->setAdditionalInformation('status', $params['STATUS']);
if (array_key_exists('ACCEPTANCE', $params) && 0 < strlen(trim($params['ACCEPTANCE']))) {
$payment->setAdditionalInformation('acceptance', $params['ACCEPTANCE']);
}
if (array_key_exists('BRAND', $params) && 'ops_cc' == $code && 0 < strlen(trim($params['BRAND']))) {
$payment->setAdditionalInformation('CC_BRAND', $params['BRAND']);
}
if (false === $isInline || array_key_exists('HTML_ANSWER', $params)) {
$payment->setIsTransactionClosed(true);
}
$payment->setDataChanges(true);
$payment->save();
}
示例3: setTransaction
/**
* @param Mage_Sales_Model_Order_Payment $payment
* @return bool
*/
public function setTransaction(Mage_Sales_Model_Order_Payment $payment)
{
$payment->setTransactionId(Mage::getSingleton('core/session')->getTransactionId());
$payment->setIsTransactionClosed(0);
return $payment;
}
示例4: setPaymentTransactionInformation
/**
* Set Payment Transaction Information
*
* @param Mage_Sales_Model_Order_Payment $payment Sales Payment Model
* @param array $params Request params
*/
protected function setPaymentTransactionInformation($payment, $params)
{
$payment->setTransactionId($params['PAYID']);
$code = $payment->getMethodInstance()->getCode();
if (in_array($code, array('postfinance_cc', 'postfinance_directDebit'))) {
$payment->setIsTransactionClosed(false);
$payment->addTransaction("authorization", null, true, $this->__("Process outgoing transaction"));
$payment->setLastTransId($params['PAYID']);
if (isset($params['HTML_ANSWER'])) {
$payment->setAdditionalInformation('HTML_ANSWER', $params['HTML_ANSWER']);
}
}
$payment->setAdditionalInformation('paymentId', $params['PAYID']);
$payment->setAdditionalInformation('status', $params['STATUS']);
$payment->setIsTransactionClosed(true);
$payment->setDataChanges(true);
$payment->save();
}