EphemeralKey.php 894 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Stripe;
  3. /**
  4. * Class EphemeralKey
  5. *
  6. * @property string $id
  7. * @property string $object
  8. * @property int $created
  9. * @property int $expires
  10. * @property bool $livemode
  11. * @property string $secret
  12. * @property array $associated_objects
  13. *
  14. * @package Stripe
  15. */
  16. class EphemeralKey extends ApiResource
  17. {
  18. const OBJECT_NAME = "ephemeral_key";
  19. use ApiOperations\Create {
  20. create as protected _create;
  21. }
  22. use ApiOperations\Delete;
  23. /**
  24. * @param array|null $params
  25. * @param array|string|null $opts
  26. *
  27. * @return EphemeralKey The created key.
  28. */
  29. public static function create($params = null, $opts = null)
  30. {
  31. if (!$opts['stripe_version']) {
  32. throw new \InvalidArgumentException('stripe_version must be specified to create an ephemeral key');
  33. }
  34. return self::_create($params, $opts);
  35. }
  36. }