Example #1
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 #2
0
 /**
  * 将xml转为array
  * @param string $xml
  * @throws Exception
  */
 public static function Init($xml, API $api)
 {
     WechatLog::create(['log' => $xml, 'waid' => $api->waid, 'url' => app('url')->full()]);
     $obj = new self();
     $obj->fromXml($xml);
     //fix bug 2015-06-29
     if ($obj->values['return_code'] == 'SUCCESS') {
         $obj->CheckSign($api->mchkey);
     }
     return $obj->getValues();
 }
Example #3
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();
 }
 /**
  * 
  * 使用数组初始化对象
  * @param array $array
  * @param 是否检测签名 $noCheckSign
  */
 public static function InitFromArray($array, $noCheckSign = false, $WxCfg)
 {
     $obj = new self();
     $obj->FromArray($array);
     if ($noCheckSign == false) {
         $obj->CheckSign($WxCfg);
     }
     return $obj;
 }
Example #5
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();
 }