0

好吧,我通过单页 php 脚本使用 payeezy 作为支付网关集成。下面是我的代码

1)index.html

<html>
    <body background="skyblue">
        <h1 style="text-align:center">User Payment Page</h1>
        <br>
        <form action="Samplegge4payment.php" method="post">
            <table align="center" border='1'>
                <!--<th>Enter Product Description</th>--><th>Enter Amount(USD)</th>
                <!--<TR><TD><input type="text" name="x_desc"/></TD>-->
                <TD><input name="x_amount" value="" type="text"></TD></TR>
                <TR>
                    <TD colspan=3><center><input type="submit" value="Pay Now"></center> </TD>
                </TR> 
            </TABLE>
        </form>
    </body>
</html>

2)Samplegge4payment.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>
        Payment Pages: Sample PHP Payment Form
        </title>
        <style type="text/css">
        label {
        display: block;
        margin: 5px 0px;
        color: #AAA;
        }
        input {
        display: block;
        }
        input[type=submit] {
        margin-top: 20px;
        }
        </style>

    </head>
    <body>
        <h1>Processing Please Wait...</h1>

        <form action="https://demo.globalgatewaye4.firstdata.com/payment" method="POST" name="myForm" id="myForm">
        <!--<form action="https://checkout.globalgatewaye4.firstdata.com/payment" method="POST" name="myForm" id="myForm">-->

            <?php
            $x_login = "HCO-DEMO-202"; // Take from Payment Page ID in Payment Pages interface
            $transaction_key = "0ZFNA2QayjNbeiiHKulT"; // Take from Payment Pages configuration interface
            //$x_relay_response="T5ZvGEJwQwQdtIZmNgCo";
            //$x_desc=$_POST['x_desc'];
            $x_amount = $_POST["x_amount"];
            $x_currency_code = "USD"; // Needs to agree with the currency of the payment page
            srand(time()); // initialize random generator for x_fp_sequence
            $x_fp_sequence = rand(1000, 100000) + 123456;
            $x_fp_timestamp = time(); // needs to be in UTC. Make sure webserver produces UTC

            // The values that contribute to x_fp_hash
            $hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount . "^" . $x_currency_code;
            $x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);

            echo ('<input name="x_login" value="' . $x_login . '" type="hidden">' );
            echo ('<input name="x_amount" value="' . $x_amount . '" type="hidden">' );
            //echo ('<input name="x_desc" value="' . $x_desc . '" type="hidden">' );
            echo ('<input name="x_fp_sequence" value="' . $x_fp_sequence . '" type="hidden">' );
            echo ('<input name="x_fp_timestamp" value="' . $x_fp_timestamp . '" type="hidden">' );
            echo ('<input name="x_fp_hash" value="' . $x_fp_hash . '" size="50" type="hidden">' );
            echo ('<input name="x_currency_code" value="' . $x_currency_code . '" type="hidden">');

         //create parameters input in html
        foreach ($_POST as $a => $b) {
            echo "<input type='hidden' name='".htmlentities($a)."' value='".htmlentities($b)."'>";
        }

        ?>

            <input type="hidden" name="x_show_form" value="PAYMENT_FORM"/>
        </form>

        <script type='text/javascript'>document.myForm.submit();</script>

    </body>
</html>

现在我在按下提交按钮后进入页面下方

支付截图

它很好,因为它只显示数量和成功处理。

但问题是我想要一个具有产品名称、描述、数量、id 和价格的 php 脚本,并且它应该在支付处理页面上反映相同。

我知道我必须在我的演示 payeeze 帐户中自定义一些数据,但不知道是哪一个以及如何查看更改以及产品描述、数量、价格、id 和金额。

谁能帮帮我?

4

0 回答 0