|
|
@ -7,8 +7,6 @@ use Org\QzlPay\Request\WxH5PayRequest;
|
|
|
|
|
|
|
|
|
|
|
|
class Api
|
|
|
|
class Api
|
|
|
|
{
|
|
|
|
{
|
|
|
|
use ApiCommonTrait;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public const CHANNEL_WX_H5 = 'wx_h5';
|
|
|
|
public const CHANNEL_WX_H5 = 'wx_h5';
|
|
|
|
public const CHANNEL_ALI_H5 = 'ali_h5';
|
|
|
|
public const CHANNEL_ALI_H5 = 'ali_h5';
|
|
|
|
|
|
|
|
|
|
|
@ -34,4 +32,22 @@ class Api
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return self::request('cs.order.query', $params);
|
|
|
|
return self::request('cs.order.query', $params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static function getCommonParams($apiName) {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'tradeType' => $apiName,
|
|
|
|
|
|
|
|
'version' => '2.0',
|
|
|
|
|
|
|
|
'mchNo' => Config::get('mchNo'),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static function request($apiName, $params) {
|
|
|
|
|
|
|
|
$params = array_merge(self::getCommonParams($apiName), $params);
|
|
|
|
|
|
|
|
$params[Signer::SIGN_NAME] = Signer::sign($params, Config::get('paySecret'));
|
|
|
|
|
|
|
|
return Client::request(self::getUrl(), $params);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected static function getUrl() {
|
|
|
|
|
|
|
|
return Config::get('baseUrl') . '/gateway/api/trade';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|