mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-03 00:10:38 +00:00
fix: 修改微信订单传参
This commit is contained in:
parent
76af1381ff
commit
573b6c703e
@ -3,6 +3,7 @@
|
||||
namespace crmeb\services\easywechat\orderShipping;
|
||||
|
||||
use crmeb\services\easywechat\Application;
|
||||
use crmeb\services\SystemConfigService;
|
||||
|
||||
class MiniOrderService
|
||||
{
|
||||
@ -21,10 +22,12 @@ class MiniOrderService
|
||||
*/
|
||||
protected static function options(array $config = [])
|
||||
{
|
||||
$payment = SystemConfigService::more(['routine_appId', 'routine_appsecret', 'pay_weixin_mchid', 'pay_new_weixin_open', 'pay_new_weixin_mchid']);
|
||||
return [
|
||||
'order_shipping' => [
|
||||
'appid' => sys_config('routine_appId'),
|
||||
'merchant_id' => sys_config('pay_new_weixin_open') ? sys_config('pay_weixin_mchid') : sys_config('pay_new_weixin_mchid'),
|
||||
'appid' => $payment['routine_appId'] ?? '',
|
||||
'secret' => $payment['routine_appsecret'] ?? '',
|
||||
'merchant_id' => empty($payment['pay_new_weixin_open']) ? trim($payment['pay_weixin_mchid']) : trim($payment['pay_new_weixin_mchid']),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
@ -29,6 +29,14 @@ class ServiceProvider implements ServiceProviderInterface
|
||||
*/
|
||||
public function register(Container $pimple)
|
||||
{
|
||||
$pimple['mini_program.access_token'] = function ($pimple) {
|
||||
return new AccessToken(
|
||||
$pimple['config']['order_shipping']['app_id'],
|
||||
$pimple['config']['order_shipping']['secret'],
|
||||
$pimple['cache']
|
||||
);
|
||||
};
|
||||
|
||||
$pimple['order_ship'] = function ($pimple) {
|
||||
return new OrderClient($pimple['access_token'], $pimple);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user