Ejemplo n.º 1
0
            exit("something is wrong");
        }
        $con->beginTransaction();
        $stmt = $con->prepare("UPDATE `sadari`.`request_charge` AS rc \n\t\t\t\t\tSET rc.state = 1, rc.processed_at = NOW()\n\t\t\t\t\tWHERE rc.moid = '{$Moid}'");
        if (!$stmt->execute()) {
            throw new PDOException("request_charge update fails");
        }
        $stmt = $con->prepare("UPDATE `sadari`.`operator` AS o\n\t\t\t\t\tINNER JOIN `sadari`.`request_charge` AS rc \n\t\t\t\t\tON (o.id = rc.user_id)\n\t\t\t\t\tSET o.point = {$_SADARI_NEW_POINT} \n\t\t\t\t\tWHERE rc.moid = '{$Moid}'");
        if (!$stmt->execute()) {
            throw new PDOException("request_charge update fails");
        }
        $stmt = $con->prepare("INSERT INTO `sadari`.`point`\n\t\t\t\t\t(user_id, type, reason, how_much, charge_id, created_at, updated_at)\n\t\t\t\t\tVALUES ({$_SADARI_RC_USER_ID}, 1, 2, {$_SADARI_RC_HOWMUCH}, {$_SADARI_RC_ROW_ID}, now(), now())");
        if (!$stmt->execute()) {
            throw new PDOException("insert into point fails");
        }
        $con->commit();
    } catch (PDOException $e) {
        $con->rollback();
        print "Error : " . $e->getMessage() . "<br/>";
        die;
    }
} else {
    // 결제 실패시 DB처리 하세요.
}
?>
	
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NICEPAY :: 결제 요청 결과</title>
<link rel="stylesheet" href="css/basic.css" type="text/css" />