|
|
@@ -6,7 +6,9 @@ use biz\ghs\classes\GhsClass;
|
|
|
use bizGhs\clear\classes\ClearClass;
|
|
|
use bizGhs\clear\services\ClearService;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
+use bizHd\shop\classes\ShopClass;
|
|
|
use common\components\dict;
|
|
|
+use common\components\noticeUtil;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
|
|
|
@@ -38,6 +40,34 @@ class ClearController extends BaseController
|
|
|
}
|
|
|
$clear->status = ClearClass::STATUS_EXPIRE;
|
|
|
$clear->save();
|
|
|
+ $orderSn = $clear->orderSn ?? '';
|
|
|
+
|
|
|
+ $ghsShopId = $clear->ghsShopId ?? 0;
|
|
|
+ $ghsShop = ShopClass::getById($ghsShopId, true);
|
|
|
+ if (!empty($ghsShop)) {
|
|
|
+ $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' => $ghsShop->lklSjNo,
|
|
|
+ 'term_no' => $ghsShop->lklScanTermNo,
|
|
|
+ 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
|
|
|
+ 'lklCertificatePath' => $lklCertificatePath,
|
|
|
+ ];
|
|
|
+ $laResource = new Lakala($params);
|
|
|
+ $closeParams = [
|
|
|
+ 'orderSn' => $orderSn,
|
|
|
+ ];
|
|
|
+ $response = $laResource->close($closeParams);
|
|
|
+ if (isset($response['code']) == false || $response['code'] != 'BBS00000') {
|
|
|
+ $msg = $response['msg'] ?? '';
|
|
|
+ noticeUtil::push("\n花店结账单:" . $orderSn . "\n关单失败了\n{$msg} ", '15280215347');
|
|
|
+ } else {
|
|
|
+ noticeUtil::push("\n花店结账单:" . $orderSn . "\n关单成功", '15280215347');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
util::complete();
|
|
|
}
|
|
|
|