简体   繁体   中英

Payzippy Payment gateway Integration in PHP

can any one help me to integrate payzippy with php? where to get the callback url and how to get the test MID to test the payment in sandbox ?

Can I get all the example features in one file ?

here goes with some experiment code ?

     <?php
require dirname(__FILE__)."/payzippy-sdk/ChargingRequest.php";


$pz_charging = new ChargingRequest();


$pz_charging->set_buyer_email_address($_POST["buyer_email_address"])
    ->set_merchant_transaction_id($_POST["merchant_transaction_id"])
    ->set_transaction_amount($_POST["transaction_amount"])
    ->set_payment_method($_POST["payment_method"])
    ->set_bank_name($_POST["bank_name"])
    ->set_ui_mode($_POST["ui_mode"]);


$charging_object = $pz_charging->charge();


if ($charging_object["status"] != "OK"){
    echo '<p>Error: ', $charging_object["error_message"], "</p>";
    exit();
}
?>

<html>
    <head>


     </head>
        <body>



  <div class="navbar navbar-inverse">
        <div class="navbar-inner">
            <div class="container">
                <a class="brand">logo here</a>
            </div>
        </div>
    </div>



       <div class="container">
            <div class="wrap inter-content" id="detect-iframe" style="display: block;">
                <section class="main-info">
                    Processing your payment request...
                    <div class="progress progress-striped active">
                        <div class="bar" style="width: 100%;"></div>
                    </div>
                </section>
                <p class="no-re-warn not">Please do not press stop, refresh or back button</p>
            </div>


   <form method="POST" action="<?php echo $charging_object["url"]?>" id="payzippyForm">
        <?php
        foreach($charging_object["params"] as $key => $value) {
            echo "<input type='hidden' name='{$key}' value='$value'>";
        }
        ?>
    </form>
</div>

<script>
    document.getElementById("payzippyForm").submit();
</script>

        </body>
    </html>

@saina:对于Payzippy中的Netbanking,您将需要由payzippy提供的银行数据库(可能是经过银行验证的数据库),或者对于沙箱,您可以传递银行值,例如示例文件中所示的“ HDFC”。

  1. For callback URL you need to give a file name created by you. say you have created www.example.com/admin, www.example.com/front-end-checkout then from your www.example.com/front-end-checkout you goto https://www.payzippy.com/payment/api/charging/v1 there if payzippy has received a call back url from you, then after payment completion it will redirect to that page. So, create a file "anyname.php" and pass it as callback url " http://domain.com/anyname.php ". In that anyname.php(callback page) you can do $_REQUEST, which will fetch data like: transaction_status, payzippy_transaction_id, etc. goto charging API to get to know more

  2. For sandbox contact PayZippy they will provide you with MID to play around.

PHP sdk

You can get test Merchant ID and secret key via mail upon request to contactus@payzippy.com

To use the sample code, copy the payzippy files & directories to a directory of your choice. It can be server's document root of you web server. (ie where your current php files, for your website, are stored)

Open php-sdk/payzippy-sdk/Config.php file and set up your config details such as Merchant ID, Secret Key, Callback URL. The examples won't work without setting up the config details.

For the examples included, the callback url should point to the charging_response.php file under examples/response folder. So, if you access your site locally as http://localhost/ , then callback url http://localhost/php-sdk/examples/response/charging_response.php

i have done integration of payzippy in php call back url is done in payzippy-sdk in config file line 12 const CALLBACK_URL = ""; // Your callback URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM