本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::getLastTransId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::getLastTransId方法的具体用法?PHP Mage_Sales_Model_Order_Payment::getLastTransId怎么用?PHP Mage_Sales_Model_Order_Payment::getLastTransId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Payment
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Payment::getLastTransId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processInvoice
/**
* Set capture transaction ID to invoice for informational purposes
* @param Mage_Sales_Model_Order_Invoice $invoice
* @param Mage_Sales_Model_Order_Payment $payment
* @return Mage_Payment_Model_Method_Abstract
*/
public function processInvoice($invoice, $payment)
{
$invoice->setTransactionId($payment->getLastTransId());
return $this;
}
示例2: 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()));
}
}
示例3: processCreditmemo
/**
* Set transaction ID into creditmemo for informational purposes
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
* @param Mage_Sales_Model_Order_Payment $payment
* @return Mage_Payment_Model_Method_Abstract
*/
public function processCreditmemo($creditmemo, $payment)
{
$creditmemo->setTransactionId($payment->getLastTransId());
return $this;
}
示例4: processInvoice
/**
* Set capture transaction ID and enable Void to invoice for informational purposes
* @param Mage_Sales_Model_Order_Invoice $invoice
* @param Mage_Sales_Model_Order_Payment $payment
* @return Mage_Payment_Model_Method_Abstract
*/
public function processInvoice($invoice, $payment)
{
if ($payment->getLastTransId()) {
$invoice->setTransactionId($payment->getLastTransId());
$invoice->setCanVoidFlag(true);
if (Mage::helper('sales')->canSendNewInvoiceEmail($payment->getOrder()->getStoreId())) {
$invoice->setEmailSent(true);
$invoice->sendEmail();
}
return $this;
}
return false;
}
示例5: _isPreauthCapture
protected function _isPreauthCapture(Mage_Sales_Model_Order_Payment $payment)
{
return (bool) $payment->getLastTransId();
}
示例6: _preauthorizeCapture
/**
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
*/
protected function _preauthorizeCapture($payment, $amount)
{
$transactionId = $payment->getLastTransId();
$gatewayParams = array('operation' => 'capture', 'amount' => $amount);
$this->_debug($gatewayParams);
/* @var $request Allopass_Hipay_Model_Api_Request */
$request = Mage::getModel('hipay/api_request', array($this));
$uri = Allopass_Hipay_Model_Api_Request::GATEWAY_ACTION_MAINTENANCE . $transactionId;
$gatewayResponse = $request->gatewayRequest($uri, $gatewayParams, $payment->getOrder()->getStoreId());
$this->_debug($gatewayResponse->debug());
switch ($gatewayResponse->getStatus()) {
case "116":
$this->addTransaction($payment, $gatewayResponse->getTransactionReference(), Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH, array('is_transaction_closed' => 0), array(), Mage::helper('hipay')->getTransactionMessage($payment, self::OPERATION_MAINTENANCE_ACCEPT_CHALLENGE, $gatewayResponse->getTransactionReference(), $amount));
$payment->setIsTransactionPending(true);
break;
case "117":
//Capture requested
//Capture requested
case "118":
//Capture
//Capture
case "119":
//Partially Capture
$this->addTransaction($payment, $gatewayResponse->getTransactionReference(), Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE, array('is_transaction_closed' => 0), array(), Mage::helper('hipay')->getTransactionMessage($payment, self::OPERATION_MAINTENANCE_CAPTURE, $gatewayResponse->getTransactionReference(), $amount));
$payment->setIsTransactionPending(true);
break;
default:
Mage::throwException($gatewayResponse->getStatus() . " ==> " . $gatewayResponse->getMessage() . " is not processed!");
break;
}
return $this;
}
示例7: loadByPayment
/**
* @param Mage_Sales_Model_Order_Payment $payment
* @return Payone_Core_Model_Domain_Transaction
*/
public function loadByPayment(Mage_Sales_Model_Order_Payment $payment)
{
$this->load($payment->getLastTransId(), 'txid');
return $this;
}
示例8: callDoRefund
/**
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return array|false
*/
protected function callDoRefund($payment, $amount)
{
// Build the XML request
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
$xml->addChild('ewayCustomerID', $this->getCustomerId());
$xml->addChild('ewayTotalAmount', $this->getFormattedAmount($amount));
$xml->addChild('ewayCardExpiryMonth', $payment->getCcExpMonth());
$xml->addChild('ewayCardExpiryYear', substr($payment->getCcExpYear(), 2, 2));
$xml->addChild('ewayOriginalTrxnNumber', $this->getOriginalTransactionId($payment->getLastTransId()));
$xml->addChild('ewayRefundPassword', $this->getRefundPassword());
$xml->addChild('ewayOption1', '');
$xml->addChild('ewayOption2', '');
$url = $this->getApiRefundUrl();
// Convert to string before sending to the gateway
return $this->call($xml->asXML(), $url);
}