심

[고수님들] 소스 수정 부탁드립니다.

· 2008-05-23 (금) 11:56:41 · 1184 · 1
다날 결제 페이지 마무리 소스 입니다.

$g4_path = "../bbs";
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/outlogin.lib.php");
echo "$member[mb_id]";
echo "$member[mb_level]";
$level = $member[mb_level] + 1;
$sql = " update $g4[member_table] set mb_level = '$level' where mb_id = '$member[mb_id]' ";
sql_query($sql);


통해서 해당 페이지 까지 가면 회원레벨을 업데이트 시키고 있습니다만, 정상적인 방법이 아닌듯 싶습니다..

그래서 제가 원하는 방식은 결제완료가 되면, 회원레벨을 업데이트 시키고, 에러가 나면
레벨을 업데이트 안한다로 구현하고 싶습니다..

또, 결제가 완료되면, 현재창을 닫고, 알럿창으로, [결제가 완료 되었습니다. 이제 모든 서비스를 이용가능합니다.] 라고 알럿창을 띄우고 싶습니다..

소스 수정 도움 가능할까요?

<?php
header("Pragma: No-Cache");

/*
* TELEDIT 휴대폰 결제
* CPCGI.php3

* - 결제 완료 페이지
* 결제를 완료합니다. Confirm과 Bill이 실행되지 않을경우
* 정상처리되지 않습니다.

* DANAL Commerce Division Technique supporting Team
* EMail : [email protected]
*/

include("./inc/function.php");
?>
<?

$g4_path = "../bbs";
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/outlogin.lib.php");
echo "$member[mb_id]";
echo "$member[mb_level]";
$level = $member[mb_level] + 1;
$sql = " update $g4[member_table] set mb_level = '$level' where mb_id = '$member[mb_id]' ";
sql_query($sql);


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title>다날 휴대폰 결제</title>
</head>
<?php

$Trans = array();
$BillErr = false;

$Addition = array("ServerInfo","EncodedTID");

$Trans = MakeAddtionalInput($Trans,$HTTP_POST_VARS,$Addition);

// Confirm
$Res = CallTeledit("Confirm",$Trans);

if ($Res["Result"] == "0") {
//Bill
$Res2 = CallTeledit("Bill",$Trans);
if ($Res2["Result"] != "0")
$BillErr = true;
}

if ( $Res["Result"] == "0" && $Res2["Result"] == "0" ) {
/* 정상적으로 결제가 완료되었습니다.

* - Field 설명
* Result : 결제 결과 (0:성공)
* Info : 결제 전화번호, 주민등록번호 (|TelNum=xxxxxxxxxxx|Iden=xxxxxxxxxxxxx)
* Carrier : 통신사 (SKT/KTF/LGT)
* OTP : 승인번호
* TID : 거래코드
* CAP : 거래후 거래한도금액
* TotalAmount : 결제된 금액
* By... : Ready.php3에서 입력한 변수
*/
?>
<body>
결제가 완료 되었습니다.<br>
소스 보기를 하시면 필요한 값들을 확인하실 수 있습니다.
<form name="Success" action="WhereToGo?" method="post">
<?php
MakeFormInput($HTTP_POST_VARS, array("CAP"));
MakeFormInput($Res,array("Result","ErrMsg"));
?>
<INPUT TYPE="HIDDEN" NAME="Info" value="<?=$Info ?>">
</form>
<script>
// document.Success.submit();
</script>
<?php
} else {
if ($BillErr)
$Res = $Res2;

$ErrorCode = $Res["Result"];
$ErrorMessage = $Res["ErrMsg"];
$BackURL = "JavaScript:history.back()";
$AbleBack = false;

include("Error.php3");
}
?>
|

댓글 1개

해결했습니다..;;
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
08-05-23 조회 818
08-05-23 조회 1,743
08-05-23 조회 834
08-05-23 조회 846
08-05-23 조회 1,012
08-05-23 조회 1,241
08-05-23 조회 851
08-05-23 조회 1,020
08-05-23 조회 881
08-05-23 조회 808
08-05-23 조회 769
08-05-23 조회 1,030
08-05-23 조회 997
08-05-23 조회 994
08-05-23 조회 1,082
08-05-23 조회 1,185
08-05-23 조회 1,024
08-05-23 조회 1,584
08-05-23 조회 1,287
08-05-23 조회 1,030