0

I am working with Web services/Api in codeigniter,I want to integrate "Razorpay" Account so for this i am trying to integrate "Razorpay" source code But i am getting error "syntax error, unexpected 'use' (T_USE)" Here is my code

function razorpayApi_post()
{
    include 'razorpay/Razorpay.php';
    use Razorpay\Api\Api;
    $api_key="xxxxxxxxxxxxxxxx";
    $api_secret="xxxxxxxxxxxxxxx";
    $api = new Api($api_key, $api_secret);
}    
12
  • which version are you using? Commented Dec 16, 2019 at 9:52
  • instead of use Razorpay\Api\Api; try $className = new Razorpay(); $function Name = $className->api(); Commented Dec 16, 2019 at 9:54
  • Here is your answer stackoverflow.com/questions/3700626/… Commented Dec 16, 2019 at 9:59
  • @Gulshan: i am using codeignter version 3 Commented Dec 16, 2019 at 10:01
  • Namespace are supported by php and not by the framework (Codeigniter in your case). If you use namespaces php version must be >= 5.3.0 Codeigniter doesn't use namespaces because it is written to support php 4. Commented Dec 16, 2019 at 10:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.