|
|
@@ -44,11 +44,11 @@ class AlipayK12Service extends BaseService |
|
|
|
endif; |
|
|
|
} |
|
|
|
|
|
|
|
self::$aopClient->gatewayUrl = $this->gatewayUrl; |
|
|
|
self::$aopClient->apiVersion = $this->apiVersion; |
|
|
|
self::$aopClient->signType = $this->signType; |
|
|
|
self::$aopClient->gatewayUrl = $this->gatewayUrl; |
|
|
|
self::$aopClient->apiVersion = $this->apiVersion; |
|
|
|
self::$aopClient->signType = $this->signType; |
|
|
|
self::$aopClient->postCharset = $this->postCharset; |
|
|
|
self::$aopClient->format = $this->format; |
|
|
|
self::$aopClient->format = $this->format; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -56,9 +56,9 @@ class AlipayK12Service extends BaseService |
|
|
|
{ |
|
|
|
if (empty(self::$config)) { |
|
|
|
self::$config = [ |
|
|
|
"ali_app_id" => "2021004101651996", |
|
|
|
"ali_app_id" => "2021004101651996", |
|
|
|
"ali_private_key" => "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSGJ9ob4kmGy6y4YeynjKJc/LSg02EXjLErPZSfVrAOy69FTRfBDbazlxpfl6YCAxDdT5ZcspB5kS2XYOY4dmqqPmF4VywmcjmZM8IxZFl1p7YC8BOlP6JrzDPwVl3hn4z3Em1byj8ANLY/AxAaW9W43FSIX+cSfdJThTlxGcbHZFM3kqu++hgFc/E+ar1nB0garqh03ESjatO4b6tuHM57ou7M+fXsoIf3gaL1IDZpeAoRh5sLCBLIbLz55tF0DcOaFsK7NUImnabJDRtrM1IN0lDZkQYAzL+JFsAq+ncRJm60Vd1jq/pXML/cFVHQQgdnjUd2u2NJTSMiCKCftmdAgMBAAECggEARzt+LduEEXJbeJiCI1MC7QX9tSqUFyAevMpgZ6P7JZM1nLfECzfwzwqjAES/Nn1mDVYTCmXvu+XcRtadnWMxUAaHcwGIwgqZa8xnLa220OKuHETOhQIcgWFL+WAakS6gRgT4Y2BJqWV1aJqsFpPR15mZ3SO8J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ali_public_key" => "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzEC7+3O/Ej/gkXug6EgcCM3LjWzz11RR6ESo0KshGg3ODgM8DfdKDHD5b1T6VbcRGFobXQBqVtW008ocUnSOZzE67a73l6mKT3FbmhRsbrgwcUuOHEJUZaLFxPibJgFl7fkOjBcIiz+Wc+9VDTt8O4YxIZhAL6L6ppXcrVrCkOaiIiuHGyp7FjQ+5s3Lk3NLSO3TfXw1WEX2F+IHnw32ZN/FlC8rF8HVlgM0w/PZJ9RuadoLqn5H6z/iqrurbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/LzLel6RuLQIDAQAB" |
|
|
|
"ali_public_key" => "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzEC7+3O/Ej/gkXug6EgcCM3LjWzz11RR6ESo0KshGg3ODgM8DfdKDHD5b1T6VbcRGFobXQBqVtW008ocUnSOZzE67a73l6mKT3FbmhRsbrgwcUuOHEJUZaLFxPibJgFl7fkOjBcIiz+Wc+9VDTt8O4YxIZhAL6L6ppXcrVrCkOaiIiuHGyp7FjQ+5s3Lk3NLSO3TfXw1WEX2F+IHnw32ZN/FlC8rF8HVlgM0w/PZJ9RuadoLqn5H6z/iqrurbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/LzLel6RuLQIDAQAB" |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
@@ -82,14 +82,14 @@ class AlipayK12Service extends BaseService |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateSceneTokenCreateRequest(); |
|
|
|
$params = [ |
|
|
|
"sub_code" => $sub_code, |
|
|
|
"cert_type" => $cert_type, |
|
|
|
"cert_no" => $cert_no, |
|
|
|
$params = [ |
|
|
|
"sub_code" => $sub_code, |
|
|
|
"cert_type" => $cert_type, |
|
|
|
"cert_no" => $cert_no, |
|
|
|
"school_std_code" => $school_std_code, |
|
|
|
"student_name" => $student_name, |
|
|
|
"parent_phone" => $parent_phone, |
|
|
|
"out_user_id" => $out_user_id, |
|
|
|
"student_name" => $student_name, |
|
|
|
"parent_phone" => $parent_phone, |
|
|
|
"out_user_id" => $out_user_id, |
|
|
|
]; |
|
|
|
|
|
|
|
if (empty($operator_user_id)) { |
|
|
@@ -97,7 +97,7 @@ class AlipayK12Service extends BaseService |
|
|
|
} |
|
|
|
$this->logger($params, "alipayCommerceEducateSceneTokenCreateRequest"); |
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request); |
|
|
|
$response = self::$aopClient->execute($request); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
// if ($responseData['code'] == 10000) { |
|
|
@@ -120,12 +120,12 @@ class AlipayK12Service extends BaseService |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateSceneTokenQueryRequest(); |
|
|
|
$params = [ |
|
|
|
$params = [ |
|
|
|
"user_token" => $user_token, |
|
|
|
]; |
|
|
|
|
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
// if ($responseData['code'] == 10000) { |
|
|
@@ -156,17 +156,17 @@ class AlipayK12Service extends BaseService |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateFacepayApplyRequest(); |
|
|
|
$params = [ |
|
|
|
"face_uid" => $face_uid, |
|
|
|
$params = [ |
|
|
|
"face_uid" => $face_uid, |
|
|
|
"school_stdcode" => $school_stdcode, |
|
|
|
"scene" => $scene, |
|
|
|
"ext_info" => json_encode($ext_info, JSON_UNESCAPED_UNICODE), |
|
|
|
"scene" => $scene, |
|
|
|
"ext_info" => json_encode($ext_info, JSON_UNESCAPED_UNICODE), |
|
|
|
]; |
|
|
|
if (!empty($face_open_id)) { |
|
|
|
$params["face_open_id"] = $face_open_id; |
|
|
|
} |
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
// dd($responseData); |
|
|
@@ -189,12 +189,12 @@ class AlipayK12Service extends BaseService |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateFacefeatureGroupkeyQueryRequest(); |
|
|
|
$params = [ |
|
|
|
$params = [ |
|
|
|
"school_stdcode" => $school_stdcode, |
|
|
|
"biz_code" => "SCHOOL_PAYMENT", |
|
|
|
"biz_code" => "SCHOOL_PAYMENT", |
|
|
|
]; |
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
// dd($responseData); |
|
|
@@ -208,4 +208,67 @@ class AlipayK12Service extends BaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* alipay.commerce.educate.scene.kids.close(人脸识别关闭) |
|
|
|
* @param $user_id string 刷脸用户的UID |
|
|
|
* @param $parent_uid string 开通一脸通行的支付宝UID,如果是家长为学生代开通,则为家长的UID |
|
|
|
* @param $school_stdcode string 学校外标 |
|
|
|
* @param $ext_info array 拓展参数{"cert_type":"IDENTITY_CARD","cert_no":"33010120200101xxxx"} |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function alipayCommerceEducateSceneKidsClose($user_id, $parent_uid, $school_stdcode, $ext_info): array |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateSceneKidsCloseRequest(); |
|
|
|
$params = [ |
|
|
|
"biz_code" => "SCHOOL_PAYMENT", |
|
|
|
"sub_biz_code" => "SCHOOL_PAYMENT_FACEPAY_BANK", |
|
|
|
"user_id" => $user_id, |
|
|
|
"parent_uid" => $parent_uid, |
|
|
|
"school_stdcode" => $school_stdcode, |
|
|
|
"ext_info" => $ext_info, |
|
|
|
]; |
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
if ($responseData['code'] == 10000) { |
|
|
|
return $this->returnRes(true, $responseData['msg'], $responseData); |
|
|
|
} else { |
|
|
|
return $this->returnRes(false, ($responseData['sub_msg'] ?? $responseData['msg']), $responseData); |
|
|
|
} |
|
|
|
} catch (\Exception $exception) { |
|
|
|
return $this->returnRes(false, $exception->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* alipay.commerce.educate.facepay.close(刷脸支付关闭) |
|
|
|
* @param $face_uid string 刷脸用户的UID |
|
|
|
* @param $school_stdcode string 学校外标 |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function alipayCommerceEducateFacepayClose($face_uid, $school_stdcode): array |
|
|
|
{ |
|
|
|
try { |
|
|
|
$request = new \AlipayCommerceEducateFacepayCloseRequest(); |
|
|
|
$params = [ |
|
|
|
"face_uid" => $face_uid, |
|
|
|
"school_stdcode" => $school_stdcode, |
|
|
|
"scene" => "K12", |
|
|
|
]; |
|
|
|
$request->setBizContent(json_encode($params)); |
|
|
|
$response = self::$aopClient->execute($request, null); |
|
|
|
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; |
|
|
|
$responseData = json_decode(json_encode($response->$responseNode), true); |
|
|
|
if ($responseData['code'] == 10000) { |
|
|
|
return $this->returnRes(true, $responseData['msg'], $responseData); |
|
|
|
} else { |
|
|
|
return $this->returnRes(false, ($responseData['sub_msg'] ?? $responseData['msg']), $responseData); |
|
|
|
} |
|
|
|
} catch (\Exception $exception) { |
|
|
|
return $this->returnRes(false, $exception->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |