src/Mpesa/Transaction/AccountBalance.php
/**
     * Initiate the account balance request transaction.
     *
     * @return mixed
     */
Initiate the account balance request transaction.
@return mixed
Initiate the account balance request transaction . @return mixed
public function request()
    {
        $paybill    = $this->engine->config->get('mpesa.paybill_number');
        $initiator  = $this->engine->config->get('mpesa.initiator');
        $credential = (new Generator($this->engine))->generate();
        $body       = [
            'Initiator'          => $initiator,
            'SecurityCredential' => $credential,
            'CommandID'          => 'AccountBalance',
            'PartyA'             => $paybill,
            'IdentifierType'     => '4',
            'Remarks'            => 'Account balance request',
            'QueueTimeOutURL'    => $this->callback('mpesa.queue_timeout_callback'),
            'ResultURL'          => $this->callback('mpesa.account_balance_result_url'),
        ];
        return $this->handleRequest($body);
    }
public function request ( ) { $ paybill = $ this -> engine -> config -> get ( 'mpesa.paybill_number' ) ; $ initiator = $ this -> engine -> config -> get ( 'mpesa.initiator' ) ; $ credential = ( new Generator ( $ this -> engine ) ) -> generate ( ) ; $ body = [ 'Initiator' => $ initiator , 'SecurityCredential' => $ credential , 'CommandID' => 'AccountBalance' , 'PartyA' => $ paybill , 'IdentifierType' => '4' , 'Remarks' => 'Account balance request' , 'QueueTimeOutURL' => $ this -> callback ( 'mpesa.queue_timeout_callback' ) , 'ResultURL' => $ this -> callback ( 'mpesa.account_balance_result_url' ) , ] ; return $ this -> handleRequest ( $ body ) ; }
Initiate the account balance request transaction.
Initiate the account balance request transaction .