protected function aliPay($orderId, $orderDesc, $totalAmount) { PayModel::onCreateOrderOk($orderId, array('pay_type' => PayModel::PAY_TYPE_ALI)); $ret = AliSDK::wapPay(ALI_PAY_PARTNER_ID, CONFIG_PATH . '/alipay/rsa_private_key.pem', $orderId, $orderDesc, number_format($totalAmount, 2, '.', ''), APP_URL_BASE . '/pay/PayNotify/aliPay', APP_URL_BASE . '/pay/OrderPay/aliPayReturn'); if ($ret === false) { $this->ajaxReturn(ERR_SYSTEM_ERROR, '生成支付宝支付数据失败,稍重试'); return; } $payHtml = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ' . 'Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . '<title>支付宝安全支付</title>' . '</head><body>' . $ret . '</body></html>'; echo $payHtml; }
public function aliPay() { $orderId = date('Ymd') . mt_rand(1000000000, 1999999999); PayModel::onCreateOrderOk($orderId, array('pay_type' => PayModel::PAY_TYPE_ALI)); $ret = AliSDK::wapPay(ALI_PAY_PARTNER_ID, CONFIG_PATH . '/alipay/rsa_private_key.pem', $orderId, '测试1分钱', 0.01, APP_URL_BASE . '/pay/PayNotify/aliPay', APP_URL_BASE . '/pay/OrderPay/aliPayReturn'); echo <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>支付宝手机网站支付接口接口</title> </head> {$ret}; </body> </html> HTML; }