|
|
@@ -443,6 +443,71 @@ class AliEcoService extends BaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* alipay.planet.ecocampus.api.ftoken.query(刷脸照片查看获取ftoken) |
|
|
|
* @param $out_order_no string 外部订单号 |
|
|
|
* @param $cp_merchant_id string 商户编号 |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function alipayPlanetEcocampusApiFtokenQuery($out_order_no, $cp_merchant_id): array |
|
|
|
{ |
|
|
|
|
|
|
|
// cleint初始 |
|
|
|
$client = new \EcoApiClient(); |
|
|
|
|
|
|
|
// 根据环境,选择行星OPENAPI网关地址 |
|
|
|
$client->gatewayUrl = $this->serverUrl; |
|
|
|
$client->rsaPrivateKey = $this->privateKey; |
|
|
|
$client->alipayrsaPublicKey = $this->alipayPublicKey; |
|
|
|
$client->signType = $this->signType; |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["out_order_no"] = $out_order_no; |
|
|
|
$bizContent["cp_merchant_id"] = $cp_merchant_id; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
|
$params["service"] = "alipay.planet.ecocampus.api.ftoken.query"; |
|
|
|
$params["request_id"] = "" . uuid(); |
|
|
|
$params["biz_content"] = json_encode($bizContent); |
|
|
|
$params["version"] = "1.0"; |
|
|
|
|
|
|
|
// 其他参数 |
|
|
|
$params["charset"] = $this->charset; |
|
|
|
$params["isv_app_id"] = $this->appId; |
|
|
|
$params["utc_timestamp"] = "" . msectime(); |
|
|
|
|
|
|
|
//获取签名 |
|
|
|
$sign = $client->generateSign($params, $this->signType); |
|
|
|
|
|
|
|
// 调用ECOAPI |
|
|
|
$result = $client->call($params); |
|
|
|
|
|
|
|
$jsonStr = json_encode($result); |
|
|
|
|
|
|
|
|
|
|
|
// 响应的签名验证 转成Array 而非 Object |
|
|
|
$resMapData = json_decode($jsonStr, true); |
|
|
|
$this->logger($resMapData, 'alipayPlanetEcocampusApiFtokenQuery', true); |
|
|
|
|
|
|
|
// 验签 |
|
|
|
$verifyRes = checkResponse($resMapData, $client->alipayrsaPublicKey); |
|
|
|
|
|
|
|
if ($verifyRes) { |
|
|
|
// echo "响应验签成功"; |
|
|
|
$responseData = $resMapData["response"]; |
|
|
|
if ($responseData['code'] == 10000) { |
|
|
|
return $this->returnRes(true, $responseData["msg"], $responseData); |
|
|
|
} else { |
|
|
|
return $this->returnRes(false, ($responseData['sub_msg'] ?? $responseData['msg']), $resMapData); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// echo "响应验签失败"; |
|
|
|
return $this->returnRes(false, "响应验签失败", []); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* alipay.planet.ecocampus.api.roster.consumeLimit(消费限制信息批量同步) |
|
|
|
* @param $consume_limit_sync_info string 消费限制信息同步请求 |
|
|
|