softon / indipay

The Laravel Framework Package for Indian Payment Gateways. Currently Supported Gateway: CCAvenue, PayUMoney, EBS, CitrusPay ,ZapakPay (Mobikwik), Paytm, InstaMojo , Mocker
http://softon.github.io/indipay
MIT License
64 stars 83 forks source link

What is 'tid' ? Getting `IndipayParametersMissingException` while initiating the purchase in CCAvenue #1

Closed MehulBawadia closed 9 years ago

MehulBawadia commented 9 years ago

Hello,

I have installed your package in my application successfully. Now when I initiate the payment process using CCAvenue, I get IndipayParametersMissingException on line 102. When checked with the source code, there is 'tid' => 'required' attribute that has been passed in the checkParameters() method.

So just to avoid that exception, I wrote the following:

'tid' => '1'

in the processing of initiating the transaction method.

Here's my updated controller method:

public function proceedToCheckout(Request $request)
{
    $orderCode = Order::latest()->limit(1)->first();
    $parameters = [
        'merchant_id' => $request->get('merchant_id'),
        'currency' => $request->get('currency'),
        'redirect_url' => $request->get('redirect_url'),
        'cancel_url' => $request->get('cancel_url'),
        'language' => 'EN',
        'order_id' => $orderCode->order_code,
        'actionId' => $request->get('actionID'),
        'TxnType' => $request->get('TxnType'),
        'amount' => $request->get('amount'),

        /* below line when written, throws no error */
        'tid' => '1'
    ];

    return Indipay::purchase($parameters);
}

So the question is, what is tid and what am I suppose to pass as the parameter for tid ?

softon commented 9 years ago

tid is a required field for ccavenue payment gateway. It stands for Transaction ID. It should be a unique value representing the current transaction. you can use below function for generating a transaction id.


time().rand(111,999)
MehulBawadia commented 9 years ago

But I don't see anything called as transaction id or tid in the documentation: https://world.ccavenue.com/downloads/CCAVenueWorldIntegrationManual.pdf

Neither they have asked to send tid as a parameter. Check page 15 of the same documentation file.

softon commented 9 years ago

I see, this package is currently supporting CCAvenue.com and not CCAveneue World. Though i would like to include support for it too but i donot have its php integration kit.

sayeedRR commented 6 years ago

Awesome package,

I am using this package with laravel with CCavanue, only challenge is how to pass field value like address and mobile etc on payment page

MehulBawadia commented 6 years ago

What do you mean by payment page? You mean CCAvenue payment page where the user will insert their card details and make payment, or do you mean your application's payment page? Kindly clarify.

If you mean CCAvenue's payment page, then simply pass it in paramters array and you should be done. Check the PDF link what all paramters you can send to CCAvenue..

Something like this (Only to get the idea):

$paramters = [
    'merchant_id' => env('merchant_id'),
    'redirect_url' => env('REDIRECT_URL'),
    'cancel_url' => env('CANCEL_URL'),
    'order_id' => $orderCode->order_code,
    'amount' => $request->get('amount'),

    // billing_information
   'billing_full_name'=> $user->name,
   'billing_email' => $user->email,
   'billing_contact_number' => $user->contact->mobile_number,
   'billing_address' => $user->getLocalAddress(),
   'billing_city' => $user->address->city,
   'billing_state' => $user->address->state,
   'billing_country' => $user->address->country,
];
sayeedRR commented 6 years ago

public function makepayment(Request $request){ // $selectPayment=DB::table('payments')->select('id')->count(); // $newvalue=$selectPayment+1; // date_default_timezone_set('Asia/Kolkata'); $uniqueCode=(date("ymd").date('hi')); $paybleAmount=session('payableAmnt'); $returnid=77; $orderId=$returnid; $parameters = [ 'tid' => $uniqueCode, 'order_id' => $orderId, 'amount' => $paybleAmount, 'merchant_param1'=>$returnid, 'merchant_param2'=>'PRODUCT', ]; // gateway = CCAvenue / PayUMoney / EBS / Citrus / InstaMojo / ZapakPay / Mocker $order = Indipay::gateway('ccavenue')->prepare($parameters); // echo '

';print_r($order);dd();
return Indipay::process($order);

}

sayeedRR commented 6 years ago

Thank you for your support Mr. MehulBawadia I got it

abhiurvam commented 6 years ago

i have tried with $parameters = [

            'tid' => $request->input('tid'),

            'order_id' => $request->input('order_id'),

            'amount' => $request->input('amount'),
            // billing_information
            'billName' => $request->input('billing_name'),
            'billAddress' => $request->input('billing_address'),
            'billZip' => $request->input('billing_zip'),
            'billCity' => $request->input('billing_city'),
            'billState' => $request->input('delivery_state'),
            'billCountry' => $request->input('delivery_country'),
            'billTel' => $request->input('billing_tel'),
            'billEmail' => $request->input('billing_email'),
        ];

but not working

MehulBawadia commented 6 years ago

@abhiurvam Kindly go through this comment.. I have given clear way of what is to be sent to the payment gateway..

Also, what other parameters can be sent are listed on the PDF File.Though outdated, yet it works.. I have it integrated in my latest Laravel 5.5.* E-Commerce project.. Please go through that..

abhiurvam commented 6 years ago

Thank you i got resolve that can you please tell me i getting error after submitting detail means on response indipay/response TokenMismatchException in VerifyCsrfToken.php line 53: