|
|
@@ -417,6 +417,29 @@ class OrderController extends BaseController
|
|
|
$updateData = [];
|
|
|
if (isset($order['modPrice']) && $order['modPrice'] == 0) {
|
|
|
$oldOrderSn = $orderSn;
|
|
|
+
|
|
|
+ //老单号需要关单,否则有付款成功的风险,老单号关闭成功了,才能生成新单号
|
|
|
+ $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);
|
|
|
+ $closeParams = [
|
|
|
+ 'orderSn' => $oldOrderSn,
|
|
|
+ ];
|
|
|
+ $response = $laResource->close($closeParams);
|
|
|
+ if (isset($response['code']) == false || $response['code'] != 'BBS00000') {
|
|
|
+ $msg = $response['msg'] ?? '';
|
|
|
+ noticeUtil::push('重点注意,散客买花更换单号没有成功,单号:' . $oldOrderSn . ',关单没有成功,' . $msg, '15280215347');
|
|
|
+ util::fail('出错了,请重新下一单');
|
|
|
+ }
|
|
|
+
|
|
|
$orderSn = orderSn::getOrderSn();
|
|
|
$updateData['orderSn'] = $orderSn;
|
|
|
OrderItemClass::updateByCondition(['orderSn' => $oldOrderSn], ['orderSn' => $orderSn]);
|