| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- // File generated from our OpenAPI spec
- namespace Stripe\Terminal;
- /**
- * A Configurations object represents how features should be configured for terminal readers.
- *
- * @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 null|\Stripe\StripeObject $bbpos_wisepos_e
- * @property null|bool $is_account_default Whether this Configuration is the default for your account
- * @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 $name String indicating the name of the Configuration object, set by the user
- * @property null|\Stripe\StripeObject $offline
- * @property null|\Stripe\StripeObject $reboot_window
- * @property null|\Stripe\StripeObject $stripe_s700
- * @property null|\Stripe\StripeObject $tipping
- * @property null|\Stripe\StripeObject $verifone_p400
- */
- class Configuration extends \Stripe\ApiResource
- {
- const OBJECT_NAME = 'terminal.configuration';
- use \Stripe\ApiOperations\Update;
- /**
- * Creates a new <code>Configuration</code> object.
- *
- * @param null|array $params
- * @param null|array|string $options
- *
- * @throws \Stripe\Exception\ApiErrorException if the request fails
- *
- * @return \Stripe\Terminal\Configuration the created resource
- */
- 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;
- }
- /**
- * Deletes a <code>Configuration</code> object.
- *
- * @param null|array $params
- * @param null|array|string $opts
- *
- * @throws \Stripe\Exception\ApiErrorException if the request fails
- *
- * @return \Stripe\Terminal\Configuration the deleted resource
- */
- public function delete($params = null, $opts = null)
- {
- self::_validateParams($params);
- $url = $this->instanceUrl();
- list($response, $opts) = $this->_request('delete', $url, $params, $opts);
- $this->refreshFrom($response, $opts);
- return $this;
- }
- /**
- * Returns a list of <code>Configuration</code> objects.
- *
- * @param null|array $params
- * @param null|array|string $opts
- *
- * @throws \Stripe\Exception\ApiErrorException if the request fails
- *
- * @return \Stripe\Collection<\Stripe\Terminal\Configuration> of ApiResources
- */
- public static function all($params = null, $opts = null)
- {
- $url = static::classUrl();
- return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
- }
- /**
- * Retrieves a <code>Configuration</code> object.
- *
- * @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
- *
- * @throws \Stripe\Exception\ApiErrorException if the request fails
- *
- * @return \Stripe\Terminal\Configuration
- */
- public static function retrieve($id, $opts = null)
- {
- $opts = \Stripe\Util\RequestOptions::parse($opts);
- $instance = new static($id, $opts);
- $instance->refresh();
- return $instance;
- }
- /**
- * Updates a new <code>Configuration</code> object.
- *
- * @param string $id the ID of the resource to update
- * @param null|array $params
- * @param null|array|string $opts
- *
- * @throws \Stripe\Exception\ApiErrorException if the request fails
- *
- * @return \Stripe\Terminal\Configuration the updated resource
- */
- 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;
- }
- }
|