<?php

require "classes/Vend.php";

$vend = new Vend(); //Instance of Vend class

$service = 'airtime';

switch ($service) {

    case 'surfline':
         
        $data = [
         'device'    => '233255000100',
         'amount'    => '25',
         'bundle'    => '1gbolddata',
         ];

        $vend->pay_bills('surfline',$data); 
        break;

    case 'busy':

        $data = [
	         'account'   => '233000122',
	         'amount'    => '19',
	         'bundle'    => '701',  //bundle number
         ];

        $vend->pay_bills('busy',$data); 
		break;
	
	case 'airtime':

		 //newtwork[MTN=62001,Vodafone=62002,Tigo=62003,Expresso=62004,Airtel=62006,Globacom=62007,];
		 
        $data = [
	         'phone'      => '0244274699',
	         'amount'     => '1',
	         'network'    => '62001',  //newtwork id
         ];

        $vend->pay_bills('airtime',$data); 
        break;

    case 'vodafone': //POST PAID

        $data = [
	         'device'    => '11776577',
	         'service'   => 'postpaid',
	         'amount'    => '1',
         ];

        $vend->pay_bills('vodafone',$data); 
        break;

    case 'mtn': //POST/PREPAIDPAID 

        $data = [
	         'phone'     => '0203479414',
	         'amount'    => '1',
	         'service'   => 'prepaid', //postpaid –or prepaid
	         //'foreignId' => 

         ];

        $vend->pay_bills('mtn',$data); 
		break;
   
	case 'mtn_data': //POST PAID

    $data = [
	         'phone'       => '0244274699',
	         'amount'      => '1',
			 'service'     => 'mobileinternet',
			 'bundle'      => 'DAILY_50MB',
			 'callbackUrl' => 'https://webhook.site/8b4bbd0a-5f98-4b3d-abbe-b9b49767f7d5',
	       //'foreignId'   =>  
         ];

        $vend->pay_bills('mtn',$data); 
        break;

    case 'dstv':
        $data = [
        	 'account'   => '2022375158',
	         'amount'    => '1',
         ];

        $vend->pay_bills('dstv',$data); 
        break;

    case 'gotv':
        $data = [
        	 'account'   => '2022375158',
	         'amount'    => '1',
         ];

        $vend->pay_bills('gotv',$data); 
        break;

    case 'tvlicense':
	    $data = [
	    	 'account'   => '2022375158',
	         'amount'    => '1',
	     ];

	    $vend->pay_bills('tvlicense',$data); 
	    break;

    case 'ecg':
	    $data = [
	    	 'account'   => '2022375158',
	         'amount'    => '1',
	         'name'      => "Kwaku Manu",
	     ];

	    $vend->pay_bills('ecg',$data); 
	    break;

	case 'aero':
	    $data = [
	    	 'account'   => '2022375158',
	         'amount'    => '1',
	         'name'      => "Kwaku Manu",
	     ];

	    $vend->pay_bills('ecg',$data); 
        break;
        
    case 'aero':
	    $data = [
	    	 'account'   => '2022375158',
	         'amount'    => '1',
	         'name'      => "Kwaku Manu",
	     ];

	    $vend->pay_bills('ecg',$data); 
	    break;
}


?>