|
@@ -66,15 +66,16 @@ class Api
|
|
|
*/
|
|
|
public function pay($param = array())
|
|
|
{
|
|
|
- $source = $this->getParam($param, 'source');
|
|
|
+ $system_source = $this->getParam($param, 'system_source');
|
|
|
$receipt = $this->getParam($param, 'receipt');
|
|
|
+ $account_id = $this->getParam($param, 'account_id');
|
|
|
|
|
|
- $config = Dever::config('base', 'pay')->method;
|
|
|
+ $config = Dever::config('base', 'pay')->pay['method'];
|
|
|
|
|
|
- if (isset($config[$source])) {
|
|
|
- $param['account_id'] = $source;
|
|
|
- $method = $config[$source];
|
|
|
- if ($source == 3 && $receipt) {
|
|
|
+ if (isset($config[$system_source])) {
|
|
|
+ $param['account_id'] = $account_id ? $account_id : $system_source;
|
|
|
+ $method = $config[$system_source];
|
|
|
+ if ($system_source == 3 && $receipt) {
|
|
|
$method = $method[1];
|
|
|
$param['other'] = $receipt;
|
|
|
}
|
|
@@ -91,7 +92,7 @@ class Api
|
|
|
*/
|
|
|
public function applet($param = array())
|
|
|
{
|
|
|
- $param['source'] = 4;
|
|
|
+ $param['system_source'] = 4;
|
|
|
$this->init($param);
|
|
|
return $this->method->applet($this->get(1));
|
|
|
}
|
|
@@ -103,7 +104,7 @@ class Api
|
|
|
*/
|
|
|
public function app($param = array())
|
|
|
{
|
|
|
- $param['source'] = 1;
|
|
|
+ $param['system_source'] = 1;
|
|
|
$this->init($param);
|
|
|
$this->openid = -1;
|
|
|
return $this->method->app($this->get(3));
|
|
@@ -275,13 +276,20 @@ class Api
|
|
|
if (!$pay || ($pay && $pay['state'] != 1)) {
|
|
|
Dever::alert('没有账户信息');
|
|
|
}
|
|
|
+
|
|
|
+ if (!$pay['type']) {
|
|
|
+ Dever::alert('账户类型错误');
|
|
|
+ }
|
|
|
|
|
|
$this->account_id = $pay['id'];
|
|
|
/*
|
|
|
$this->channel_id = $pay['channel_id'];
|
|
|
$this->system_source = $pay['system_source'];
|
|
|
*/
|
|
|
-
|
|
|
+ if ($pay['box'] == 3) {
|
|
|
+ $pay['type'] = 'test';
|
|
|
+ }
|
|
|
+
|
|
|
$method = '\\Pay\\Lib\\' . ucwords($pay['type']);
|
|
|
if (isset($this->refer) && $this->refer) {
|
|
|
$pay['refer'] = $this->refer;
|