如何将PayuMoney支付网关与Codeigniter集成


how to integrate payumoney payment gateway with codeigniter

我开发了用于在html,javaScript,Php Web服务(codeigniter框架)中为网站和移动应用程序预订医生的项目。现在我需要与Payumoney付款集成 gateway.so 请有人帮助我逐步说明code.iam是此支付集成的新手。

不要接受其他方法,但是在互联网和堆栈溢出中没有足够的关于codeigniter中Payumoney集成的文档...我已经解决了...请逐步完成该过程

  1. 如果你有一个"用户"控制器(比如说用户.php),添加一个函数payum()或类似的东西。我正在添加下面的代码

     function payum()
     {
     $userid = $this->ion_auth->get_user_id();
                    if(is_numeric($userid)) {
    
    $this->data['title'] = 'payU Money cash Deposit';
    $this->data['records']= $this->base_model->run_query("select *   FROM    users where id=".$userid
    );
    $this->data['content']          = 'user/payum';
    $this->_render_page('user/payum', $this->data);
    }
    else {
        $this->prepare_flashmessage('Session Expired!', 2);
        redirect('auth/login', 'refresh');
    }
    }  
    
  2. 然后在您的视图/用户中添加一个页面付款.php(您可以修改它...我正在添加详细代码

    <?php   
    if(count($records)) {
    foreach($records as $d) {
    ?>
    <div class="row margin" style="padding:10%">
    <fieldset>
    <legend>Subscription info</legend>
    <div class="form-group">
    <label>Name:</label>  <?php echo $d->username;?> <br/> 
    <label>Amount:</label>  <?php echo $d->fees;?><br/>  
    <label>E-mail:</label>  <?php echo $d->email;?> <br/> 
    <label>Phone:</label>  <?php echo $d->phone;?>  <br/> 
    </div>
    </fieldset>
    <?PHP 
    }}  ?>
    </div>
    <?php
    $price=$d->fees;
    // Merchant key here as provided by Payu
    $MERCHANT_KEY = 'pay you money merchant key';
    // Merchant Salt as provided by Payu
    $SALT =  "pay you money salt";
    $txnid = $d->id ;
    $hash_string = $MERCHANT_KEY."|".$txnid."|".$price."|Subscription fess MCQUES|".$d->username."|".$d->email."|".$d->id."||||||||||".$SALT;
    $hash = hash('sha512', $hash_string);
    ?>
    <div class="col-sm-12" style="padding:8%; font-family: georgia; font-size: 18px;">
    <form method="POST" action="https://secure.payu.in/_payment">
    <input type="hidden" name="key" value="<?php echo $MERCHANT_KEY; ?>" />
    <input type="hidden" name="hash" value="<?php echo $hash; ?>"/>
    <input type="hidden" name="txnid" value="<?php echo $txnid; ?>" />
     You can change your contact number <input type="text" name="phone" value="<?php echo $d->phone;?>" />
    <br><br><input type="hidden" name="amount" value="<?php echo $price;?>" />
    <input type="hidden" name="firstname" id="firstname" value="<?php echo $d->username;?>" >
    <input type="hidden"  name="email" id="email" value="<?php echo $d->email;?>"  />
    <input type="hidden"  name="productinfo" value="Subscription fess MCQUES">
    <input type="hidden"  name="surl" value="<?php echo base_url();?>payu/success.php" size="64" />
    <input type="hidden"  name="furl" value="<?php echo base_url();?>payu/failure.php" size="64" />
    <input type="hidden"   name="service_provider" value="payu_paisa" size="64" />
    <input  type="hidden"  name="udf1" value="<?php echo $d->id;?>">
    <input type="submit" value="Continue" class="btn btn-success" >
    </form>
    </div>
    

只需根据您的需要更改字段即可。谢谢。。。