本文整理匯總了PHP中type::addStatusHistoryComment方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::addStatusHistoryComment方法的具體用法?PHP type::addStatusHistoryComment怎麽用?PHP type::addStatusHistoryComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::addStatusHistoryComment方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: shippedOrder
/**
* envia a embarque y notifica al cliente
* @param type $order
*/
private function shippedOrder($order)
{
$shipment = $order->prepareShipment();
$shipment->register();
$order->setCustomerNoteNotify(true);
$order->setIsInProcess(true);
$order->addStatusHistoryComment('Automatically SHIPPED by PagoFacil.', false);
$transactionSave = Mage::getModel('core/resource_transaction');
$transactionSave->addObject($shipment)->addObject($shipment->getOrder());
$transactionSave->save();
}
示例2: _addStatusHistoryComment
/**
* @desc order comments or history
* @param type $order
*/
protected function _addStatusHistoryComment($order)
{
$success_result = strcmp($this->_success, 'true') == 0 || strcmp($this->_success, '1') == 0 ? 'true' : 'false';
$success = !empty($this->_reason) ? "{$success_result} <br />reason:{$this->_reason}" : $success_result;
if ($this->_eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND || $this->_eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_CAPTURE) {
$currency = $order->getOrderCurrencyCode();
// check if it is a full or partial refund
$amount = $this->_value;
$orderAmount = (int) Mage::helper('adyen')->formatAmount($order->getGrandTotal(), $currency);
$this->_debugData['_addStatusHistoryComment amount'] = 'amount notification:' . $amount . ' amount order:' . $orderAmount;
if ($amount == $orderAmount) {
$order->setAdyenEventCode($this->_eventCode . " : " . strtoupper($success_result));
} else {
$order->setAdyenEventCode("(PARTIAL) " . $this->_eventCode . " : " . strtoupper($success_result));
}
} else {
$order->setAdyenEventCode($this->_eventCode . " : " . strtoupper($success_result));
}
// if payment method is klarna or openinvoice/afterpay show the reservartion number
if (($this->_paymentMethod == "klarna" || $this->_paymentMethod == "afterpay_default" || $this->_paymentMethod == "openinvoice") && ($this->_klarnaReservationNumber != null && $this->_klarnaReservationNumber != "")) {
$klarnaReservationNumberText = "<br /> reservationNumber: " . $this->_klarnaReservationNumber;
} else {
$klarnaReservationNumberText = "";
}
if ($this->_boletoPaidAmount != null && $this->_boletoPaidAmount != "") {
$boletoPaidAmountText = "<br /> Paid amount: " . $this->_boletoPaidAmount;
} else {
$boletoPaidAmountText = "";
}
$type = 'Adyen HTTP Notification(s):';
$comment = Mage::helper('adyen')->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s %s %s', $type, $this->_eventCode, $this->_pspReference, $this->_paymentMethod, $success, $klarnaReservationNumberText, $boletoPaidAmountText);
// If notification is pending status and pending status is set add the status change to the comment history
if ($this->_eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_PENDING) {
$pendingStatus = $this->_getConfigData('pending_status', 'adyen_abstract', $order->getStoreId());
if ($pendingStatus != "") {
$order->addStatusHistoryComment($comment, $pendingStatus);
$this->_debugData['_addStatusHistoryComment'] = 'Created comment history for this notification with status change to: ' . $pendingStatus;
return;
}
}
// if manual review is accepted and a status is selected. Change the status through this comment history item
if ($this->_eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_MANUAL_REVIEW_ACCEPT && $this->_getFraudManualReviewAcceptStatus($order) != "") {
$manualReviewAcceptStatus = $this->_getFraudManualReviewAcceptStatus($order);
$order->addStatusHistoryComment($comment, $manualReviewAcceptStatus);
$this->_debugData['_addStatusHistoryComment'] = 'Created comment history for this notification with status change to: ' . $manualReviewAcceptStatus;
return;
}
$order->addStatusHistoryComment($comment);
$this->_debugData['_addStatusHistoryComment'] = 'Created comment history for this notification';
}
示例3: _addStatusHistoryComment
/**
* @desc order comments or history
* @param type $order
* @param Varien_Object $response
*/
protected function _addStatusHistoryComment($order, Varien_Object $response, $status = false)
{
Mage::log("_addStatusHistoryComment", Zend_Log::DEBUG, "adyen_notification.log", true);
//notification
$pspReference = $response->getData('pspReference');
$success = trim($response->getData('success'));
$success_result = strcmp($success, 'false') == 0 || !$success ? 'false' : 'true';
$eventCode = $response->getData('eventCode');
$reason = $response->getData('reason');
$success = !empty($reason) ? "{$success_result} <br />reason:{$reason}" : $success_result;
$klarnaReservationNumber = $response->getData('additionalData_additionalData_acquirerReference');
$boletoPaidAmount = $response->getData('additionalData_boletobancario_paidAmount');
//post
$authResult = $response->getData('authResult');
$pspReference = $response->getData('pspReference');
//payment method
$paymentMethod = $response->getData('paymentMethod');
//data type
$type = !empty($authResult) ? 'Adyen Result URL Notification(s):' : 'Adyen HTTP Notification(s):';
switch ($type) {
case 'Adyen Result URL Notification(s):':
/*PCD*/
// choose not to update the adyen_event_code in the order when the order is already on notification:Authorisation status and authresult = resultURL:Authorised
if (!(substr($order->getAdyenEventCode(), 0, 13) == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Adyen_Payment_Model_Event::ADYEN_EVENT_AUTHORISED)) {
Mage::log("Adyen Result URL order authResult:" . $authResult, Zend_Log::DEBUG, "adyen_notification.log", true);
$order->setAdyenEventCode($authResult);
}
$comment = Mage::helper('adyen')->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
break;
default:
Mage::log("default order authResult:" . $eventCode . " : " . strtoupper($success_result), Zend_Log::DEBUG, "adyen_notification.log", true);
if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REFUND) {
$currency = $order->getOrderCurrencyCode();
// check if it is a full or partial refund
$amount = Mage::helper('adyen')->formatAmount($response->getValue() / 100, $currency);
$orderAmount = Mage::helper('adyen')->formatAmount($order->getGrandTotal(), $currency);
if ($amount == $orderAmount) {
$order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
} else {
$order->setAdyenEventCode("(PARTIAL) " . $eventCode . " : " . strtoupper($success_result));
}
} else {
$order->setAdyenEventCode($eventCode . " : " . strtoupper($success_result));
}
// if payment method is klarna or openinvoice/afterpay show the reservartion number
if (($paymentMethod == "klarna" || $paymentMethod == "afterpay_default" || $paymentMethod == "openinvoice") && ($klarnaReservationNumber != null && $klarnaReservationNumber != "")) {
$klarnaReservationNumberText = "<br /> reservationNumber: " . $klarnaReservationNumber;
} else {
$klarnaReservationNumberText = "";
}
if ($boletoPaidAmount != null && $boletoPaidAmount != "") {
$boletoPaidAmountText = "<br /> Paid amount: " . $boletoPaidAmount;
} else {
$boletoPaidAmountText = "";
}
$comment = Mage::helper('adyen')->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s %s %s', $type, $eventCode, $pspReference, $paymentMethod, $success, $klarnaReservationNumberText, $boletoPaidAmountText);
break;
}
$order->addStatusHistoryComment($comment, $status);
$order->save();
}
示例4: _addStatusHistoryComment
/**
* @desc order comments or history
* @param type $order
* @param Varien_Object $response
*/
protected function _addStatusHistoryComment($order, Varien_Object $response, $status = false)
{
//notification
$pspReference = $response->getData('pspReference');
$success = trim($response->getData('success'));
$success = strcmp($success, 'false') == 0 || !$success ? 'false' : 'true';
$eventCode = $response->getData('eventCode');
$reason = $response->getData('reason');
$success = !empty($reason) ? "{$success} <br />reason:{$reason}" : $success;
//post
$authResult = $response->getData('authResult');
$pspReference = $response->getData('pspReference');
//payment method
$paymentMethod = $response->getData('paymentMethod');
//data type
$type = !empty($authResult) ? 'Adyen Result URL Notification(s):' : 'Adyen HTTP Notification(s):';
switch ($type) {
case 'Adyen Result URL Notification(s):':
/*PCD*/
// choose not to update the adyen_event_code in the order when the order is already on notification:Authorisation status and authresult = resultURL:Authorised
if (!($order->getAdyenEventCode() == Madia_Adyen_Model_Event::ADYEN_EVENT_AUTHORISATION && $authResult == Madia_Adyen_Model_Event::ADYEN_EVENT_AUTHORISED)) {
$order->setAdyenEventCode($authResult);
}
$comment = Mage::helper('adyen')->__('%s <br /> authResult: %s <br /> pspReference: %s <br /> paymentMethod: %s', $type, $authResult, $pspReference, $paymentMethod);
break;
default:
$order->setAdyenEventCode($eventCode);
$comment = Mage::helper('adyen')->__('%s <br /> eventCode: %s <br /> pspReference: %s <br /> paymentMethod: %s <br /> success: %s ', $type, $eventCode, $pspReference, $paymentMethod, $success);
break;
}
$order->addStatusHistoryComment($comment, $status);
/*PCD*/
$order->save();
}