本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::getAdditionalInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::getAdditionalInformation方法的具体用法?PHP Mage_Sales_Model_Order_Payment::getAdditionalInformation怎么用?PHP Mage_Sales_Model_Order_Payment::getAdditionalInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Payment
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Payment::getAdditionalInformation方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addNewTransaction
/**
* Magento $payment->addTransaction(...) needs the transaction_id = id from the transaction entry or string!
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param string $type
* @param Mage_Sales_Model_Abstract $salesDocument
* @param bool $failsafe
* @param string $message
* @return null|Mage_Sales_Model_Order_Payment_Transaction
*/
public function addNewTransaction(Mage_Sales_Model_Order_Payment $payment, $type, $salesDocument = null, $failsafe = false, $message = false)
{
$transaction = null;
try {
$addInformation = $payment->getAdditionalInformation();
$payment->setTransactionId($addInformation['transactionId'] . '-' . $type);
$transaction = $payment->addTransaction($type, $salesDocument, $failsafe, $message);
$transaction->save();
} catch (Exception $e) {
Mage::logException($e);
}
return $transaction;
}
示例2: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Method_Agreement
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
$order = $payment->getOrder();
$billingAgreement = Mage::getModel('sales/billing_agreement')->load($payment->getAdditionalInformation(Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID));
$api = $this->_pro->getApi()->setBillingAgreementId($billingAgreement->getReferenceId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled)->setInvNum($order->getIncrementId());
// call api and import transaction and other payment information
$api->callDoReferenceTransaction();
$this->_pro->importPaymentInfo($api, $payment);
$payment->setAdditionalInformation(CLS_Paypal_Model_Paypaluk_Api_Nvp::RESPONSE_MSG, $api->getResponseMsg())->setPreparedMessage(Mage::helper('cls_paypal')->__('Payflow PNREF: #%s.', $api->getTransactionId()))->setTransactionAdditionalInfo(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId());
$payment->setTransactionId($api->getPaypalTransactionId())->setIsTransactionClosed(0);
if ($api->getBillingAgreementId()) {
$order->addRelatedObject($billingAgreement);
$billingAgreement->setIsObjectChanged(true);
$billingAgreement->addOrderRelation($order);
}
return $this;
}
示例3: _getSecureSilentPostHash
/**
* Return secure hash value for silent post request
*
* @param Mage_Sales_Model_Order_Payment $payment
* @return string
*/
protected function _getSecureSilentPostHash($payment)
{
return $payment->getAdditionalInformation($this->_secureSilentPostHashKey);
}
示例4: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Express
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
$order = $payment->getOrder();
// prepare api call
$token = $payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN);
$api = $this->_pro->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->paymentAction)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setInvNum($order->getIncrementId())->setCurrencyCode($order->getBaseCurrencyCode())->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled);
// call api and get details from it
$api->callDoExpressCheckoutPayment();
$this->_importToPayment($api, $payment);
return $this;
}
示例5: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Method_Agreement
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
$order = $payment->getOrder();
$billingAgreement = Mage::getModel('sales/billing_agreement')->load($payment->getAdditionalInformation(Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID));
$api = $this->_pro->getApi()->setReferenceId($billingAgreement->getReferenceId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled);
// call api and import transaction and other payment information
$api->callDoReferenceTransaction();
$this->_pro->importPaymentInfo($api, $payment);
$api->callGetTransactionDetails();
$this->_pro->importPaymentInfo($api, $payment);
$payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0);
if ($api->getBillingAgreementId()) {
$order->addRelatedObject($billingAgreement);
$billingAgreement->setIsObjectChanged(true);
$billingAgreement->addOrderRelation($order);
}
return $this;
}
示例6: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Method_Agreement
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
$order = $payment->getOrder();
$billingAgreement = Mage::getModel('sales/billing_agreement')->load($payment->getAdditionalInformation(Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID));
$api = $this->_pro->getApi()->setReferenceId($billingAgreement->getReferenceId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'));
// add line items
if ($this->_pro->getConfig()->lineItemsEnabled) {
list($items, $totals) = Mage::helper('paypal')->prepareLineItems($order);
if (Mage::helper('paypal')->areCartLineItemsValid($items, $totals, $amount)) {
$api->setLineItems($items)->setLineItemTotals($totals);
}
}
// call api and import transaction and other payment information
$api->callDoReferenceTransaction();
$this->_pro->importPaymentInfo($api, $payment);
$api->callGetTransactionDetails();
$this->_pro->importPaymentInfo($api, $payment);
$payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0);
if ($api->getBillingAgreementId()) {
$billingAgreement->addOrderRelation($order->getId());
}
return $this;
}
示例7: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Express
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
$order = $payment->getOrder();
// prepare api call
$token = $payment->getAdditionalInformation(Ebcomm_PaypalMx_Model_Mensualidades2_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN);
$api = $this->_pro->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(Ebcomm_PaypalMx_Model_Mensualidades2_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->paymentAction)->setNotifyUrl(Mage::getUrl('paypalmx/ipn/'))->setInvNum($order->getIncrementId() . "MGT" . date("YmdHis"))->setCurrencyCode($order->getBaseCurrencyCode())->setPaypalCart(Mage::getModel('paypalmx/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled);
if ($order->getIsVirtual()) {
$api->setAddress($order->getBillingAddress())->setSuppressShipping(true);
} else {
$api->setAddress($order->getShippingAddress());
$api->setBillingAddress($order->getBillingAddress());
}
// call api and get details from it
$api->callDoExpressCheckoutPayment();
$this->_importToPayment($api, $payment);
return $this;
}
示例8: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Express
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
// prepare api call
$order = $payment->getOrder();
$token = $payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN);
$api = $this->_pro->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->paymentAction)->setNotifyUrl(Mage::getUrl($this->_ipnAction))->setInvNum($order->getIncrementId())->setCurrencyCode($order->getBaseCurrencyCode());
// add line items
if ($this->_pro->getConfig()->lineItemsEnabled && Mage::helper('paypal')->doLineItemsMatchAmount($order, $amount)) {
//For transfering line items order amount must be equal to cart total amount
list($items, $totals) = Mage::helper('paypal')->prepareLineItems($order);
$api->setLineItems($items)->setLineItemTotals($totals);
}
// call api and get details from it
$api->callDoExpressCheckoutPayment();
$this->_importToPayment($api, $payment);
return $this;
}
示例9: _placeOfflineTransaction
/**
*
* Requests coming from admin are offline transactions. These don't need to be sent via the PinPayments gateway
* as they've already been processed. Simply record the transaction ID supplied by the admin.
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param $amount
* @param $transactionId
*/
protected function _placeOfflineTransaction($payment, $amount)
{
$payment->setAmount($amount);
$payment->getOrder()->setCustomerNote("Creating offline PinPayments transaction");
$transactionId = $payment->getAdditionalInformation('offline_transaction_id');
$payment->setCcTransId($transactionId);
$payment->setTransactionId($transactionId);
}
示例10: setCanRefundToPayment
/**
* sets the canRefund information depending on the last refund operation code
*
* @param Mage_Sales_Model_Order_Payment $payment
*/
public function setCanRefundToPayment(Mage_Sales_Model_Order_Payment $payment)
{
$refundOperationCode = $payment->getAdditionalInformation('lastRefundOperationCode');
if (in_array(strtoupper(trim($refundOperationCode)), array(Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_FULL, Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_PARTIAL))) {
/*
* a further refund is possible if the transaction remains open, that means either the merchant
* did not close the transaction or the refunded amount is less than the orders amount
*/
$canRefund = $refundOperationCode == Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_PARTIAL;
Mage::helper('ops/data')->log(sprintf("set canRefund to '%s' for payment of order '%s'", var_export($canRefund, true), $payment->getOrder()->getIncrementId()));
$payment->setAdditionalInformation('canRefund', $canRefund)->save();
}
}
示例11: getGatewayParams
/**
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @param string|null $token
* @return multitype:
*/
public function getGatewayParams($payment, $amount, $token = null)
{
$params = array();
$params['orderid'] = $payment->getOrder()->getIncrementId();
$paymentProduct = null;
$longDesc = "";
if ($profile = $payment->getAdditionalInformation('split_payment_id')) {
//Check if this order is already split
$spCollection = Mage::getModel('hipay/splitPayment')->getCollection()->addFieldToFilter('order_id', $payment->getOrder()->getId());
if (!$spCollection->count()) {
$longDesc = Mage::helper('hipay')->__('Split payment');
$paymentsSplit = $this->getHelper()->splitPayment((int) $profile, $amount);
$amount = $paymentsSplit[0]['amountToPay'];
}
}
$params['description'] = Mage::helper('hipay')->__("Order %s by %s", $payment->getOrder()->getIncrementId(), $payment->getOrder()->getCustomerEmail());
//MANDATORY
$params['long_description'] = $longDesc;
// optional
$params['currency'] = $payment->getOrder()->getBaseCurrencyCode();
$params['amount'] = $amount;
$params['shipping'] = $payment->getOrder()->getShippingAmount();
$params['tax'] = $payment->getOrder()->getTaxAmount();
$params['cid'] = $payment->getOrder()->getCustomerId();
//CUSTOMER ID
$remoteIp = $payment->getOrder()->getRemoteIp();
//Check if it's forwarded and in this case, explode and retrieve the first part
if (!is_null($payment->getOrder()->getXForwardedFor()) && strpos($payment->getOrder()->getXForwardedFor(), ",") !== false) {
$xfParts = explode(",", $payment->getOrder()->getXForwardedFor());
$remoteIp = current($xfParts);
}
$params['ipaddr'] = $remoteIp;
$params['http_accept'] = "*/*";
$params['http_user_agent'] = Mage::helper('core/http')->getHttpUserAgent();
$params['language'] = Mage::app()->getLocale()->getLocaleCode();
//strpos(Mage::app()->getLocale()->getLocaleCode(), "fr") !== false ? "fr_FR" : 'en';
/**
* Parameters specific to the payment product
*/
if (!is_null($token)) {
$params['cardtoken'] = $token;
}
// TPPMAG1-2 - JPN
//$params['authentication_indicator'] = 0;
//switch ((int)$this->getConfigData('use_3d_secure')) {
// case 1:
// $params['authentication_indicator'] = 1;
// break;
// case 2:
// case 3:
// /* @var $rule Allopass_Hipay_Model_Rule */
// $rule = Mage::getModel('hipay/rule')->load($this->getConfigData('config_3ds_rules'));
// if($rule->getId() && $rule->validate($payment->getOrder()) )
// {
// $params['authentication_indicator'] = 1;
// if((int)$this->getConfigData('use_3d_secure') == 3)//case for force 3ds if rules are validated
// $params['authentication_indicator'] = 2;
//
// }
// break;
// case 4:
// $params['authentication_indicator'] = 2;
// break;
//}
$params['authentication_indicator'] = Mage::helper('hipay')->is3dSecure($this->getConfigData('use_3d_secure'), $this->getConfigData('config_3ds_rules'), $payment);
$isAdmin = $this->isAdmin();
/**
* Electronic Commerce Indicator
*/
if ($payment->getAdditionalInformation('use_oneclick')) {
$params['eci'] = 9;
//Recurring E-commerce
} elseif ($isAdmin) {
$params['eci'] = 1;
//MO/TO (Card Not Present). This value prevent from 3ds redirection in Admin payment.
}
/**
* Redirect urls
*/
$params['accept_url'] = $isAdmin ? Mage::helper('adminhtml')->getUrl('*/payment/accept') : Mage::getUrl($this->getConfigData('accept_url'));
$params['decline_url'] = $isAdmin ? Mage::helper('adminhtml')->getUrl('*/payment/decline') : Mage::getUrl($this->getConfigData('decline_url'));
$params['pending_url'] = $isAdmin ? Mage::helper('adminhtml')->getUrl('*/payment/pending') : Mage::getUrl($this->getConfigData('pending_url'));
$params['exception_url'] = $isAdmin ? Mage::helper('adminhtml')->getUrl('*/payment/exception') : Mage::getUrl($this->getConfigData('exception_url'));
$params['cancel_url'] = $isAdmin ? Mage::helper('adminhtml')->getUrl('*/payment/cancel') : Mage::getUrl($this->getConfigData('cancel_url'));
$params = $this->getCustomerParams($payment, $params);
$params = $this->getShippingParams($payment, $params);
//add url to order in BO Magento
$params['cdata1'] = Mage::getUrl('adminhtml/sales_order/view', array('_secure' => true, 'order_id' => $payment->getOrder()->getId()));
return $params;
}
示例12: addPayIdSub
/**
* @param Mage_Sales_Model_Order_Payment $payment
*/
protected function addPayIdSub(Mage_Sales_Model_Order_Payment $payment)
{
$txType = null;
if ($payment->getAdditionalInformation('status') == Netresearch_OPS_Model_Payment_Abstract::OPS_PAYMENT_PROCESSING) {
$txType = Netresearch_OPS_Model_Payment_Abstract::OPS_CAPTURE_TRANSACTION_TYPE;
}
if ($payment->getAdditionalInformation('status') == Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_WAITING) {
$txType = Netresearch_OPS_Model_Payment_Abstract::OPS_REFUND_TRANSACTION_TYPE;
}
if (null !== $txType) {
$transaction = $this->getDirectLinkHelper()->getPaymentTransaction($this->getOrder(), $this->requestParams['PAYID'], $txType);
if (0 < $transaction->getTxnId()) {
$historyLevel = str_replace($transaction->getParentTxnId() . '/', '', $transaction->getTxnId());
$this->requestParams['PAYIDSUB'] = $historyLevel;
}
}
}
示例13: _placeOrder
/**
* Place an order with authorization or capture action
*
* @param Mage_Sales_Model_Order_Payment $payment
* @param float $amount
* @return Mage_Paypal_Model_Express
*/
protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
{
// prepare api call
$order = $payment->getOrder();
$token = $payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN);
$api = $this->_pro->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->paymentAction)->setNotifyUrl(Mage::getUrl('paypal/ipn/express'))->setInvNum($order->getIncrementId())->setCurrencyCode($order->getBaseCurrencyCode());
// add line items
if ($this->_pro->getConfig()->lineItemsEnabled) {
list($items, $totals) = Mage::helper('paypal')->prepareLineItems($order);
$api->setLineItems($items)->setLineItemTotals($totals);
}
// call api and get details from it
$api->callDoExpressCheckoutPayment();
$payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0)->setIsPaid($api->isPaid($api->getPaymentStatus()));
Mage::getModel('paypal/info')->importToPayment($api, $payment);
return $this;
}