Explorar el Código

feat(lakala): 添加交易预下单完成通知URL字段

- 在 TransPreorderRequest 模型中新增 complete_notify_url 字段
- 在 TransactionService 中设置并记录预下单请求和响应日志
- 引入 Log 门面用于调试信息输出
runphp hace 4 meses
padre
commit
51fd12ff10

+ 1 - 0
src/OpenAPISDK/V3/Model/TransPreorderRequest.php

@@ -321,6 +321,7 @@ class TransPreorderRequest extends ModelRequest implements \JsonSerializable
             'acc_busi_fields' => $this->accBusiFields === null ? $this->accBusiFields : $this->accBusiFields->jsonSerialize(),
             'out_order_no' => $this->outOrderNo,
             'pnr_ins_id_cd' => $this->pnrInsIdCd,
+            'complete_notify_url' => $this->completeNotifyUrl,
         ]);
         return parent::jsonSerialize();
     }

+ 3 - 1
src/Service/TransactionService.php

@@ -15,6 +15,7 @@ use SixShop\Lakala\OpenAPISDK\V3\Model\TradePreorderWechaGoodsDetail;
 use SixShop\Lakala\OpenAPISDK\V3\Model\TransPreorderRequest;
 use SixShop\Lakala\Config;
 use SixShop\Lakala\Dto\LocationInfo;
+use think\facade\Log;
 use function SixShop\Core\throw_logic_exception;
 
 /**
@@ -84,8 +85,9 @@ class TransactionService
         $request->setRemark($remark);
         $request->setAccBusiFields($accBusiFields);
         $request->setCompleteNotifyUrl($this->config->complete_notify_url);
-
+        Log::debug('preOrder request:'.json_encode($request));
         $response = $this->transPreorderApi->transPreorder($request);
+        Log::debug('preOrder response:'.json_encode($response->getRespData()));
         if ($response->getCode() == 'BBS00000') {
             return $response->getRespData();
         } else {