<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Example extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->library('instamojo');
        $this->load->helper('url');
        $this->load->helper('form');
    }


    public function index()
    {
        $pay = $this->instamojo->pay_request(

            $amount = "200",
            $purpose = "TEST",
            $buyer_name = "rbbqq",
            $email = "iamaskarali@gmail.com",
            $phone = "9686884384",
            $send_email = 'TRUE',
            $send_sms = 'TRUE',
            $repeated = 'FALSE'

        );

        $redirect_url = $pay['longurl'];

        redirect($redirect_url, 'refresh');
    }

    public function __get_all()
    {
        $result = $this->instamojo->all_payment_request();

        print_r($result);
    }

    public function status()
    {
        $paymentId  = '3306e34a57214351bb3abfa175f253af'; // $paymentId generated by Instamojo
        $status     = $this->instamojo->status($paymentId);
        echo "<pre>";
        print_r($status);
    }

}

/* End of file example.php */
/* Location: ./application/controllers/example.php */
