Example #1
0
 /**
  * 将xml转为array
  * @param string $xml
  * @return array
  * @throws WxPayException
  */
 public static function Init($xml)
 {
     $obj = new self();
     $obj->FromXml($xml);
     //fix bug 2015-06-29
     if ($obj->values['return_code'] != 'SUCCESS') {
         return $obj->GetValues();
     }
     $obj->CheckSign();
     return $obj->GetValues();
 }
Example #2
0
 /**
  * 将xml转为array
  * @param string $xml
  * @throws WxPayException
  */
 public static function Init($xml)
 {
     $obj = new self();
     $obj->FromXml($xml);
     $obj->CheckSign();
     return $obj->GetValues();
 }
Example #3
0
 /**
  * 将xml转为array
  * @param string $xml
  * @throws WxPayException
  */
 public static function Init($mpid, $xml, $fnGetMpid = false)
 {
     $obj = new self();
     $obj->FromXml($xml);
     //fix bug 2015-06-29
     if ($obj->values['return_code'] != 'SUCCESS') {
         return $obj->GetValues();
     }
     if ($mpid === false) {
         $mpid = call_user_func($fnGetMpid, $obj->values);
     }
     $obj->CheckSign($mpid);
     return $obj->GetValues();
 }