|
|
@@ -22,7 +22,7 @@ use common\components\util;
|
|
|
class TestController extends BaseController
|
|
|
{
|
|
|
|
|
|
- public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index', 'get', 'trade-query', 'query'];
|
|
|
+ public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index', 'get', 'trade-query', 'query', 'balance-query'];
|
|
|
|
|
|
public function actionApply()
|
|
|
{
|
|
|
@@ -162,6 +162,29 @@ class TestController extends BaseController
|
|
|
die;
|
|
|
}
|
|
|
|
|
|
+ public function actionBalanceQuery()
|
|
|
+ {
|
|
|
+ $shopId = 1212;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if (empty($shop)) {
|
|
|
+ util::stop('没有找到门店');
|
|
|
+ }
|
|
|
+ $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
|
|
|
+ $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
|
|
|
+ $params = [
|
|
|
+ 'appid' => 'OP00002119',
|
|
|
+ 'serial_no' => '018b08cfddbd',
|
|
|
+ 'merchant_no' => $shop->lklSjNo,
|
|
|
+ 'term_no' => $shop->lklScanTermNo,
|
|
|
+ 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
|
|
|
+ 'lklCertificatePath' => $lklCertificatePath,
|
|
|
+ ];
|
|
|
+ $laResource = new Lakala($params);
|
|
|
+ $response = $laResource->accountBalanceQuery();
|
|
|
+ echo "<pre>";
|
|
|
+ print_r($response);
|
|
|
+ }
|
|
|
+
|
|
|
public function actionQuery()
|
|
|
{
|
|
|
$shopId = 1212;
|