Browse Source

update

master
DengBiao 1 year ago
parent
commit
90f0bfbf78
3 changed files with 132 additions and 24 deletions
  1. +2
    -0
      src/applet/app/config/loader.php
  2. +43
    -0
      src/applet/app/controllers/Alipay/FaceCollectionController.php
  3. +87
    -24
      src/common/Service/Pay/AlipayK12Service.php

+ 2
- 0
src/applet/app/config/loader.php View File

@@ -21,6 +21,8 @@ $loader->registerFiles([
DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateSceneTokenQueryRequest.php', DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateSceneTokenQueryRequest.php',
DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateFacepayApplyRequest.php', DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateFacepayApplyRequest.php',
DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayPlanetEcocampusApiRosterSignUpInfo.php', DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayPlanetEcocampusApiRosterSignUpInfo.php',
DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateSceneKidsCloseRequest.php',
DIR_VENDOR . 'alipay-sdk-php-all-master/aop/request/AlipayCommerceEducateFacepayCloseRequest.php',
DIR_COMMON . 'helper.php', DIR_COMMON . 'helper.php',
DIR_VENDOR . 'autoload.php', DIR_VENDOR . 'autoload.php',
])->registerNamespaces([ ])->registerNamespaces([


+ 43
- 0
src/applet/app/controllers/Alipay/FaceCollectionController.php View File

@@ -54,4 +54,47 @@ class FaceCollectionController extends ControllerBase
$this->api(Msg::NewError(500, '提交方式错误!')); $this->api(Msg::NewError(500, '提交方式错误!'));
} }
} }

public function EducateSceneKidsCloseAction()
{
if ($this->request->isPost()) {
$args = $this->request->getJsonRawBody(true);
$config["ali_app_id"] = $args["config"]["ali_app_id"] ?? "2021004103604157";
$config["ali_private_key"] = $args["config"]["ali_private_key"] ?? "MIIEvgIBADANBgkqh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BgQCNu2fsVQHDOsEMB/qakK3YlSb0q61iAjzeAjKYcXV9BHJ6ERTfeN3Z+9asSjs1TqzZSAtoQQ1EiCaFS4P9dNCTpYttS+52gy+VlJhNjCT0RHfxlGkpb+4OA4vHkbKpvTUAHjjXnMW1ZwC5CugSAchdTXTeV1im4Yms4DqJqacwoQKBgQCocPd7An8qTDIBZMOC4oT29+TYvUO+yMkAHLmx1h4QkLCkWegB4g5QkKkAGPWp3hshAj/KA0cXthFXVUG/SGZ2K6eB+nbon1N+9cDETdM4QXzN5gE/mUlupIxqRU1ouI27YYPbJSQNTrC7OkwNzfnpe/gshEj/gr5eHHvd4UrvMQKBgD2Toow7sfpV0R9rhO8aJ9njlbH15LqUK/AotK3E7zr73Uv5j/BIKS4dVC7T56L2khEUbM/y8+Rig6CdyFf3A4i4GKfbp56Sap/Haa9OP6jfep6VW7Aa1AJxPvIPgPZ2U+EuRxrwrP1EBcL5z6Cern9c9Zzs8BPUacU+Q5e8c87W";
$config["ali_public_key"] = $args["config"]["ali_public_key"] ?? "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzEC7+3O/Ej/gkXug6EgcCM3LjWzz11RR6ESo0KshGg3ODgM8DfdKDHD5b1T6VbcRGFobXQBqVtW008ocUnSOZzE67a73l6mKT3FbmhRsbrgwcUuOHEJUZaLFxPibJgFl7fkOjBcIiz+Wc+9VDTt8O4YxIZhAL6L6ppXcrVrCkOaiIiuHGyp7FjQ+5s3Lk3NLSO3TfXw1WEX2F+IHnw32ZN/FlC8rF8HVlgM0w/PZJ9RuadoLqn5H6z/iqrurbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/LzLel6RuLQIDAQAB";

$result = (new AlipayK12Service($config))->alipayCommerceEducateSceneKidsClose(
$args["user_id"], $args["parent_uid"],
$args["school_stdcode"], ["cert_type" => "IDENTITY_CARD", "cert_no" => $args["cert_no"]],
);

if (!$result["status"]) {
$this->api(Msg::NewError($result["data"]["code"] ?? 500, $result["msg"]));
}
$this->api($result["data"]);
} else {
$this->api(Msg::NewError(500, '提交方式错误!'));
}
}

