• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Paypal_Model_Config类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Mage_Paypal_Model_Config的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Paypal_Model_Config类的具体用法?PHP Mage_Paypal_Model_Config怎么用?PHP Mage_Paypal_Model_Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Mage_Paypal_Model_Config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setConfig

 /**
  * Config instance setter
  *
  * @param Mage_Paypal_Model_Config $instace
  * @param int $storeId
  */
 public function setConfig(Ebcomm_PaypalMx_Model_Config $instace, $storeId = null)
 {
     $this->_config = $instace;
     if (null !== $storeId) {
         $this->_config->setStoreId($storeId);
     }
     return $this;
 }
开发者ID:Gilbertoavitia1,项目名称:AHBS,代码行数:14,代码来源:Pro.php


示例2: shouldAskToCreateBillingAgreement

 /**
  * Check whether customer should be asked confirmation whether to sign a billing agreement
  *
  * @param Mage_Paypal_Model_Config $config
  * @param int $customerId
  * @return bool
  */
 public function shouldAskToCreateBillingAgreement(Mage_Paypal_Model_Config $config, $customerId)
 {
     if (null === self::$_shouldAskToCreateBillingAgreement) {
         self::$_shouldAskToCreateBillingAgreement = false;
         if ($customerId && $config->shouldAskToCreateBillingAgreement()) {
             if (Mage::getModel('sales/billing_agreement')->needToCreateForCustomer($customerId)) {
                 self::$_shouldAskToCreateBillingAgreement = true;
             }
         }
     }
     return self::$_shouldAskToCreateBillingAgreement;
 }
开发者ID:xiaoguizhidao,项目名称:emporiodopara,代码行数:19,代码来源:Data.php


示例3: _setBillingAgreementRequest

 /**
  * Set create billing agreement flag to api call
  *
  * @return Mage_Paypal_Model_Express_Checkout
  */
 protected function _setBillingAgreementRequest()
 {
     if (!$this->_customerId || $this->_quote->hasNominalItems()) {
         return $this;
     }
     $isRequested = $this->_isBARequested || $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT);
     if (!($this->_config->allow_ba_signup == Mage_Paypal_Model_Config::EC_BA_SIGNUP_AUTO || $isRequested && $this->_config->shouldAskToCreateBillingAgreement())) {
         return $this;
     }
     if (!Mage::getModel('sales/billing_agreement')->needToCreateForCustomer($this->_customerId)) {
         return $this;
     }
     $this->_api->setBillingType($this->_api->getBillingAgreementType());
     return $this;
 }
开发者ID:ksaltik,项目名称:tooldexlive,代码行数:20,代码来源:Checkout.php


示例4: getCcTypeName

 /**
  * Don't show CC type for non-CC methods
  *
  * @return string|null
  */
 public function getCcTypeName()
 {
     if (Mage_Paypal_Model_Config::getIsCreditCardMethod($this->getInfo()->getMethod())) {
         return parent::getCcTypeName();
     }
 }
开发者ID:okite11,项目名称:frames21,代码行数:11,代码来源:Info.php


示例5: _mapWpukFieldset

 /**
  * Map PayPal Website Payments Pro common config fields
  *
  * @param string $fieldName
  * @return string|null
  */
 protected function _mapWpukFieldset($fieldName)
 {
     $result = null;
     switch ($this->_methodCode) {
         case self::METHOD_PAYFLOW_BILLING_AGREEMENT:
         case self::METHOD_PAYFLOW_ORDERSTORED_AGREEMENT:
             $pathPrefix = 'paypal/wpuk';
             // Use PUMP credentials from Verisign for EC when Direct Payments are unavailable
             if (!$this->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_PE_DIRECT)) {
                 $pathPrefix = 'payment/verisign';
             }
             switch ($fieldName) {
                 case 'partner':
                 case 'user':
                 case 'vendor':
                 case 'pwd':
                 case 'sandbox_flag':
                 case 'use_proxy':
                 case 'proxy_host':
                 case 'proxy_port':
                     $result = $pathPrefix . '/' . $fieldName;
                     break;
                 default:
             }
             break;
         default:
             $result = parent::_mapWpukFieldset($fieldName);
     }
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:36,代码来源:Config.php


