我是codeigniter的新手,我正在开发一个像flipkart这样的电子商务应用程序,使用codeigniter,现在我想集成ccavenue支付网关到我们的网站,我已经参考了许多关于这一点的网站,但我无法得到适当的解决方案。请帮帮我,并为我提供ccavenue api文档。而且我还没有得到集成ccavenue.but的代码,我已经通过下面的url http://integrate-payment-gateway.blogspot.in/2012/01/ccavenue-payment-integration-php.html来继续集成ccavenue,我不知道如何将php脚本解析为codeigniter。
发布于 2013-08-08 14:39:24
在这里,您可以获得文档。
http://world.ccavenue.com/downloads/CCAVenueWorldIntegrationManual.pdf
您可以从ccavenue帐户获取代码。只要要求ccavenue帐户持有人将包含3种语言代码的zip文件夹发送给您,您必须使用php文件夹。
请提出以下要求
登录到ccavenue帐户并单击链接下载该工具包。您将在“如何设置您的ccavenue account?".
获得代码后,您只需以codeigniter的方式使用该代码。
你也可以看看这段代码。
http://technoread.net/webdesign/payment-gateways/item/238-ccavenue-payment-integration-php
发布于 2016-11-10 21:29:22
**Here is your view file subscription.php**
<html>
<head>
<script>
window.onload = function() {
var d = new Date().getTime();
document.getElementById("tid").value = d;
};
</script>
</head>
<body>
<form method="POST" name="customerData" action="<?php echo base_url('ws_user/ccavRequestHandler'); ?>">
<input type="hidden" name="tid" id="tid" />
<input type="hidden" name="merchant_id" value="your merchent id"/>
<input type="hidden" name="payment_option" value="OPTNBK">
<input type="hidden" name="order_id" value="123654789"/>
<input type="hidden" name="merchant_param1" value="your custom value"/>
<input type="hidden" name="merchant_param2" value="<?php echo $userId; ?>"/>
<input type="hidden" name="amount" value="<?php echo $amount; ?>"/>
<input type="hidden" name="currency" value="INR"/>
<input type="hidden" name="redirect_url" value="<?php echo base_url('webservice/payDone');?>"/>
<input type="hidden" name="cancel_url" value="<?php echo base_url('webservice/cancelPayment');?>"/>
<input type="hidden" name="billing_name" value="<?php echo $addressData[0]->name;?>"/>
<input type="hidden" name="billing_address" value="<?php echo $addressData[0]->AddressLine1 . ' '. $addressData[0]->Addressline2;?>"/>
<input type="hidden" name="billing_city" value="<?php echo $addressData[0]->city_name;?>"/>
<input type="hidden" name="billing_state" value="<?php echo $addressData[0]->state_name;?>"/>
<input type="hidden" name="billing_zip" value="<?php echo $addressData[0]->Zipcode;?>"/>
<input type="hidden" name="billing_country" value="<?php echo $addressData[0]->country_name;?>"/>
<input type="hidden" name="billing_tel" value="<?php echo $addressData[0]->contact;?>"/>
</form>
<script language='javascript'>document.customerData.submit();</script>
</body>
</html>这是您的CI函数
public function ccavRequestHandler()
{
$this->load->view('ccavRequestHandler');
}这是您的文件ccavRequestHandler.php
<html>
<body>
<?php include('Crypto.php')?>
<?php
$merchant_data='';
$working_key='your working key';//Shared by CCAVENUES
$access_code='your access code';//Shared by CCAVENUES
foreach ($_POST as $key => $value)
{
$merchant_data.=$key.'='.urlencode($value).'&';
}
$encrypted_data=encrypt($merchant_data,$working_key); ?>
<form method="post" name="redirect" action="https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction">
<?php
echo "<input type=hidden name=encRequest value=$encrypted_data>";
echo "<input type=hidden name=access_code value=$access_code>";?>
</form>
<script language='javascript'>document.redirect.submit()</script>
</body>
</html>这是您的成功URL
public function payDone()
{
$encResp=$_REQUEST['encResp'];
$working_key='YOURKEY';
$decryptValues=explode('&',$this->common->decrypt($encResp,$working_key));
$dataSize=sizeof($decryptValues);
/*CODE FOR GET YOUR VERIABLE WHEN REDIRECT ON YOUR URL */
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
if($information[0] == 'merchant_param1')
{
$address = $information[1];
}
if($information[0] == 'merchant_param2')
{
$userid = $information[1];
}
if($information[0] == 'order_status')
{
$order_status = $information[1];
}
}
/*CHECK PAYMENT IS SUCCESS OR FAIL */
if($order_status == 'Success')
{
/* DO what ever you want after successful payment */ Redirect('webservice/paymentSuccess');
}
else
{
/* do whatever you want after failure */
redirect('webservice/paymentFail');
}
}https://stackoverflow.com/questions/18101825
复制相似问题