|
|
@@ -122,11 +122,11 @@ class AliEcoService extends BaseService |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["req"] = [ |
|
|
|
"face_uid" => $face_uid, |
|
|
|
$bizContent["req"] = [ |
|
|
|
"face_uid" => $face_uid, |
|
|
|
"school_code" => $school_code, |
|
|
|
]; |
|
|
|
$bizContent["page_no"] = $page_no; |
|
|
|
$bizContent["page_no"] = $page_no; |
|
|
|
$bizContent["page_size"] = $page_size; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
@@ -158,12 +158,12 @@ class AliEcoService extends BaseService |
|
|
|
// |
|
|
|
// 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); |
|
|
|
} |
|
|
|
$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, "响应验签失败", []); |
|
|
@@ -192,11 +192,11 @@ class AliEcoService extends BaseService |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["req"] = [ |
|
|
|
"black_type" => "DEBT", |
|
|
|
$bizContent["req"] = [ |
|
|
|
"black_type" => "DEBT", |
|
|
|
"school_code" => $school_code, |
|
|
|
]; |
|
|
|
$bizContent["page_no"] = $page_no; |
|
|
|
$bizContent["page_no"] = $page_no; |
|
|
|
$bizContent["page_size"] = $page_size; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
@@ -228,12 +228,12 @@ class AliEcoService extends BaseService |
|
|
|
// |
|
|
|
// 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); |
|
|
|
} |
|
|
|
$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, "响应验签失败", []); |
|
|
@@ -261,8 +261,8 @@ class AliEcoService extends BaseService |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["merchant_code"] = $merchant_code; |
|
|
|
$bizContent["out_order_no"] = $out_order_no; |
|
|
|
$bizContent["merchant_code"] = $merchant_code; |
|
|
|
$bizContent["out_order_no"] = $out_order_no; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
|
$params["service"] = "alipay.planet.ecocampus.api.debt.repay"; |
|
|
@@ -326,8 +326,8 @@ class AliEcoService extends BaseService |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["merchant_code"] = $merchant_code; |
|
|
|
$bizContent["out_order_no"] = $out_order_no; |
|
|
|
$bizContent["merchant_code"] = $merchant_code; |
|
|
|
$bizContent["out_order_no"] = $out_order_no; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
|
$params["service"] = "alipay.planet.ecocampus.api.debt.cancel"; |
|
|
@@ -392,9 +392,9 @@ class AliEcoService extends BaseService |
|
|
|
$client->format = $this->format; |
|
|
|
|
|
|
|
// 业务参数 |
|
|
|
$bizContent["consume_limit_sync_info"] = $consume_limit_sync_info; |
|
|
|
$bizContent["school_code"] = $school_code; |
|
|
|
$bizContent["school_name"] = $school_name; |
|
|
|
$bizContent["consume_limit_sync_info"] = $consume_limit_sync_info; |
|
|
|
$bizContent["school_code"] = $school_code; |
|
|
|
$bizContent["school_name"] = $school_name; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
|
$params["service"] = "alipay.planet.ecocampus.api.roster.consumeLimit"; |
|
|
@@ -438,6 +438,81 @@ class AliEcoService extends BaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* alipay.planet.ecocampus.api.roster.singleConsumeLimitSync(用户消费限制同步) |
|
|
|
* @param $school_code string 学校内标 |
|
|
|
* @param $face_uid string 学生刷脸编号 |
|
|
|
* @param $roster_name string 花名册名称 |
|
|
|
* @param $daily_consume_limit string 单日金额上限,上限999 |
|
|
|
* @param $single_consume_limit string 单笔金额上限,上限99 |
|
|
|
* @param $daily_max_consume_times string 单日最大消费次数,上限99,如需设置需要大于餐段次数之和,否则,可能会导致餐段消费次数不足 |
|
|
|
* @param $roster_period_consume_limit_config_list array 餐段设置,如需设置支持2-4个餐段。餐段时间不能有重叠 |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function alipayPlanetEcocampusApiRosterSingleConsumeLimitSync($school_code, $face_uid, $roster_name, $daily_consume_limit, $single_consume_limit, $daily_max_consume_times, $roster_period_consume_limit_config_list = []): 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["school_code"] = $school_code; |
|
|
|
$bizContent["face_uid"] = $face_uid; |
|
|
|
$bizContent["roster_name"] = $roster_name; |
|
|
|
$bizContent["daily_consume_limit"] = $daily_consume_limit; |
|
|
|
$bizContent["single_consume_limit"] = $single_consume_limit; |
|
|
|
$bizContent["daily_max_consume_times"] = $daily_max_consume_times; |
|
|
|
$bizContent["roster_period_consume_limit_config_list"] = $roster_period_consume_limit_config_list; |
|
|
|
|
|
|
|
// 指定需要调用的service接口 |
|
|
|
$params["service"] = "alipay.planet.ecocampus.api.roster.singleConsumeLimitSync"; |
|
|
|
$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, 'alipayPlanetEcocampusApiRosterSingleConsumeLimitSync', 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, "响应验签失败", []); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|