diff --git a/README.md b/README.md index 38f504b..9118f7e 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,19 @@ Also available in [Drupal sandbox](https://www.drupal.org/sandbox/yuhao6066/2612 Please download SDK package and put inside "libraries" folder before install this module + ```shell + mkdir -p PATH_TO_DRUPAL/sites/all/libraries/overtrue_wechat + cd PATH_TO_DRUPAL/sites/all/libraries/overtrue_wechat + composer require "overtrue/wechat:~3.1" + ``` + + or + ```shell cd PATH_TO_DRUPAL/sites/all/libraries - git clone https://github.com/overtrue/wechat.git - mv wechat/ overtrue_wechat/ + git clone https://github.com/overtrue/wechat.git overtrue_wechat + # composer install --no-dev --prefer-dist --optimize-autoloader + composer install ``` 更多关于此SDK的信息请[参考文档](https://github.com/overtrue/wechat/wiki/%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98) diff --git a/commerce_wechatpay.module b/commerce_wechatpay.module index 0f2dd15..8fdecde 100755 --- a/commerce_wechatpay.module +++ b/commerce_wechatpay.module @@ -24,7 +24,7 @@ function commerce_wechatpay_requirements($phase) { else { $requirements['overtrue_wechat']['value'] = t('Not Installed'); $requirements['overtrue_wechat']['severity'] = REQUIREMENT_ERROR; - $requirements['overtrue_wechat']['description'] = t('Please download the overtrue_wechat SDK package via %url and place it inside libraries folder with structure -> "sites/all/libraries/overtrue_wechat/src/Wechat/..."', array('%url' => 'https://github.com/overtrue/wechat')); + $requirements['overtrue_wechat']['description'] = t('Please download the overtrue_wechat SDK package via %url and place it inside libraries folder with structure -> "sites/all/libraries/overtrue_wechat/vendor/autoload.php"', array('%url' => 'https://github.com/overtrue/wechat')); } } @@ -52,8 +52,8 @@ function commerce_wechatpay_init() { // load sdk $path = libraries_get_path('overtrue_wechat'); $realpath = drupal_realpath($path); - if(file_exists($realpath.'/autoload.php')){ - include_once $realpath.'/autoload.php'; + if(file_exists($realpath.'/vendor/autoload.php')){ + include_once $realpath.'/vendor/autoload.php'; include_once 'commerce_wechatpay.inc'; } else { @@ -560,4 +560,3 @@ function commerce_wechatpay_get_credentials_from_payment_instance($payment_metho return $credetials; } -