array( 'label' => '商派矩阵对接', 'desc' => '', ), 'openapi' => array( 'label' => '商家自研对接', 'platform' => array(), 'desc' => '', ), ); /** * __construct * @return mixed 返回值 */ public function __construct() { $openapi_platform = array( 'website' => array( 'label' => 'website', 'desc' => 'desc', 'params' => array( 'website_url' => 'API地址', 'website_response_secret' => 'SECRET', 'node_id' => '节点', ), ), 'website_d1m' => array( 'label' => 'website_d1m', 'desc' => 'desc', 'params' => array( 'website_d1m_url' => 'API地址', 'website_d1m_request_appkey' => 'D1M APPKEY', 'website_d1m_request_secret' => 'D1M SECRET', 'd1m_response_secret' => 'SECRET', 'node_id' => '节点', ), ), 'website_v2' => array( 'label' => 'website_v2', 'desc' => '支持接收未支付订单', 'params' => array( 'website_url' => 'API地址', 'website_response_secret' => 'SECRET', 'node_id' => '节点', ), ), ); foreach (ome_shop_type::get_shop_type() as $key => $value) { if (isset($openapi_platform[$key])) { continue; } $openapi_platform[$key] = array( 'label' => $key, 'desc' => $value, 'params' => array( 'website_url' => 'API地址', 'website_response_secret' => 'SECRET', 'node_id' => '节点', ), ); } $this->__config['openapi']['platform'] = $openapi_platform; } /** * 获取AdapterList * @return mixed 返回结果 */ public function getAdapterList() { $adapter = array(); foreach ($this->__config as $key => $value) { $adapter[] = array('value' => $key, 'label' => $value['label'], 'desc' => $value['desc']); } return $adapter; } /** * 获取PlatformList * @param mixed $adapter adapter * @return mixed 返回结果 */ public function getPlatformList($adapter, $shop_type = '') { $platform = array(); foreach ($this->__config[$adapter]['platform'] as $key => $value) { if ($shop_type && $key != $shop_type) { continue; } $platform[] = array('value' => $key, 'label' => $value['label']); } return $platform; } /** * 获取PlatformParam * @param mixed $platform platform * @return mixed 返回结果 */ public function getPlatformParam($platform) { return $this->__config['openapi']['platform'][$platform]['params']; } }