Skip to content

Commit eb00e7a

Browse files
authored
Merge pull request #42 from yiirise/master
Update WechatPay.php
2 parents 04b28c1 + c409d5d commit eb00e7a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

common/components/payment/WechatPay.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ private function create($type)
6565
$gateway->setCertPath(Yii::getAlias($this->config['cert_client']));
6666
$gateway->setKeyPath(Yii::getAlias($this->config['cert_key']));
6767

68+
/**解决omnipay和easywechat衔接之间缺少配置的问题*/
69+
if($type == 'WechatPay_Js')
70+
{
71+
Yii::$app->params['wechatPaymentConfig'] = [
72+
'app_id' => $this->config['app_id'],
73+
'mch_id' => $this->config['mch_id'],
74+
'key' => $this->config['api_key'],
75+
'cert_path' => Yii::getAlias($this->config['cert_client']),
76+
'key_path' => Yii::getAlias($this->config['cert_key']),
77+
];
78+
}
79+
80+
6881
return $gateway;
6982
}
7083

0 commit comments

Comments
 (0)