示例6: _construct

 /**
  * Set template and redirect message
  */
 protected function _construct()
 {
     $this->_config = Mage::getModel('paypal/config')->setMethod($this->getMethodCode());
     $locale = Mage::app()->getLocale();
     $mark = Mage::getConfig()->getBlockClassName('core/template');
     $mark = new $mark();
     $mark->setTemplate('paypal/payment/mark.phtml')->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($locale))->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($locale->getLocaleCode()));
     // known issue: code above will render only static mark image
     $this->setTemplate('paypal/payment/redirect.phtml')->setRedirectMessage(Mage::helper('paypal')->__('You will be redirected to the PayPal website when you place an order.'))->setMethodTitle('')->setMethodLabelAfterHtml($mark->toHtml());
     return parent::_construct();
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:14,代码来源:Form.php


示例7: _construct

 /**
  * Set template and redirect message
  */
 protected function _construct()
 {
     $this->_config = Mage::getModel('paypalmx/config')->setMethod($this->getMethodCode());
     $locale = Mage::app()->getLocale();
     $mark = Mage::getConfig()->getBlockClassName('core/template');
     $mark = new $mark();
     $mark->setTemplate('paypalmx/payment/mark.phtml')->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($locale))->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($locale->getLocaleCode()))->setNoPosAH($this->_config->getnoposah());
     // known issue: code above will render only static mark image
     $this->setTemplate('paypalmx/payment/redirect.phtml')->setMethodTitle('')->setMethodLabelAfterHtml($mark->toHtml());
     return parent::_construct();
 }
开发者ID:Gilbertoavitia1,项目名称:AHBS,代码行数:14,代码来源:Form.php


示例8: start

 /**
  * Reserve order ID for specified quote and start checkout on PayPal
  * @return string
  */
 public function start($returnUrl, $cancelUrl)
 {
     $this->_quote->reserveOrderId()->save();
     // prepare API
     $this->_getApi();
     $this->_api->setAmount($this->_quote->getBaseGrandTotal())->setCurrencyCode($this->_quote->getBaseCurrencyCode())->setInvNum($this->_quote->getReservedOrderId())->setReturnUrl($returnUrl)->setCancelUrl($cancelUrl)->setSolutionType($this->_config->solutionType)->setPaymentAction($this->_config->paymentAction);
     // supress or export shipping address
     if ($this->_quote->getIsVirtual()) {
         $this->_api->setSuppressShipping(true);
     } else {
         $address = $this->_quote->getShippingAddress();
         $isOverriden = 0;
         if (true === $address->validate()) {
             $isOverriden = 1;
             $this->_api->setAddress($address);
         }
         $this->_quote->getPayment()->setAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDEN, $isOverriden);
         $this->_quote->getPayment()->save();
     }
     // add line items
     if ($this->_config->lineItemsEnabled) {
         list($items, $totals) = Mage::helper('paypal')->prepareLineItems($this->_quote);
         $this->_api->setLineItems($items)->setLineItemTotals($totals);
     }
     $this->_config->exportExpressCheckoutStyleSettings($this->_api);
     // call API and redirect with token
     $this->_api->callSetExpressCheckout();
     $token = $this->_api->getToken();
     $this->_redirectUrl = $this->_config->getExpressCheckoutStartUrl($token);
     return $token;
 }
开发者ID:joebushi,项目名称:magento-mirror,代码行数:35,代码来源:Checkout.php


示例9: _debug

 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug()
 {
     if ($this->_config && $this->_config->debug) {
         $file = $this->_config->getMethodCode() ? "payment_{$this->_config->getMethodCode()}.log" : self::DEFAULT_LOG_FILE;
         Mage::getModel('Mage_Core_Model_Log_Adapter', array('fileName' => $file))->log($this->_debugData);
     }
 }
开发者ID:natxetee,项目名称:magento2,代码行数:12,代码来源:Ipn.php


