当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Paypal_Model_Config::getCountryMethods方法代码示例

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


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

示例1: getCountryMethods

 /**
  * Return list of allowed methods for specified country iso code
  *
  * @param string $countryCode 2-letters iso code
  * @return array
  */
 public function getCountryMethods($countryCode = null)
 {
     //Countries where this method is available
     // (based on countries where PayFlow Pro, PayFlow Express Checkout and Billing Agreements are available)
     $countriesByMethod = array(self::METHOD_PAYFLOW_BILLING_AGREEMENT => array('US', 'CA', 'AU', 'NZ'), self::METHOD_PAYPAL_ORDERSTORED_AGREEMENT => array('other', 'US', 'CA', 'GB', 'AU', 'NZ', 'JP', 'FR', 'IT', 'ES', 'HK'), self::METHOD_PAYFLOW_ORDERSTORED_AGREEMENT => array('other', 'US', 'CA', 'GB', 'AU', 'NZ', 'JP', 'FR', 'IT', 'ES', 'HK'));
     // PayPal Direct 'Stored card' methods
     $countriesByMethod[self::METHOD_PAYPAL_DIRECT_CUSTOMERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_DIRECT_ORDERSTORED] = array('US', 'CA', 'GB');
     // PayPal Payflow-based 'Stored card' methods (Payflow Pro defines the list of supported countries)
     $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWADVANCED_CUSTOMERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWLINK_CUSTOMERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWPRO_CUSTOMERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWADVANCED_ORDERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWLINK_ORDERSTORED] = $countriesByMethod[self::METHOD_PAYPAL_PAYFLOWPRO_ORDERSTORED] = array('US', 'CA', 'AU', 'NZ');
     $countryMethods = parent::getCountryMethods($countryCode);
     foreach ($countriesByMethod as $methodCode => $countries) {
         //Add this method to the list of available methods in appropriate countries
         if (is_null($countryCode)) {
             foreach ($countries as $country) {
                 array_push($countryMethods[$country], $methodCode);
             }
         } elseif (in_array($countryCode, $countries)) {
             array_push($countryMethods, $methodCode);
         }
     }
     return $countryMethods;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:28,代码来源:Config.php


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