|
|
@@ -2,18 +2,44 @@
|
|
|
|
|
|
namespace mall\controllers;
|
|
|
|
|
|
-use bizMall\merchant\services\MerchantService;
|
|
|
-use bizMall\message\services\InformAdminService;
|
|
|
-use bizMall\order\services\OrderService;
|
|
|
+use bizMall\shop\classes\ShopClass;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
+use common\components\lakala\Lakala;
|
|
|
|
|
|
class TestController extends BaseController
|
|
|
{
|
|
|
|
|
|
- public function actionIndex()
|
|
|
+ public $guestAccess = ['trade-query'];
|
|
|
+
|
|
|
+ //收银台订单查询 ssh 20231026
|
|
|
+ public function actionTradeQuery()
|
|
|
{
|
|
|
- echo 'aaa';
|
|
|
+ $shopId = 1;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if (empty($shop)) {
|
|
|
+ util::fail('没有找到订单');
|
|
|
+ }
|
|
|
+ $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);
|
|
|
+ $orderSn = 'KD26449727';
|
|
|
+ $cashParams = [
|
|
|
+ 'out_order_no' => $orderSn,
|
|
|
+ ];
|
|
|
+ $response = $laResource->cashierQuery($cashParams);
|
|
|
+ if (isset($response['code']) == false || $response['code'] != '000000') {
|
|
|
+ util::fail('支付失败了');
|
|
|
+ }
|
|
|
+ print_r($response);
|
|
|
}
|
|
|
|
|
|
}
|