浏览代码

update

master
DengBiao 1年前
父节点
当前提交
307936f495
共有 2 个文件被更改,包括 2 次插入69 次删除
  1. +1
    -0
      src/applet/app/controllers/AliCallBackController.php
  2. +1
    -69
      src/applet/app/controllers/CallBackController.php

+ 1
- 0
src/applet/app/controllers/AliCallBackController.php 查看文件

@@ -183,4 +183,5 @@ class AliCallBackController extends \Phalcon\Mvc\Controller
}



}

+ 1
- 69
src/applet/app/controllers/CallBackController.php 查看文件

@@ -14,83 +14,15 @@ class CallBackController extends \Phalcon\Mvc\Controller

use BasisFun;

public function alipayGatewayAction()
{
$args = $this->request->get();
}

//加密方法
function encrypt($input, $key, $iv)
{

$data = @base64_encode(openssl_encrypt($input, 'AES-256-CBC', base64_decode($key), OPENSSL_RAW_DATA, $iv));
return $data;
}

//解密
function decrypt($input, $key, $iv)
{
return openssl_decrypt(base64_decode($input), 'AES-256-CBC', base64_decode($key), OPENSSL_RAW_DATA, $iv);
}


protected function RSA2($data, $pikey)
{
$res = "-----BEGIN RSA PRIVATE KEY-----\n" . wordwrap($pikey, 64, "\n", true) . "\n-----END RSA PRIVATE KEY-----";
// 请注意密钥 是不是有带 -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
$piKey = openssl_pkey_get_private($res);

if ($piKey) {
$res = openssl_get_privatekey($res);
openssl_sign($data, $sign, $res, 'SHA256');
$sign = base64_encode($sign);
openssl_free_key($piKey);
return $sign;
}
}

/**
* 支付宝 - 公共网关回调
*/
public function alipayCommonCallBackAction()
public function cloudpayAliPayCallBackAction()
{
$args = $this->request->get();
$this->logger($args, 'alipayCommonCallBack', true);
if ($this->request->isPost()) {
switch ($_POST["msg_method"] ?? ""){
case "alipay.commerce.educate.service.status.changed" :
$biz_content = json_decode($_POST["biz_content"], true);
$selfSupportForSchoolInfo = SelfSupportForUserFaceInfo::findFirst("user_id = '{$biz_content["user_id"]}' and school_std_code = '{$biz_content["school_std_code"]}'");
if (!empty($selfSupportForSchoolInfo)) {
if ($biz_content["service_name"] == "SCHOOL_FACE_PASS_OPEN") {
//一脸通行开通
$selfSupportForSchoolInfo->school_face_pass_status = "OPEN";
}
if ($biz_content["service_name"] == "SCHOOL_FACE_PASS_CLOSE") {
//一脸通行关闭
$selfSupportForSchoolInfo->school_face_pass_status = "CLOSE";
}
if ($biz_content["service_name"] == "SCHOOL_FACE_PAYMENT_OPEN") {
//校园刷脸支付开通
$selfSupportForSchoolInfo->school_face_payment_status = "OPEN";
}
if ($biz_content["service_name"] == "SCHOOL_FACE_PAYMENT_CLOSE") {
//校园刷脸支付关闭
$selfSupportForSchoolInfo->school_face_payment_status = "CLOSE";
}
$selfSupportForSchoolInfo->save();
//TODO::通知行业云 alipay.planet.ecocampus.api.roster.signUpInfo(签约信息同步)
// (new AliEcoService())->alipayPlanetEcocampusApiRosterSignUpInfo(
// $selfSupportForSchoolInfo->user_id, $selfSupportForSchoolInfo->parent_user_id,
// $selfSupportForSchoolInfo->parent_logon_id, $selfSupportForSchoolInfo->user_identity_id,
// $selfSupportForSchoolInfo->user_identity_id, $selfSupportForSchoolInfo->school_code,
// $args["school_name"], $args["face_open_status"], $args["scan_face_pay_status"]
// );
}
break;
}
$this->logger($_POST, 'alipayCommonCallBack_post', true);

}
echo "success";
die();


正在加载...
取消
保存