Retrieves the Monthly Recurring Revenue (MRR), for the specified time period.
@param array|array $options
@param ClientInterface|null $client
@return Metrics\MRRs
496412
public static function mrr(array $options = [], ClientInterface $client = null)
    {
        return Metrics\MRRs::all($options, $client);
    }
1049906
public function create(ClientInterface $client): ClientInterface
    {
        try {
            $now    = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $schema = $this->getDatabaseSchema();
            $values = [
                $schema->getClientsIdentityColumn()               => $client->getIdentifier(),
                $schema->getClientsNameColumn()                   => $client->getName(),
                $schema->getClientsDescriptionColumn()            => $client->getDescription(),
                $schema->getClientsCredentialsColumn()            => $client->getCredentials(),
                $schema->getClientsIsConfidentialColumn()         => $client->isConfidential(),
                $schema->getClientsIsScopeExcessAllowedColumn()   => $client->isScopeExcessAllowed(),
                $schema->getClientsIsUseDefaultScopeColumn()      => $client->isUseDefaultScopesOnEmptyRequest(),
                $schema->getClientsIsCodeGrantEnabledColumn()     => $client->isCodeGrantEnabled(),
                $schema->getClientsIsImplicitGrantEnabledColumn() => $client->isImplicitGrantEnabled(),
                $schema->getClientsIsPasswordGrantEnabledColumn() => $client->isPasswordGrantEnabled(),
                $schema->getClientsIsClientGrantEnabledColumn()   => $client->isClientGrantEnabled(),
                $schema->getClientsIsRefreshGrantEnabledColumn()  => $client->isRefreshGrantEnabled(),
                $schema->getClientsCreatedAtColumn()              => $now,
            ];

            $identifier = $client->getIdentifier();
            if (empty($scopeIdentifiers = $client->getScopeIdentifiers()) === true) {
                $this->createResource($values);
            } else {
                $this->inTransaction(function () use ($identifier, $values, $scopeIdentifiers) {
                    $this->createResource($values);
                    $this->bindScopeIdentifiers($identifier, $scopeIdentifiers);
                });
            }
            $client->setCreatedAt($now);

            return $client;
        } catch (RepositoryException $exception) {
            $message = 'Client creation failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
1357761
public function recurring($money, CreditCard $creditcard, $options = array())
    {
        $options = new Options($options);

        Options::required(
            'frequency, period, start_date, billing_address',
            $options
        );

        Options::required(
            'first_name, last_name',
            $options['billing_address']
        );

        if (null == $options->occurrences) {
            $options->occurrences = '9999';
        }

        if (null == $options->trial_occurrences) {
            $options->trial_occurrences = 0;
        }

        $amount = $this->amount($money);

        $ref_id = $options['order_id'];

        $this->xml = "<refId>$ref_id</refId>";
        $this->xml .= "<subscription>";
        $this->arbAddSubscription($amount, $options);
        $this->arbAddCreditcard($creditcard);
        $this->arbAddAddress($options['billing_address']);
        $this->xml .= "</subscription>";

        return $this->recurringCommit('create');
    }
1013272
public function getCalendarId(EntityInterface $entity, ArrayObject $options, $map = null)
    {
        $result = null;

        if (empty($options['calendar'])) {
            return $result;
        }

        $result = $options['calendar']->id;

        return $result;
    }
96630
public static function get($params = null, $client = null) {
    return new self(self::_uriWithParams('/export_dates', $params), $client);
  }
559008
public function client($client = null)
    {
        if (!func_num_args()) {
            return $this->_client;
        }
        $this->_client = $client;
        return $this;
    }
376183
protected function getProperty(Client $client, $href)
    {
        $response = $client->get($href);
        $crawler = new Crawler($response->getBody()->__toString());

        $ranges = [];
        $rangeIncludes = $crawler->filter('[property="rangeIncludes"]');
        foreach ($rangeIncludes as $rangeInclude) {
            $ranges[] = ltrim(preg_replace('/http[s]*:\/\/schema.org\//', '', $rangeInclude->getAttribute('href')), '/');
        }

        return [
            'comment' => $crawler->filter('[property="rdfs:comment"]')->first()->text(),
            'comment_plain' => strip_tags($crawler->filter('[property="rdfs:comment"]')->first()->text()),
            'id' => $crawler->filter('[property="rdfs:label"]')->first()->text(),
            'label' => $crawler->filter('[property="rdfs:label"]')->first()->text(),
            'ranges' => $ranges,
            'url' => $client->getConfig('base_uri').$href,
        ];
    }
347789
public function selectMonth($name, $selected = null, $options = array())
	{
		$months = array();

		foreach (range(1, 12) as $month)
		{
			$months[$month] = strftime('%B', mktime(0, 0, 0, $month, 1));
		}

		return $this->select($name, $months, $selected, $options);
	}
407676
public static function get($invoiceNumber, $client = null) {
    return self::_get(Recurly_Invoice::uriForInvoice($invoiceNumber), $client);
  }
1012900
public static function getInvoicePdf($invoiceNumber, $locale = null, $client = null) {
    $uri = self::uriForInvoice($invoiceNumber);

    if (is_null($client))
      $client = new Recurly_Client();

    return $client->getPdf($uri, $locale);
  }
175847
public static function all(array $data = [], ClientInterface $client = null)
    {

        return (new RequestService($client))
            ->setResourceClass(static::class)
            ->all($data);
    }
900935
public function recurring($money, CreditCard $creditcard, $options = array())
    {
        $this->required_options('order_id', $options);
        $this->buildReceiptInRequest($money, $options);

        return $this->commit('recurring');
    }
306921
public function monthly($year, $month, $page = 1, $limit = 25)
    {
        return $this->client->call("expenses/in_month/{$year}/{$month}", [
            'page' => $page,
            'per_page' => $limit
        ], 'GET');
    }
435909
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;
    }
487323
public function execute(Client $client)
    {
        if (!$this->request instanceof Request) {
            throw new \InvalidArgumentException('request is not an instanceof \GuzzleHttp\Message\Request');
        }

        $this->copyClientDefaults($client);

        return $client->send($this->request);
    }
1080996
public function findIdentityByAuthClient(ClientInterface $client)
    {
        $remote = $this->getRemoteUser($client);
        if (!$remote->provider) {
            return null;
        }
        if ($remote->client_id) {
            return $this->findIdentity($remote->client_id);
        }
        $email = $client->getUserAttributes()['email'];
        $user = $this->findIdentityByEmail($email);
        if (!$user) {
            return null;
        }
        if ($remote->isTrustedEmail($email)) {
            return $this->setRemoteUser($client, $user);
        }

        return null;
    }
1012683
public static function ltv(array $options = [], ClientInterface $client = null)
    {
        return Metrics\LTVs::all($options, $client);
    }