示例10: _debug

 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug()
 {
     if ($this->_config && $this->_config->debug) {
         $file = $this->_config->getMethodCode() ? "payment_{$this->_config->getMethodCode()}.log" : self::DEFAULT_LOG_FILE;
         Mage::getModel('core/log_adapter', $file)->log($this->_debugData);
     }
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:12,代码来源:Ipn.php


示例11: __get

 public function __get($key)
 {
     if (strcmp($key, 'verifyPeer') == 0 || strcmp($key, 'verify_peer') == 0) {
         if ($this->_isStagingMode === null) {
             $this->_isStagingMode = 0;
             try {
                 $curlResource = curl_init("https://www.paypal.com/");
                 curl_setopt($curlResource, CURLOPT_TIMEOUT, 3);
                 curl_setopt($curlResource, CURLOPT_RETURNTRANSFER, false);
                 curl_setopt($curlResource, CURLOPT_SSL_VERIFYPEER, true);
                 curl_exec($curlResource);
                 $curlError = curl_error($curlResource);
                 curl_close($curlResource);
                 if (!!$curlError) {
                     $this->_isStagingMode = 1;
                 }
             } catch (Exception $ex) {
                 $this->_isStagingMode = 1;
             }
         }
         if ($this->_isStagingMode == 1) {
             return 0;
         }
     }
     return parent::__get($key);
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:26,代码来源:Config.php


示例12: placeOrder

 /**
  * Place the order when customer returned from paypal
  * Until this moment all quote data must be valid
  *
  * @param string $token
  * @param string $shippingMethodCode
  * @return Mage_Sales_Model_Order
  */
 public function placeOrder($token, $shippingMethodCode = null)
 {
     if ($shippingMethodCode) {
         $this->updateShippingMethod($shippingMethodCode);
     }
     if (!$this->_quote->getCustomerId()) {
         $this->_quote->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)->setCustomerEmail($this->_quote->getBillingAddress()->getEmail());
     }
     $this->_ignoreAddressValidation();
     $order = Mage::getModel('sales/service_quote', $this->_quote)->submit();
     $this->_quote->save();
     // commence redirecting to finish payment, if paypal requires it
     if ($order->getPayment()->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT)) {
         $this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token);
     }
     switch ($order->getState()) {
         // even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
         case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
             // TODO
             break;
             // regular placement, when everything is ok
         // regular placement, when everything is ok
         case Mage_Sales_Model_Order::STATE_PROCESSING:
         case Mage_Sales_Model_Order::STATE_COMPLETE:
             $order->sendNewOrderEmail();
             break;
     }
     return $order;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:37,代码来源:Checkout.php


