/** * 支付宝 */ public function notifyAction() { $aParam = $this->getParams(); Yaf_Logger::debug('notify: ' . json_encode($aParam, JSON_UNESCAPED_UNICODE) . "\n", 'alipay'); $bRet = Payment_Alipay::callback($aParam); $iOrderID = $aParam['out_trade_no']; $iMoney = $aParam['total_fee']; if ($bRet) { // 支付成功 $this->logPay($aParam); $aArg = array('iPayType' => Model_Finance::TYPE_ALIPAY, 'sPayAccount' => $aParam['buyer_email'], 'sPayOrder' => $aParam['trade_no']); Model_Finance::pay($iOrderID, $iMoney, $aArg); echo "success"; } else { // 支付失败 echo "fail"; } return false; }
public static function log($sMsg) { Yaf_Logger::debug(date('[Y-m-d H:i:s]') . $sMsg, self::$sLogName); echo date('[Y-m-d H:i:s]') . $sMsg; }
public static function debug($msg) { Yaf_Logger::debug($msg . "\n", 'wxpay'); }