public function validate($checkoutRequestID, $account = null)
    {
        $account = $account ?: $this->account;
        $time = Carbon::now()->format('YmdHis');
        $configs = (new ConfigurationRepository)->useAccount($account);

        $shortCode = $configs->getAccountKey('lnmo.shortcode');
        $passkey   = $configs->getAccountKey('lnmo.passkey');

        $body = [
            'BusinessShortCode' => $shortCode,
            'Password'          => $this->getPassword($shortCode, $passkey, $time),
            'Timestamp'         => $time,
            'CheckoutRequestID' => $checkoutRequestID,
        ];

        try {
            $response = $this->makeRequest(
                $body,
                Core::instance()->getEndpoint(MPESA_LNMO_VALIDATE, $account),
                $account
            );

            return json_decode($response->getBody());
        } catch (RequestException $exception) {
            return json_decode($exception->getResponse()->getBody());
        }
    }
public function validate($checkoutRequestID, $account = null)
    {
        $account = $account ?: $this->account;
        $time = Carbon::now()->format('YmdHis');
        $configs = (new ConfigurationRepository)->useAccount($account);

        $shortCode = $configs->getAccountKey('lnmo.shortcode');
        $passkey   = $configs->getAccountKey('lnmo.passkey');

        $body = [
            'BusinessShortCode' => $shortCode,
            'Password'          => $this->getPassword($shortCode, $passkey, $time),
            'Timestamp'         => $time,
            'CheckoutRequestID' => $checkoutRequestID,
        ];

        try {
            $response = $this->makeRequest(
                $body,
                Core::instance()->getEndpoint(MPESA_LNMO_VALIDATE, $account),
                $account
            );

            return json_decode($response->getBody());
        } catch (RequestException $exception) {
            return json_decode($exception->getResponse()->getBody());
        }
    }
public function validate ( $ checkoutRequestID , $ account = null ) { $ account = $ account ? : $ this -> account ; $ time = Carbon :: now ( ) -> format ( 'YmdHis' ) ; $ configs = ( new ConfigurationRepository ) -> useAccount ( $ account ) ; $ shortCode = $ configs -> getAccountKey ( 'lnmo.shortcode' ) ; $ passkey = $ configs -> getAccountKey ( 'lnmo.passkey' ) ; $ body = [ 'BusinessShortCode' => $ shortCode , 'Password' => $ this -> getPassword ( $ shortCode , $ passkey , $ time ) , 'Timestamp' => $ time , 'CheckoutRequestID' => $ checkoutRequestID , ] ; try { $ response = $ this -> makeRequest ( $ body , Core :: instance ( ) -> getEndpoint ( MPESA_LNMO_VALIDATE , $ account ) , $ account ) ; return json_decode ( $ response -> getBody ( ) ) ; } catch ( RequestException $ exception ) { return json_decode ( $ exception -> getResponse ( ) -> getBody ( ) ) ; } }
Validate an initialized transaction.

@param string $checkoutRequestID

@return json
Validate an initialized transaction .