Update ordercomplete.pgkcp.php

This commit is contained in:
Namhyeon Go 2019-10-14 01:16:17 +09:00 committed by GitHub
parent d746bf15c6
commit b8af7b66e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,9 +26,9 @@ $pay_method_alias = get_requested_value("pay_method_alias");
// A001: free plan (무료)
// A002: hand-writing payment (수기결제, 무통장입금 등)
$action = "cancel";
if(in_array($res_cd, array("0000", "A001")) {
if(in_array($res_cd, array("0000", "A001"))) {
$action = "complete";
} elseif(in_array($res_cd, array("A002")) {
} elseif(in_array($res_cd, array("A002"))) {
$action = "hold";
}
@ -51,14 +51,43 @@ if(!$fw) {
show_errors();
}
// response
$_token = get_session_token();
if(empty($redirect_url)) {
$jscontent = <<<EOF
<!doctype html>
<html>
<head>
<meta charset="utf8">
</head>
<body>
<script type="text/javascript">//<!--<![CDATA[
if(window.opener && !window.opener.closed) {
window.opener.payman_callback({
"token": "$_token",
"ordr_idxx": "$ordr_idxx",
"res_cd": "$res_cd",
"pay_method_alias": "$pay_method_alias"
});
window.close();
self.close();
this.close();
}
//]]>--></script>
</body>
</html>
EOF;
echo $jscontent;
} else {
// redirect
redirect_uri(get_final_link($redirect_url, array(
"_token" => get_session_token(),
"_route" => get_requested_value("route"),
"_action" => $action,
"_ordr_idxx" => $ordr_idxx,
"_res_cd" => $res_cd,
"_pay_method_alias" => $pay_method_alias
), false), array(
"check_origin" => true
));
redirect_uri(get_final_link($redirect_url, array(
"_token" => $_token,
"_route" => get_requested_value("route"),
"_action" => $action,
"_ordr_idxx" => $ordr_idxx,
"_res_cd" => $res_cd,
"_pay_method_alias" => $pay_method_alias
), false), array(
"check_origin" => true
));
}