Fix: Corriger le type PDO dans StripeService et retirer getConnection()
This commit is contained in:
134
api/vendor/stripe/stripe-php/lib/Billing/Alert.php
vendored
Normal file
134
api/vendor/stripe/stripe-php/lib/Billing/Alert.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property string $alert_type Defines the type of the alert.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string $status Status of the alert. This can be active, inactive or archived.
|
||||
* @property string $title Title of the alert.
|
||||
* @property null|(object{filters: null|((object{customer: null|string|\Stripe\Customer, type: string}&\Stripe\StripeObject))[], gte: int, meter: Meter|string, recurrence: string}&\Stripe\StripeObject) $usage_threshold Encapsulates configuration of the alert to monitor usage on a specific <a href="https://stripe.com/docs/api/billing/meter">Billing Meter</a>.
|
||||
*/
|
||||
class Alert extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.alert';
|
||||
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_ARCHIVED = 'archived';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
|
||||
/**
|
||||
* Creates a billing alert.
|
||||
*
|
||||
* @param null|array{alert_type: string, expand?: string[], title: string, usage_threshold?: array{filters?: array{customer?: string, type: string}[], gte: int, meter: string, recurrence: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @return Alert the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists billing active and inactive alerts.
|
||||
*
|
||||
* @param null|array{alert_type?: string, ending_before?: string, expand?: string[], limit?: int, meter?: string, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Collection<Alert> of ApiResources
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a billing alert given an ID.
|
||||
*
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Alert
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Alert the activated alert
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function activate($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/activate';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Alert the archived alert
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function archive($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/archive';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Alert the deactivated alert
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function deactivate($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/deactivate';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
18
api/vendor/stripe/stripe-php/lib/Billing/AlertTriggered.php
vendored
Normal file
18
api/vendor/stripe/stripe-php/lib/Billing/AlertTriggered.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property Alert $alert A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $customer ID of customer for which the alert triggered
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property int $value The value triggering the alert
|
||||
*/
|
||||
class AlertTriggered extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.alert_triggered';
|
||||
}
|
||||
36
api/vendor/stripe/stripe-php/lib/Billing/CreditBalanceSummary.php
vendored
Normal file
36
api/vendor/stripe/stripe-php/lib/Billing/CreditBalanceSummary.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* Indicates the billing credit balance for billing credits granted to a customer.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property ((object{available_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), ledger_balance: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject)}&\Stripe\StripeObject))[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
|
||||
* @property string|\Stripe\Customer $customer The customer the balance is for.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
*/
|
||||
class CreditBalanceSummary extends \Stripe\SingletonApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.credit_balance_summary';
|
||||
|
||||
/**
|
||||
* Retrieves the credit balance summary for a customer.
|
||||
*
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditBalanceSummary
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static(null, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
63
api/vendor/stripe/stripe-php/lib/Billing/CreditBalanceTransaction.php
vendored
Normal file
63
api/vendor/stripe/stripe-php/lib/Billing/CreditBalanceTransaction.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant.
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_application_invoice_voided: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $credit Credit details for this credit balance transaction. Only present if type is <code>credit</code>.
|
||||
* @property CreditGrant|string $credit_grant The credit grant associated with this credit balance transaction.
|
||||
* @property null|(object{amount: (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject), credits_applied: null|(object{invoice: string|\Stripe\Invoice, invoice_line_item: string}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $debit Debit details for this credit balance transaction. Only present if type is <code>debit</code>.
|
||||
* @property int $effective_at The effective time of this credit balance transaction.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit balance transaction belongs to.
|
||||
* @property null|string $type The type of credit balance transaction (credit or debit).
|
||||
*/
|
||||
class CreditBalanceTransaction extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.credit_balance_transaction';
|
||||
|
||||
const TYPE_CREDIT = 'credit';
|
||||
const TYPE_DEBIT = 'debit';
|
||||
|
||||
/**
|
||||
* Retrieve a list of credit balance transactions.
|
||||
*
|
||||
* @param null|array{credit_grant?: string, customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Collection<CreditBalanceTransaction> of ApiResources
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a credit balance transaction.
|
||||
*
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditBalanceTransaction
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
152
api/vendor/stripe/stripe-php/lib/Billing/CreditGrant.php
vendored
Normal file
152
api/vendor/stripe/stripe-php/lib/Billing/CreditGrant.php
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* A credit grant is an API resource that documents the allocation of some billing credits to a customer.
|
||||
*
|
||||
* Related guide: <a href="https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits">Billing credits</a>
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject), type: string}&\Stripe\StripeObject) $amount
|
||||
* @property (object{scope: (object{price_type?: string, prices?: ((object{id: null|string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $applicability_config
|
||||
* @property string $category The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string|\Stripe\Customer $customer ID of the customer receiving the billing credits.
|
||||
* @property null|int $effective_at The time when the billing credits become effective-when they're eligible for use.
|
||||
* @property null|int $expires_at The time when the billing credits expire. If not present, the billing credits don't expire.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
* @property null|string $name A descriptive name shown in dashboard.
|
||||
* @property null|int $priority The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
|
||||
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this credit grant belongs to.
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
* @property null|int $voided_at The time when this credit grant was voided. If not present, the credit grant hasn't been voided.
|
||||
*/
|
||||
class CreditGrant extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.credit_grant';
|
||||
|
||||
use \Stripe\ApiOperations\Update;
|
||||
|
||||
const CATEGORY_PAID = 'paid';
|
||||
const CATEGORY_PROMOTIONAL = 'promotional';
|
||||
|
||||
/**
|
||||
* Creates a credit grant.
|
||||
*
|
||||
* @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type?: string, prices?: array{id: string}[]}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: array<string, string>, name?: string, priority?: int} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @return CreditGrant the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of credit grants.
|
||||
*
|
||||
* @param null|array{customer?: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Collection<CreditGrant> of ApiResources
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a credit grant.
|
||||
*
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditGrant
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a credit grant.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array{expand?: string[], expires_at?: null|int, metadata?: array<string, string>} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditGrant the updated resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditGrant the expired credit grant
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function expire($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/expire';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return CreditGrant the voided credit grant
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function voidGrant($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/void';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
169
api/vendor/stripe/stripe-php/lib/Billing/Meter.php
vendored
Normal file
169
api/vendor/stripe/stripe-php/lib/Billing/Meter.php
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* Meters specify how to aggregate meter events over a billing period. Meter events represent the actions that customers take in your system. Meters attach to prices and form the basis of the bill.
|
||||
*
|
||||
* Related guide: <a href="https://docs.stripe.com/billing/subscriptions/usage-based">Usage based billing</a>
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property (object{event_payload_key: string, type: string}&\Stripe\StripeObject) $customer_mapping
|
||||
* @property (object{formula: string}&\Stripe\StripeObject) $default_aggregation
|
||||
* @property string $display_name The meter's name.
|
||||
* @property string $event_name The name of the meter event to record usage for. Corresponds with the <code>event_name</code> field on meter events.
|
||||
* @property null|string $event_time_window The time window which meter events have been pre-aggregated for, if any.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $status The meter's status.
|
||||
* @property (object{deactivated_at: null|int}&\Stripe\StripeObject) $status_transitions
|
||||
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
* @property (object{event_payload_key: string}&\Stripe\StripeObject) $value_settings
|
||||
*/
|
||||
class Meter extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.meter';
|
||||
|
||||
use \Stripe\ApiOperations\NestedResource;
|
||||
use \Stripe\ApiOperations\Update;
|
||||
|
||||
const EVENT_TIME_WINDOW_DAY = 'day';
|
||||
const EVENT_TIME_WINDOW_HOUR = 'hour';
|
||||
|
||||
const STATUS_ACTIVE = 'active';
|
||||
const STATUS_INACTIVE = 'inactive';
|
||||
|
||||
/**
|
||||
* Creates a billing meter.
|
||||
*
|
||||
* @param null|array{customer_mapping?: array{event_payload_key: string, type: string}, default_aggregation: array{formula: string}, display_name: string, event_name: string, event_time_window?: string, expand?: string[], value_settings?: array{event_payload_key: string}} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @return Meter the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of billing meters.
|
||||
*
|
||||
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Collection<Meter> of ApiResources
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function all($params = null, $opts = null)
|
||||
{
|
||||
$url = static::classUrl();
|
||||
|
||||
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a billing meter given an ID.
|
||||
*
|
||||
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Meter
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function retrieve($id, $opts = null)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($opts);
|
||||
$instance = new static($id, $opts);
|
||||
$instance->refresh();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a billing meter.
|
||||
*
|
||||
* @param string $id the ID of the resource to update
|
||||
* @param null|array{display_name?: string, expand?: string[]} $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Meter the updated resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function update($id, $params = null, $opts = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::resourceUrl($id);
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Meter the deactivated meter
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function deactivate($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/deactivate';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return Meter the reactivated meter
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public function reactivate($params = null, $opts = null)
|
||||
{
|
||||
$url = $this->instanceUrl() . '/reactivate';
|
||||
list($response, $opts) = $this->_request('post', $url, $params, $opts);
|
||||
$this->refreshFrom($response, $opts);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
const PATH_EVENT_SUMMARIES = '/event_summaries';
|
||||
|
||||
/**
|
||||
* @param string $id the ID of the meter on which to retrieve the meter event summaries
|
||||
* @param null|array $params
|
||||
* @param null|array|string $opts
|
||||
*
|
||||
* @return \Stripe\Collection<MeterEventSummary> the list of meter event summaries
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function allEventSummaries($id, $params = null, $opts = null)
|
||||
{
|
||||
return self::_allNestedResources($id, static::PATH_EVENT_SUMMARIES, $params, $opts);
|
||||
}
|
||||
}
|
||||
43
api/vendor/stripe/stripe-php/lib/Billing/MeterEvent.php
vendored
Normal file
43
api/vendor/stripe/stripe-php/lib/Billing/MeterEvent.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* Meter events represent actions that customers take in your system. You can use meter events to bill a customer based on their usage. Meter events are associated with billing meters, which define both the contents of the event’s payload and how to aggregate those events.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
* @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter.
|
||||
* @property string $identifier A unique identifier for the event.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property \Stripe\StripeObject $payload The payload of the event. This contains the fields corresponding to a meter's <code>customer_mapping.event_payload_key</code> (default is <code>stripe_customer_id</code>) and <code>value_settings.event_payload_key</code> (default is <code>value</code>). Read more about the <a href="https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides">payload</a>.
|
||||
* @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
|
||||
*/
|
||||
class MeterEvent extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.meter_event';
|
||||
|
||||
/**
|
||||
* Creates a billing meter event.
|
||||
*
|
||||
* @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array<string, string>, timestamp?: int} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @return MeterEvent the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
45
api/vendor/stripe/stripe-php/lib/Billing/MeterEventAdjustment.php
vendored
Normal file
45
api/vendor/stripe/stripe-php/lib/Billing/MeterEventAdjustment.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer.
|
||||
*
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property null|(object{identifier: null|string}&\Stripe\StripeObject) $cancel Specifies which event to cancel.
|
||||
* @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $status The meter event adjustment's status.
|
||||
* @property string $type Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
|
||||
*/
|
||||
class MeterEventAdjustment extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.meter_event_adjustment';
|
||||
|
||||
const STATUS_COMPLETE = 'complete';
|
||||
const STATUS_PENDING = 'pending';
|
||||
|
||||
/**
|
||||
* Creates a billing meter event adjustment.
|
||||
*
|
||||
* @param null|array{cancel?: array{identifier?: string}, event_name: string, expand?: string[], type: string} $params
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @return MeterEventAdjustment the created resource
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
public static function create($params = null, $options = null)
|
||||
{
|
||||
self::_validateParams($params);
|
||||
$url = static::classUrl();
|
||||
|
||||
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
|
||||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
|
||||
$obj->setLastResponse($response);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
24
api/vendor/stripe/stripe-php/lib/Billing/MeterEventSummary.php
vendored
Normal file
24
api/vendor/stripe/stripe-php/lib/Billing/MeterEventSummary.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
// File generated from our OpenAPI spec
|
||||
|
||||
namespace Stripe\Billing;
|
||||
|
||||
/**
|
||||
* A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
|
||||
* usage was accrued by a customer for that period.
|
||||
*
|
||||
* Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
|
||||
*
|
||||
* @property string $id Unique identifier for the object.
|
||||
* @property string $object String representing the object's type. Objects of the same type share the same value.
|
||||
* @property float $aggregated_value Aggregated value of all the events within <code>start_time</code> (inclusive) and <code>end_time</code> (inclusive). The aggregation strategy is defined on meter via <code>default_aggregation</code>.
|
||||
* @property int $end_time End timestamp for this event summary (exclusive). Must be aligned with minute boundaries.
|
||||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
|
||||
* @property string $meter The meter associated with this event summary.
|
||||
* @property int $start_time Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries.
|
||||
*/
|
||||
class MeterEventSummary extends \Stripe\ApiResource
|
||||
{
|
||||
const OBJECT_NAME = 'billing.meter_event_summary';
|
||||
}
|
||||
Reference in New Issue
Block a user