'一括払い', '03' => '3回払い', '05' => '5回払い', '06' => '6回払い', '10' => '10回払い' ); // 送信パラメータ define ("SECURE_LINK_URL", "https://linkpt.cardservice.co.jp/cgi-bin/secure.cgi"); // 文字数制限 define ("CLIENTIP_LEN", 5); define ("SEND_LEN", 20); /************************************************************************************************************** * 関数名 :sfGetPaymentDB * 処理内容 :必要なデータを取得する。 * 引数1 : * 引数2 : * 引数3 : * 戻り値 :取得結果 **************************************************************************************************************/ function sfGetPaymentDB($module_id, $where = "", $arrWhereVal = array()){ $objQuery = new SC_Query(); $arrVal = array($module_id); $arrVal = array_merge($arrVal, $arrWhereVal); $arrRet = array(); $sql = "SELECT module_id, memo01 as clientip FROM dtb_payment WHERE module_id = ? " . $where; $arrRet = $objQuery->getall($sql, $arrVal); return $arrRet[0]; } /************************************************************************************************************** * 関数名 :sfPostPaymentData * 処理内容 :決済データ送信処理 * 引数1 : * 引数2 : * 引数3 : * 戻り値 :取得結果 **************************************************************************************************************/ function sfPostPaymentData($arrData, $arrInput, $quick_chage = false){ $arrPaymentDB = sfGetPaymentDB(MDL_ZEUS_ID); $telno = $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03']; $cardnumber = $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04']; if(!$quick_chage) { $arrPost = array( 'clientip' => $arrPaymentDB['clientip'], 'cardnumber' => $cardnumber, 'expyy' => $arrInput['card_year'], 'expmm' => $arrInput['card_month'], 'telno' => $telno, 'email' => $arrData['order_email'], 'sendid' => $arrData['order_id'], 'username' => $arrInput['card_name01'].$arrInput['card_name02'], 'money' => $arrData['total'], 'sendpoint' => 'eccube', 'send' => 'mall', 'pubsec' => '', 'div' => $arrInput['payment_class'] ); } else { // クイックチャージを利用する場合 $objQuery = new SC_Query(); $objQuery->setlimit(1); $objQuery->setorder("create_date DESC"); $arrRet = $objQuery->select("order_id, order_tel01, order_tel02, order_tel03", "dtb_order", "memo01 = ? AND customer_id = ?", array(MDL_ZEUS_ID, $arrData['customer_id'])); sfPrintR($arrRet); } $req = new HTTP_Request(SECURE_LINK_URL); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostDataArray($arrPost); if (!PEAR::isError($req->sendRequest())) { $response = $req->getResponseBody(); $response = mb_convert_encoding($response, "EUC-JP", "Shift-JIS"); } $req->clearPostData(); gfPrintLog("ゼウス応答結果:".$response); if(ereg('Success_order', $response)) { // 受注テーブルに記録する $arrVal["memo01"] = MDL_ZEUS_ID; // モジュールID $arrVal["memo03"] = $response; // 処理結果 // 受注一時テーブルに更新 sfRegistTempOrder($arrData['order_temp_id'], $arrVal); return true; } else { return false; } return $arrVal; } /************************************************************************************************************** * 関数名 :sfZeusDisp * 処理内容 :共通の表示処理 * 引数1 : * 引数2 : * 引数3 : * 戻り値 :取得結果 **************************************************************************************************************/ function sfZeusDisp($objPage, $payment_id) { $objQuery = new SC_Query(); // 支払い方法の説明画像を取得する。 $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id)); $objPage->tpl_payment_method = $arrRet[0]['payment_method']; $objPage->tpl_payment_image = $arrRet[0]['payment_image']; return $objPage; } ?>