I have developed project for booking appointments with doctors in html,javaScript,Php web services(codeigniter framework) for both website and mobile app.Now iam in need of integration with Payumoney payment gateway.so please someone help me of step by step instructions in a code.iam new to this payment integration.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Don't take it otherwise but there was no sufficient document about the payumoney integration in codeigniter in the internet as well as in stackoverflow... I have solve it... please do the process step by step
if you have a 'user' controller(say user.php) add a function payum() or like that. I am adding the code bellow
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'); } }
Then add a page payum.php in your view/user (you can modify it...).. I am adding the detail code
<?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>
Just change the fields according to your needs.... Thank you...