public function EducateFacepayCloseAction()
{
if ($this->request->isPost()) {
$args = $this->request->getJsonRawBody(true);
$config["ali_app_id"] = $args["config"]["ali_app_id"] ?? "2021004103604157";
$config["ali_private_key"] = $args["config"]["ali_private_key"] ?? "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSGJ9ob4kmGy6y4YeynjKJc/LSg02EXjLErPZSfVrAOy69FTRfBDbazlxpfl6YCAxDdT5ZcspB5kS2XYOY4dmqqPmF4VywmcjmZM8IxZFl1p7YC8BOlP6JrzDPwVl3hn4z3Em1byj8ANLY/AxAaW9W43FSIX+cSfdJThTlxGcbHZFM3kqu++hgFc/E+ar1nB0garqh03ESjatO4b6tuHM57ou7M+fXsoIf3gaL1IDZpeAoRh5sLCBLIbLz55tF0DcOaFsK7NUImnabJDRtrM1IN0lDZkQYAzL+JFsAq+ncRJm60Vd1jq/pXML/cFVHQQgdnjUd2u2NJTSMiCKCftmdAgMBAAECggEARzt+LduEEXJbeJiCI1MC7QX9tSqUFyAevMpgZ6P7JZM1nLfECzfwzwqjAES/Nn1mDVYTCmXvu+XcRtadnWMxUAaHcwGIwgqZa8xnLa220OKuHETOhQIcgWFL+WAakS6gRgT4Y2BJqWV1aJqsFpPR15mZ3SO8JqXhznolsknqw8sO+DBJu+QXn1HdntSGWrLU4GblPlYAs64y/MzPMUWfA4ShDRn9MZK6ypnh2GB5ezgnFxx1jRGOy96IqikI8f+M/CVdgzErLIl+qTd/IbfL8B6Gccb4ZwimL/x1H1bqYCA6xINMZLo5eDHCvBTU4AW7sItw1Q7MQ8l3wBl7hW62gQKBgQDZT1SEaeBtOJxt3vrK7o/kCWNh/4h9oENFhDIuTvLQk9tirKw0BSiZedjbEHqnqM+bgeuvxazCp9uqoYXgC/dtIooy1P8aso+ZrroC/0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FlC8rF8HVlgM0w/PZJ9RuadoLqn5H6z/iqrurbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/LzLel6RuLQIDAQAB";

$result = (new AlipayK12Service($config))->alipayCommerceEducateFacepayClose(
$args["face_uid"],
$args["school_stdcode"],
);
if (!$result["status"]) {
$this->api(Msg::NewError($result["data"]["code"] ?? 500, $result["msg"]));
}
$this->api($result["data"]);
} else {
$this->api(Msg::NewError(500, '提交方式错误!'));
}
}
} }

+ 87
- 24
src/common/Service/Pay/AlipayK12Service.php View File

