Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions commerce_wechatpay.module
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -560,4 +560,3 @@ function commerce_wechatpay_get_credentials_from_payment_instance($payment_metho

return $credetials;
}