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($request) { /*{{{*/ //判断数据来源是否是快钱的 //if($this->checkSourceIPValid() == false){ // return self::PAYED_STATUS_SIGNITURE_ERROR; //} //注意顺序不能变 $params = array(); $params['merchantAcctId'] = $request->merchantAcctId; $params['version'] = $request->version; $params['language'] = $request->language; $params['signType'] = $request->signType; $params['payType'] = $request->payType; $params['bankId'] = $request->bankId; $params['orderId'] = $request->orderId; $params['orderTime'] = $request->orderTime; $params['orderAmount'] = $request->orderAmount; $params['dealId'] = $request->dealId; $params['bankDealId'] = $request->bankDealId; $params['dealTime'] = $request->dealTime; $params['payAmount'] = $request->payAmount; $params['fee'] = $request->fee; $params['ext1'] = $request->ext1; $params['ext2'] = $request->ext2; $params['payResult'] = $request->payResult; $params['errCode'] = $request->errCode; $signMsg = $request->signMsg; DBC::requireNotEmpty($params, '参数信息不可为空'); DBC::requireNotEmpty($signMsg, '签名信息不可为空'); list($sn, $type) = Pay::explodeSN($request->orderId); $this->orderId = $sn; $this->type = Pay::$typeDescs[$type]; $this->name = Pay::NAME_TYPE_QPAY_NOTIFY; $content = $params; $content['signMsg'] = $signMsg; $this->content = $content; $this->amount = $request->payAmount / 100; //这个要在最后执行 $this->status = $this->checkQpayData(); return $this; }
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) { /*{{{*/ $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; }