@@ -44,11 +44,11 @@ class AlipayK12Service extends BaseService
endif; 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->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)) { if (empty(self::$config)) {
self::$config = [ self::$config = [
"ali_app_id" => "2021004101651996",
"ali_app_id" => "2021004101651996",
"ali_private_key" => "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSGJ9ob4kmGy6y4YeynjKJc/LSg02EXjLErPZSfVrAOy69FTRfBDbazlxpfl6YCAxDdT5ZcspB5kS2XYOY4dmqqPmF4VywmcjmZM8IxZFl1p7YC8BOlP6JrzDPwVl3hn4z3Em1byj8ANLY/AxAaW9W43FSIX+cSfdJThTlxGcbHZFM3kqu++hgFc/E+ar1nB0garqh03ESjatO4b6tuHM57ou7M+fXsoIf3gaL1IDZpeAoRh5sLCBLIbLz55tF0DcOaFsK7NUImnabJDRtrM1IN0lDZkQYAzL+JFsAq+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urbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/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 { try {
$request = new \AlipayCommerceEducateSceneTokenCreateRequest(); $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, "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)) { if (empty($operator_user_id)) {
@@ -97,7 +97,7 @@ class AlipayK12Service extends BaseService
} }
$this->logger($params, "alipayCommerceEducateSceneTokenCreateRequest"); $this->logger($params, "alipayCommerceEducateSceneTokenCreateRequest");
$request->setBizContent(json_encode($params)); $request->setBizContent(json_encode($params));
$response = self::$aopClient->execute($request);
$response = self::$aopClient->execute($request);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$responseData = json_decode(json_encode($response->$responseNode), true); $responseData = json_decode(json_encode($response->$responseNode), true);
// if ($responseData['code'] == 10000) { // if ($responseData['code'] == 10000) {
@@ -120,12 +120,12 @@ class AlipayK12Service extends BaseService
{ {
try { try {
$request = new \AlipayCommerceEducateSceneTokenQueryRequest(); $request = new \AlipayCommerceEducateSceneTokenQueryRequest();
$params = [
$params = [
"user_token" => $user_token, "user_token" => $user_token,
]; ];


$request->setBizContent(json_encode($params)); $request->setBizContent(json_encode($params));
$response = self::$aopClient->execute($request, null);
$response = self::$aopClient->execute($request, null);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$responseData = json_decode(json_encode($response->$responseNode), true); $responseData = json_decode(json_encode($response->$responseNode), true);
// if ($responseData['code'] == 10000) { // if ($responseData['code'] == 10000) {
@@ -156,17 +156,17 @@ class AlipayK12Service extends BaseService
{ {
try { try {
$request = new \AlipayCommerceEducateFacepayApplyRequest(); $request = new \AlipayCommerceEducateFacepayApplyRequest();
$params = [
"face_uid" => $face_uid,
$params = [
"face_uid" => $face_uid,
"school_stdcode" => $school_stdcode, "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)) { if (!empty($face_open_id)) {
$params["face_open_id"] = $face_open_id; $params["face_open_id"] = $face_open_id;
} }
$request->setBizContent(json_encode($params)); $request->setBizContent(json_encode($params));
$response = self::$aopClient->execute($request, null);
$response = self::$aopClient->execute($request, null);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$responseData = json_decode(json_encode($response->$responseNode), true); $responseData = json_decode(json_encode($response->$responseNode), true);
// dd($responseData); // dd($responseData);
@@ -189,12 +189,12 @@ class AlipayK12Service extends BaseService
{ {
try { try {
$request = new \AlipayCommerceEducateFacefeatureGroupkeyQueryRequest(); $request = new \AlipayCommerceEducateFacefeatureGroupkeyQueryRequest();
$params = [
$params = [
"school_stdcode" => $school_stdcode, "school_stdcode" => $school_stdcode,
"biz_code" => "SCHOOL_PAYMENT",
"biz_code" => "SCHOOL_PAYMENT",
]; ];
$request->setBizContent(json_encode($params)); $request->setBizContent(json_encode($params));
$response = self::$aopClient->execute($request, null);
$response = self::$aopClient->execute($request, null);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response"; $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$responseData = json_decode(json_encode($response->$responseNode), true); $responseData = json_decode(json_encode($response->$responseNode), true);
// dd($responseData); // 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());
}
}

} }

Loading…
Cancel
Save