Code Duplication    Length = 32-32 lines in 2 locations

sdk/AllPay.Payment.Integration.php 2 locations

@@ 936-967 (lines=32) @@
933
    }
934
}
935
936
class TradeNoAio extends Aio
937
{
938
    public static function CheckOut($target = '_self', $arParameters = [], $HashKey = '', $HashIV = '', $ServiceURL = '')
939
    {
940
        //產生檢查碼
941
        $EncryptType = $arParameters['EncryptType'];
942
        unset($arParameters['EncryptType']);
943
944
        $szCheckMacValue = CheckMacValue::generate($arParameters, $HashKey, $HashIV, $EncryptType);
945
946
        //生成表單,自動送出
947
        $szHtml = '<!DOCTYPE html>';
948
        $szHtml .= '<html>';
949
        $szHtml .= '<head>';
950
        $szHtml .= '<meta charset="utf-8">';
951
        $szHtml .= '</head>';
952
        $szHtml .= '<body>';
953
        $szHtml .= "<form id=\"__allpayForm\" method=\"post\" target=\"{$target}\" action=\"{$ServiceURL}\">";
954
955
        foreach ($arParameters as $keys => $value) {
956
            $szHtml .= "<input type=\"hidden\" name=\"{$keys}\" value=\"{$value}\" />";
957
        }
958
959
        $szHtml .= "<input type=\"hidden\" name=\"CheckMacValue\" value=\"{$szCheckMacValue}\" />";
960
        $szHtml .= '</form>';
961
        $szHtml .= '<script type="text/javascript">document.getElementById("__allpayForm").submit();</script>';
962
        $szHtml .= '</body>';
963
        $szHtml .= '</html>';
964
965
        echo $szHtml;
966
        exit;
967
    }
968
}
969
970
class QueryTrade extends Aio
@@ 1004-1035 (lines=32) @@
1001
    }
1002
}
1003
1004
class FundingReconDetail extends Aio
1005
{
1006
    public static function CheckOut($target = '_self', $arParameters = [], $HashKey = '', $HashIV = '', $ServiceURL = '')
1007
    {
1008
        //產生檢查碼
1009
        $EncryptType = $arParameters['EncryptType'];
1010
        unset($arParameters['EncryptType']);
1011
1012
        $szCheckMacValue = CheckMacValue::generate($arParameters, $HashKey, $HashIV, $EncryptType);
1013
1014
        //生成表單,自動送出
1015
        $szHtml = '<!DOCTYPE html>';
1016
        $szHtml .= '<html>';
1017
        $szHtml .= '<head>';
1018
        $szHtml .= '<meta charset="utf-8">';
1019
        $szHtml .= '</head>';
1020
        $szHtml .= '<body>';
1021
        $szHtml .= "<form id=\"__allpayForm\" method=\"post\" target=\"{$target}\" action=\"{$ServiceURL}\">";
1022
1023
        foreach ($arParameters as $keys => $value) {
1024
            $szHtml .= "<input type=\"hidden\" name=\"{$keys}\" value=\"{$value}\" />";
1025
        }
1026
1027
        $szHtml .= "<input type=\"hidden\" name=\"CheckMacValue\" value=\"{$szCheckMacValue}\" />";
1028
        $szHtml .= '</form>';
1029
        $szHtml .= '<script type="text/javascript">document.getElementById("__allpayForm").submit();</script>';
1030
        $szHtml .= '</body>';
1031
        $szHtml .= '</html>';
1032
1033
        echo $szHtml;
1034
        exit;
1035
    }
1036
}
1037
1038
abstract class Verification