Exemple #1
0
 /**
  * 获取SDK相关配置数据
  * 未传参数时默认获取当前选中的公众号对应的配置.
  *
  * @param null $accountId
  *
  * @return array
  */
 public function getWechatOptions($accountId = null)
 {
     $accountId = $accountId ?: $this->chosedId();
     $accountData = $this->accountRepository->skipCriteria()->find($accountId);
     $options = ['debug' => true, 'app_id' => $accountData->app_id, 'secret' => $accountData->app_secret, 'token' => $accountData->token, 'log' => ['level' => \Monolog\Logger::DEBUG, 'file' => storage_path('logs/easywechat.log')], 'oauth' => ['scopes' => ['snsapi_userinfo'], 'callback' => '/examples/oauth_callback.php'], 'payment' => ['merchant_id' => $accountData->merchant_id, 'key' => $accountData->key, 'cert_path' => $accountData->cert_path, 'key_path' => $accountData->key_path]];
     return $options;
 }