$accountId, "order_id" => $orderId ]; return $this->curlPostApi("goodlife/v1/fulfilment/certificate/query/",$param); } /** * 查询订单详情 * @param string $orderId * @return array */ public function getOrderData(string $orderId = ""): array { $param = [ "account_id" => $this->baseAccountId, "order_id" => $orderId, "page_num" => 1, "page_size" => 10 ]; return $this->curlPostApi("goodlife/v1/trade/order/query/",$param); } /** * 发起核销 * https://developer.open-douyin.com/docs/resource/zh-CN/local-life/develop/OpenAPI/general-capabilities/life.capacity.fulfilment/certificate.verify * @param array $data * data['verify_results'][0] * certificate_id、verify_id * @return array */ public function verifyCertificate(array $data = []): array { $param = [ "account_id" => $data['account_id'], "verify_token" => $data['pay_sn'], "encrypted_codes" => $data['encrypted_code'], "order_id" => $data['order_id'], "poi_id" => $data['poi_id'] ]; return $this->curlPostApi("goodlife/v1/fulfilment/certificate/verify/",$param); } /** * 撤销核销 * https://developer.open-douyin.com/docs/resource/zh-CN/local-life/develop/OpenAPI/general-capabilities/life.capacity.fulfilment/certificate.cancel * @param array $data * data['cancel_results'][0] * result_code * @return array */ public function cancelCertificate(array $data = []): array { $param = [ "certificate_id" => $data['certificate_id'], "verify_id" => $data['verify_id'], "account_id" => $data['account_id'] ]; return $this->curlPostApi("goodlife/v1/fulfilment/certificate/verify/",$param); } /** * 订单退款 * https://developer.open-douyin.com/docs/resource/zh-CN/local-life/develop/OpenAPI/general-capabilities/groupon-refund/order-refund-apply * @param string $orderId * @param array $codeList * @return array */ public function cancelOrder(string $orderId = "",array $codeList = []): array { $param = [ "refund_reason_code" => [305], "order_id" => $orderId, "certificate_id_list" => $codeList, "account_id" => $this->baseAccountId ]; echo "手动退款参数\n"; print_r($param); return $this->curlPostApi("goodlife/v1/groupon/order/refund/apply/",$param); } /** * 开发者发起退款 * https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/locallife/general-ability/agency-trade-system/refund/apply */ public function refundOrderOp(array $data = []): array { $param = [ "out_order_no" => $data['out_order_no'], // AL开头订单号 "out_refund_no" => $data['out_order_no']."1", "order_entry_schema" => [ "path" => "pages/order/detail", "params" => json_encode(['order' => $data['out_order_no']]) ], "notify_url" => "https://tran.jsshuita.cn/notify/refund", "item_order_detail" => [ [ "item_order_id" => $data['item_order_id'], ] ] ]; return $this->curlPostApi("api/apps/trade/v2/refund/create_refund",$param); } /** * 小程序版核销 - 三方码 * https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/locallife/general-ability/agency-trade-system/fulfillment/third-code/push-delivery * @param array $data * @return array * { * "data": { * "verify_results": [ * { * "certificate_id": "7676385765337382962", * "item_order_id": "800014550969473945813031711", * "verify_id": "7676388522927933482", * "verify_time": 1787298487000 * } * ], * "error_code": 0, * "description": "" * }, * } */ public function verifyOrder(array $data = []): array { $param = [ "delivery_status" => 2, "item_order_list" => [ [ "item_order_id" => $data['item_order_id'], ] ], "out_order_no" => $data['out_order_no'], "use_all" => true ]; return $this->curlPostApi("api/apps/trade/v2/fulfillment/push_delivery/",$param); } }