getSignData($responseData['data']) . ConfigHelper::getStrVal("sdkserver.game.apikey"); //组装签名原文 $sign = md5($signSource); //MD5加密签名 CLog::pay("[uc.notify][签名原文]:" . $signSource); CLog::pay("[uc.notify][签名结果]:" . $sign); if ($sign == $responseData['sign']) { //游戏需根据orderStatus参数的值判断是否给玩家过账虚拟货币。(S为充值成功、F为充值失败,避免假卡、无效卡充值成功) $order = OrderNotice::Parse_UcOrder($responseData); if ($order->Check()) { # 校验订单 if ($order->status == 1) { # 订单状态是成功 $order->UpdateOrderStatus(); # 更新订单状态,->已付款 CLog::pay("[uc.notify][发货] 订单ID: " . $order->cpOrderId . ", 金额(分): " . $order->amount); } else if ($order->status == 2) { # status为2(failed)的情况 $order->UpdateOrderStatus(); # 直接更新订单状态,->支付失败 CLog::pay("[uc.notify][不发货] 订单ID: " . $order->cpOrderId); } else { echo 'FAILURE'; CLog::pay("[uc.notify][处理结果]: FAILURE (未知的支付状态)"); # 日志 return; } CLog::pay("[uc.notify][处理结果]:" . "SUCCESS"); echo 'SUCCESS'; //返回给sdk server的响应内容 return; } } CLog::pay("[uc.notify][处理结果]:" . "FAILURE"); echo 'FAILURE'; //返回给sdk server的响应内容 ,对于重复多次通知失败的订单,请参考文档中通知机制。 return; } else { CLog::pay("[uc.notify] 提取参数失败:" . $request); throw new exception('json_decode()异常'); } } catch (SDKException $e) { CLog::pay("[uc.notify] 程序执行异常:" . $e->getMessage()); throw new exception($e->getMessage()); }