dolibarr/htdocs/includes/stripe/stripe-php/lib/EphemeralKey.php

44 lines
1.5 KiB
PHP
Raw Normal View History

2018-03-06 13:52:56 +01:00
<?php
2021-01-03 23:37:44 +01:00
// File generated from our OpenAPI spec
2018-03-06 13:52:56 +01:00
namespace Stripe;
/**
2021-01-03 23:37:44 +01:00
* @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 int $expires Time at which the key will expire. Measured in seconds since the Unix epoch.
* @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 $secret The key's secret. You can use this value to make authorized requests to the Stripe API.
2018-03-06 13:52:56 +01:00
* @property array $associated_objects
*/
class EphemeralKey extends ApiResource
{
2021-01-03 23:37:44 +01:00
const OBJECT_NAME = 'ephemeral_key';
2019-05-03 02:22:27 +02:00
2018-03-06 13:52:56 +01:00
use ApiOperations\Create {
create as protected _create;
}
2021-01-03 23:37:44 +01:00
2018-03-06 13:52:56 +01:00
use ApiOperations\Delete;
/**
2021-01-03 23:37:44 +01:00
* @param null|array $params
* @param null|array|string $opts
2018-03-06 13:52:56 +01:00
*
2021-01-03 23:37:44 +01:00
* @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\EphemeralKey the created key
2018-03-06 13:52:56 +01:00
*/
public static function create($params = null, $opts = null)
{
2021-01-03 23:37:44 +01:00
if (!$opts || !isset($opts['stripe_version'])) {
throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key');
2018-03-06 13:52:56 +01:00
}
2021-01-03 23:37:44 +01:00
2018-03-06 13:52:56 +01:00
return self::_create($params, $opts);
}
}