public function initCallBackData(array $data, $name) { /*{{{*/ $sign = $data["sign"]; $content = "notify_data=" . $data["notify_data"]; $res = $this->verify($content, $sign); if (false == $res) { return $res; } else { $out_trade_no = $this->getDataForXML($data["notify_data"], '/notify/out_trade_no'); list($sn, $type) = Pay::explodeSN($out_trade_no); Pay::checkNameInValidNames($name); $this->sn = $sn; $this->name = $name; $this->type = Pay::$typeDescs[$type]; $arrcontent = XString::xmlToArray($data["notify_data"]); $arrcontent['name'] = $name; $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8'); $this->content = $arrcontent; $this->total_fee = $this->getDataForXML($data["notify_data"], '/notify/total_fee'); $this->total_fee = (array) $this->total_fee; $this->total_fee = $this->total_fee[0]; $this->trade_status = $this->getDataForXML($data["notify_data"], '/notify/trade_status'); $this->trade_status = (array) $this->trade_status; $this->trade_status = $this->trade_status[0]; $this->data = $arrcontent; return $this; } }
public function initCallBackData(array $data, $name) { /*{{{*/ list($sn, $type) = Pay::explodeSN($data['out_trade_no']); Pay::checkNameInValidNames($name); $this->sn = $sn; $this->name = $name; $this->type = Pay::$typeDescs[$type]; $this->content = $data; $this->total_fee = $data['total_fee']; $this->trade_status = $data['trade_status']; $this->data = $data; return $this; }
public function initCallBackData(array $data, $name) { /*{{{*/ $waperAlipayFunction = wap_alipay_function::getInstance(); $out_trade_no = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/out_trade_no'); list($sn, $type) = Pay::explodeSN($out_trade_no); Pay::checkNameInValidNames($name); $this->sn = $sn; $this->name = $name; $this->type = Pay::$typeDescs[$type]; $arrcontent = XString::xmlToArray($data["notify_data"]); $arrcontent['name'] = $name; $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8'); $this->content = $arrcontent; $this->total_fee = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/total_fee'); $this->total_fee = (array) $this->total_fee; $this->total_fee = $this->total_fee[0]; $this->trade_status = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/trade_status'); $this->trade_status = (array) $this->trade_status; $this->trade_status = $this->trade_status[0]; $this->data = $arrcontent; return $this; }