Alert.php
1 year ago
AlertTriggered.php
1 year ago
CreditBalanceSummary.php
1 year ago
CreditBalanceTransaction.php
1 year ago
CreditGrant.php
1 year ago
Meter.php
1 year ago
MeterEvent.php
1 year ago
MeterEventAdjustment.php
1 year ago
MeterEventSummary.php
1 year ago
MeterEvent.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace WPForms\Vendor\Stripe\Billing; |
| 5 | |
| 6 | /** |
| 7 | * 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. |
| 8 | * |
| 9 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 10 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 11 | * @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter. |
| 12 | * @property string $identifier A unique identifier for the event. |
| 13 | * @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. |
| 14 | * @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>. |
| 15 | * @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. |
| 16 | */ |
| 17 | class MeterEvent extends \WPForms\Vendor\Stripe\ApiResource |
| 18 | { |
| 19 | const OBJECT_NAME = 'billing.meter_event'; |
| 20 | /** |
| 21 | * Creates a billing meter event. |
| 22 | * |
| 23 | * @param null|array $params |
| 24 | * @param null|array|string $options |
| 25 | * |
| 26 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 27 | * |
| 28 | * @return \Stripe\Billing\MeterEvent the created resource |
| 29 | */ |
| 30 | public static function create($params = null, $options = null) |
| 31 | { |
| 32 | self::_validateParams($params); |
| 33 | $url = static::classUrl(); |
| 34 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); |
| 35 | $obj = \WPForms\Vendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 36 | $obj->setLastResponse($response); |
| 37 | return $obj; |
| 38 | } |
| 39 | } |
| 40 |