\WxPayNotify

回调基础类

Summary

Methods
Properties
Constants
SetReturn_code()
GetReturn_code()
SetReturn_msg()
GetReturn_msg()
SetData()
SetSign()
GetSign()
IsSignSet()
ToXml()
FromXml()
ToUrlParams()
MakeSign()
GetValues()
Handle()
NotifyProcess()
NotifyCallBack()
No public properties found
No constants found
No protected methods found
$values
N/A
ReplyNotify()
No private properties found
N/A

Properties

$values

$values : 

Type

Methods

SetReturn_code()

SetReturn_code(  $return_code) 

设置错误码 FAIL 或者 SUCCESS

Parameters

$return_code

GetReturn_code()

GetReturn_code() : string

获取错误码 FAIL 或者 SUCCESS

Returns

string —

$return_code

SetReturn_msg()

SetReturn_msg(  $return_msg) 

设置错误信息

Parameters

$return_msg

GetReturn_msg()

GetReturn_msg() : string

获取错误信息

Returns

string

SetData()

SetData(string  $key, string  $value) 

设置返回参数

Parameters

string $key
string $value

SetSign()

SetSign() 

设置签名,详见签名生成算法

GetSign()

GetSign() : \值

获取签名,详见签名生成算法的值

Returns

\值

IsSignSet()

IsSignSet() : true

判断签名,详见签名生成算法是否存在

Returns

true —

或 false

ToXml()

ToXml() 

输出xml字符

Throws

\WxPayException

FromXml()

FromXml(string  $xml) 

将xml转为array

Parameters

string $xml

Throws

\WxPayException

ToUrlParams()

ToUrlParams() 

格式化参数格式化成url参数

MakeSign()

MakeSign() : \签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值

生成签名

Returns

\签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值

GetValues()

GetValues() 

获取设置的值

Handle()

Handle(boolean  $needSign = true) 

回调入口

Parameters

boolean $needSign

是否需要签名输出

NotifyProcess()

NotifyProcess(array  $data, string  $msg) : \true回调出来完成不需要继续回调,false回调处理未完成需要继续回调

回调方法入口,子类可重写该方法 注意: 1、微信回调超时时间为2s,建议用户使用异步处理流程,确认成功之后立刻回复微信服务器 2、微信服务器在调用失败或者接到回包为非确认包的时候,会发起重试,需确保你的回调是可以重入

Parameters

array $data

回调解释出的参数

string $msg

如果回调处理失败,可以将错误信息输出到该方法

Returns

\true回调出来完成不需要继续回调,false回调处理未完成需要继续回调

NotifyCallBack()

NotifyCallBack(array  $data) : \true回调出来完成不需要继续回调,false回调处理未完成需要继续回调

notify回调方法,该方法中需要赋值需要输出的参数,不可重写

Parameters

array $data

Returns

\true回调出来完成不需要继续回调,false回调处理未完成需要继续回调

ReplyNotify()

ReplyNotify(boolean  $needSign = true) 

回复通知

Parameters

boolean $needSign

是否需要签名输出