public function getChargesPage(string $customerId, int $page, array $options = null)
    {
        $pagedResponse = $this->getPage(
            $page,
            array_merge($options ?? [], [
                'method' => 'getCharges',
                'customerId' => $customerId
            ])
        );

        // Get all the items from the Paged BasicResponse
        $items = $pagedResponse->items;

        // Transform each item into a Charge Resource instead of a Customer Resource
        foreach ($items as &$item) {
            /** @var \DarkGhostHunter\Fluid\Fluid $item */
            $item = $this->makeCharge($item->toArray());
        }

        // Put the Charge Resources into the response
        $pagedResponse->setAttributes($items);

        // Profit
        return $pagedResponse;
    }
public function getChargesPage(string $customerId, int $page, array $options = null)
    {
        $pagedResponse = $this->getPage(
            $page,
            array_merge($options ?? [], [
                'method' => 'getCharges',
                'customerId' => $customerId
            ])
        );

        // Get all the items from the Paged BasicResponse
        $items = $pagedResponse->items;

        // Transform each item into a Charge Resource instead of a Customer Resource
        foreach ($items as &$item) {
            /** @var \DarkGhostHunter\Fluid\Fluid $item */
            $item = $this->makeCharge($item->toArray());
        }

        // Put the Charge Resources into the response
        $pagedResponse->setAttributes($items);

        // Profit
        return $pagedResponse;
    }
public function getChargesPage ( string $ customerId , int $ page , array $ options = null ) { $ pagedResponse = $ this -> getPage ( $ page , array_merge ( $ options ?? [ ] , [ 'method' => 'getCharges' , 'customerId' => $ customerId ] ) ) ; // Get all the items from the Paged BasicResponse $ items = $ pagedResponse -> items ; // Transform each item into a Charge Resource instead of a Customer Resource foreach ( $ items as & $ item ) { /** @var \DarkGhostHunter\Fluid\Fluid $item */ $ item = $ this -> makeCharge ( $ item -> toArray ( ) ) ; } // Put the Charge Resources into the response $ pagedResponse -> setAttributes ( $ items ) ; // Profit return $ pagedResponse ; }
List the charges made to a customer

@param string $customerId
@param int $page
@param array|null $options
@return \DarkGhostHunter\FlowSdk\Responses\PagedResponse
@throws \Exception
List the charges made to a customer