How to integrate razorpay payment gateway in codeigniter
You can easily put the use
keyword at the top of that file. If there is already an Api
class clashing with this, you can do the following:
<?phprequire_once (APPPATH . 'base_url()/litehires/assets/razorpay-php/Razorpay.php');use Razorpay\Api as RazorpayApi;class User extends CI_Controller{ public function addcredit() { $api = new RazorpayApi('rzp_test_KEY_ID', 'rzp_test_KEY_ID');
This will include the file, then use
the class, so it is available below in the controller.
Disclaimer: I work for Razorpay.