示例13: editAction

 /**
  * Dispatch customer back to PayPal for editing payment information
  */
 public function editAction()
 {
     try {
         $this->getResponse()->setRedirect($this->_config->getExpressCheckoutEditUrl($this->_initToken()));
     } catch (Mage_Core_Exception $e) {
         $this->_getSession()->addError($e->getMessage());
         $this->_redirect('*/*/review');
     }
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:12,代码来源:Abstract.php


示例14: getBuildNotationCode

 /**
  * BN code getter
  *
  * @param string $countryCode ISO 3166-1
  */
 public function getBuildNotationCode($countryCode = null)
 {
     parent::getBuildNotationCode($countryCode);
     if (Mage::helper('iwdall')->isEnterprise()) {
         return 'IWD_SI_MagentoEE_WPS';
         // enterprise
     } else {
         return 'IWD_SI_MagentoCE_WPS';
         // community
     }
 }
开发者ID:kirchbergerknorr,项目名称:iwd_all,代码行数:16,代码来源:Config.php


示例15: _getSpecificConfigPath

 /**
  * Map any supported payment method into a config path by specified field name
  *
  * @param string $fieldName
  * @return string|null
  */
 protected function _getSpecificConfigPath($fieldName)
 {
     $path = $this->_mapExpressFieldset($fieldName);
     if ($path === null) {
         $path = $this->_mapWppFieldset($fieldName);
     }
     if ($path === null) {
         $path = parent::_getSpecificConfigPath($fieldName);
     }
     return $path;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:17,代码来源:Config.php


示例16: getBuildNotationCode

 /**
  * BN code getter
  * override method
  *
  * @param string $countryCode ISO 3166-1
  */
 public function getBuildNotationCode($countryCode = null)
 {
     if ($this->isMageEnterprise()) {
         $newBnCode = 'Magestore_SI_MagentoEE';
     } else {
         $newBnCode = 'Magestore_SI_MagentoCE';
     }
     $bnCode = parent::getBuildNotationCode($countryCode);
     if (class_exists("Magestore_Onestepcheckout_Helper_Data") && Mage::getStoreConfig('onestepcheckout/general/active')) {
         return $newBnCode;
     } else {
         return $bnCode;
     }
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:20,代码来源:Config.php


示例17: processIpnRequest

 /**
  * Get ipn data, send verification to PayPal, run corresponding handler
  */
 public function processIpnRequest()
 {
     if (!$this->_ipnFormData) {
         return;
     }
     // debug requested
     if ($this->_config->debugFlag) {
         Mage::getModel('paypal/api_debug')->setApiEndpoint($this->_config->getPaypalUrl())->setRequestBody(var_export($this->_ipnFormData, 1))->save();
     }
     $sReq = '';
     $sReqDebug = '';
     foreach ($this->_ipnFormData as $k => $v) {
         $sReq .= '&' . $k . '=' . urlencode(stripslashes($v));
         $sReqDebug .= '&' . $k . '=';
     }
     // append ipn command
     $sReq .= "&cmd=_notify-validate";
     $sReq = substr($sReq, 1);
     $http = new Varien_Http_Adapter_Curl();
     $http->write(Zend_Http_Client::POST, $this->_config->getPaypalUrl(), '1.1', array(), $sReq);
     $response = $http->read();
     // debug postback request & response
     if ($this->_config->debugFlag) {
         Mage::getModel('paypal/api_debug')->setApiEndpoint($this->_config->getPaypalUrl())->setRequestBody($sReq)->setResponseBody($response)->save();
     }
     if ($error = $http->getError()) {
         $this->_notifyAdmin(Mage::helper('paypal')->__('PayPal IPN postback HTTP error: %s', $error));
         return;
     }
     $response = preg_split('/^\\r?$/m', $response, 2);
     $response = trim($response[1]);
     if ($response == 'VERIFIED') {
         $this->processIpnVerified();
     } else {
         // TODO: possible PCI compliance issue - the $sReq may contain data that is supposed to be encrypted
         $this->_notifyAdmin(Mage::helper('paypal')->__('PayPal IPN postback Validation error: %s', $sReq));
     }
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:41,代码来源:Ipn.php


示例18: _debug

 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug($debugData)
 {
     if ($this->getDebugFlag()) {
         Mage::getModel('core/log_adapter', 'payment_' . $this->_config->getMethodCode() . '.log')->setFilterDataKeys($this->_debugReplacePrivateDataKeys)->log($debugData);
     }
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:11,代码来源:Abstract.php


示例19: _debug

 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug($debugData)
 {
     if ($this->getDebugFlag()) {
         Mage::getModel('Mage_Core_Model_Log_Adapter', array('fileName' => 'payment_' . $this->_config->getMethodCode() . '.log'))->setFilterDataKeys($this->_debugReplacePrivateDataKeys)->log($debugData);
     }
 }
开发者ID:natxetee,项目名称:magento2,代码行数:11,代码来源:Abstract.php


示例20: getBuildNotationCode

 /**
  * BN code getter
  *
  * @param string $countryCode ISO 3166-1
  */
 public function getBuildNotationCode($countryCode = null)
 {
     parent::getBuildNotationCode($countryCode);
     return 'IWD_SI_Other_OnePage';
 }
开发者ID:tesorogithub,项目名称:tesoroshop,代码行数:10,代码来源:IWD_Opc_Model_Paypal_Config.php



注:本文中的Mage_Paypal_Model_Config类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mage_Rule_Model_Condition_Abstract类代码示例发布时间:2022-05-23
下一篇:
PHP Mage_Payment_Model_Method_Cc类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap