简体   繁体   English

Payzippy付款网关在PHP中的集成

[英]Payzippy Payment gateway Integration in PHP

can any one help me to integrate payzippy with php? 谁能帮助我将payzippy与php集成? where to get the callback url and how to get the test MID to test the payment in sandbox ? 在哪里获取回调URL以及如何获取测试MID以测试沙箱中的付款?

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. 对于回调URL,您需要提供一个由您创建的文件名。 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. 假设您已经创建了www.example.com/admin、www.example.com/front-end-checkout,然后从www.example.com/front-end-checkout转到https://www.payzippy.com/payment / api / charging / v1 ,如果payzippy已收到您的回叫网址,则付款完成后它将重定向到该页面。 So, create a file "anyname.php" and pass it as callback url " http://domain.com/anyname.php ". 因此,创建一个文件“ anyname.php”并将其作为回调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 在该anyname.php(回调页面)中,您可以执行$ _REQUEST,它将获取诸如以下内容的数据:transaction_status,payzippy_transaction_id等。 转到收费API以了解更多信息

  2. For sandbox contact PayZippy they will provide you with MID to play around. 对于沙盒,请联系PayZippy,他们将为您提供MID,供您玩耍。

PHP sdk PHP SDK

You can get test Merchant ID and secret key via mail upon request to contactus@payzippy.com 您可以通过请求发送到contactus@payzippy.com通过邮件获取测试商家ID和密钥。

To use the sample code, copy the payzippy files & directories to a directory of your choice. 要使用示例代码,请将payzippy文件和目录复制到您选择的目录中。 It can be server's document root of you web server. 它可以是Web服务器的服务器文档根目录。 (ie where your current php files, for your website, are stored) (即用于您网站的当前php文件的存储位置)

Open php-sdk/payzippy-sdk/Config.php file and set up your config details such as Merchant ID, Secret Key, Callback URL. 打开php-sdk / payzippy-sdk / Config.php文件并设置您的配置详细信息,例如商户ID,秘密密钥,回调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. 对于包含的示例,回调URL应指向examples / response文件夹下的charge_response.php文件。 So, if you access your site locally as http://localhost/ , then callback url http://localhost/php-sdk/examples/response/charging_response.php 因此,如果您以http://localhost/本地访问站点,则回调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 = ""; 我已经完成了payzippy在php中的集成,回调URL在配置文件第12行的payzippy-sdk中完成const CALLBACK_URL =“”; // Your callback URL //您的回调网址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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