【问题标题】:how do i integrate ccavenue payment gateway in my Laravel api for mobile application我如何在我的 Laravel api 中为移动应用程序集成 ccavenue 支付网关
【发布时间】:2019-08-04 01:31:34
【问题描述】:

如何在我的 Laravel 应用程序 中集成 ccavenue 支付网关。我想在 android 的 web 服务 api 中实现这一点。实际上我想知道如何在我的 android 应用程序的移动结帐页面上与 laravel 集成 cc-avenue 支付网关

【问题讨论】:

    标签: laravel payment-gateway


    【解决方案1】:

    安装

    composer require kishanio/ccavenue
    

    使用

    use Kishnio\CCAvenue\Payment as CCAvenueClient;
    
    
    $ccavenue = new CCAvenueClient( '<merchant_id>', '<working_key>', '<redirect_url>' );
    
    // set details 
    $ccavenue->setAmount( '<Amount>' );
    $ccavenue->setOrderId( '<order_id>' );
    $ccavenue->setBillingName( '<billing_cust_name>' );
    $ccavenue->setBillingAddress( '<billing_cust_address>' );
    $ccavenue->setBillingCity( '<billing_cust_city>' );
    $ccavenue->setBillingZip( '<billing_cust_zip>' );
    $ccavenue->setBillingState( '<billing_cust_state>' );
    $ccavenue->setBillingCountry( '<billing_cust_country>' );
    $ccavenue->setBillingEmail( '<billing_cust_email>' );
    $ccavenue->setBillingTel( '<billing_cust_tel>' );
    $ccavenue->setBillingNotes( '<billing_cust_notes>' );
    
    // copy all the billing details to chipping details
    $ccavenue->billingSameAsShipping();
    
    // get encrpyted data to be passed
    $data = $ccavenue->getEncryptedData();
    
    // merchant id to be passed along the param
    $merchant = $ccavenue->getMerchantId();
    
    
    <!-- Request -->
    <form method="post" name="redirect" action="http://www.ccavenue.com/shopzone/cc_details.jsp"> 
        <?php
            echo '<input type=hidden name=encRequest value="'.$data.'"">';
            echo '<input type=hidden name=Merchant_Id value="'.$merchant.'">';
        ?>
    </form>
    
    <script language='javascript'>document.redirect.submit();</script>
    </body>
    </html>
    
    use Kishnio\CCAvenue\Payment as CCAvenueClient;
    
    // Get Response
    $response=$_POST["encResponse"];    
    
    $ccavenue = new CCAvenueClient( '<merchant_id>', '<working_key>', '<redirect_url>' );
    
    // Check if the transaction was successfull.
    echo $ccavenue->response( $response );
    

    或者你也可以使用这个包

    https://github.com/softon/indipay

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-16
      • 2011-08-07
      • 2013-05-03
      • 2017-09-23
      • 1970-01-01
      • 2017-12-19
      • 2014-07-07
      • 2015-12-21
      相关资源
      最近更新 更多