12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- class WxPayNotify extends WxPayNotifyReply {
-
- final public function Handle($needSign = true, array $config = []) {
- $msg = "OK";
-
- $result = WxpayApi::notify(array($this, 'NotifyCallBack'), $msg, $config);
- if ($result == false) {
- $this->SetReturn_code("FAIL");
- $this->SetReturn_msg($msg);
- $this->ReplyNotify(false);
- return;
- } else {
-
- $this->SetReturn_code("SUCCESS");
- $this->SetReturn_msg("OK");
- }
- $this->ReplyNotify($needSign);
- }
-
- public function NotifyProcess($data, &$msg) {
-
- return true;
- }
-
- final public function NotifyCallBack($data) {
- $msg = "OK";
- $result = $this->NotifyProcess($data, $msg);
- if ($result == true) {
- $this->SetReturn_code("SUCCESS");
- $this->SetReturn_msg("OK");
- } else {
- $this->SetReturn_code("FAIL");
- $this->SetReturn_msg($msg);
- }
- return $result;
- }
-
- final private function ReplyNotify($needSign = true) {
-
- if ($needSign == true && $this->GetReturn_code() == "SUCCESS") {
- $this->SetSign();
- }
- WxpayApi::replyNotify($this->ToXml());
- }
- }
|