| 1 |
<?php |
| 2 |
|
| 3 |
// File generated from our OpenAPI spec |
| 4 |
|
| 5 |
namespace Stripe\Terminal; |
| 6 |
|
| 7 |
/** |
| 8 |
* A Reader represents a physical device for accepting payment details. |
| 9 |
* |
| 10 |
* Related guide: <a |
| 11 |
* href="https://stripe.com/docs/terminal/payments/connect-reader">Connecting to a |
| 12 |
* Reader</a>. |
| 13 |
* |
| 14 |
* @property string $id Unique identifier for the object. |
| 15 |
* @property string $object String representing the object's type. Objects of the same type share the same value. |
| 16 |
* @property null|\Stripe\StripeObject $action The most recent action performed by the reader. |
| 17 |
* @property null|string $device_sw_version The current software version of the reader. |
| 18 |
* @property string $device_type Type of reader, one of <code>bbpos_wisepad3</code>, <code>stripe_m2</code>, <code>bbpos_chipper2x</code>, <code>bbpos_wisepos_e</code>, or <code>verifone_P400</code>. |
| 19 |
* @property null|string $ip_address The local IP address of the reader. |
| 20 |
* @property string $label Custom label given to the reader for easier identification. |
| 21 |
* @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. |
| 22 |
* @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. |
| 23 |
* @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. |
| 24 |
* @property string $serial_number Serial number of the reader. |
| 25 |
* @property null|string $status The networking status of the reader. |
| 26 |
*/ |
| 27 |
class Reader extends \Stripe\ApiResource |
| 28 |
{ |
| 29 |
const OBJECT_NAME = 'terminal.reader'; |
| 30 |
|
| 31 |
use \Stripe\ApiOperations\All; |
| 32 |
use \Stripe\ApiOperations\Create; |
| 33 |
use \Stripe\ApiOperations\Delete; |
| 34 |
use \Stripe\ApiOperations\Retrieve; |
| 35 |
use \Stripe\ApiOperations\Update; |
| 36 |
|
| 37 |
/** |
| 38 |
* @param null|array $params |
| 39 |
* @param null|array|string $opts |
| 40 |
* |
| 41 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 42 |
* |
| 43 |
* @return \Stripe\Terminal\Reader the canceled reader |
| 44 |
*/ |
| 45 |
public function cancelAction($params = null, $opts = null) |
| 46 |
{ |
| 47 |
$url = $this->instanceUrl() . '/cancel_action'; |
| 48 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 49 |
$this->refreshFrom($response, $opts); |
| 50 |
|
| 51 |
return $this; |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* @param null|array $params |
| 56 |
* @param null|array|string $opts |
| 57 |
* |
| 58 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 59 |
* |
| 60 |
* @return \Stripe\Terminal\Reader the processed reader |
| 61 |
*/ |
| 62 |
public function processPaymentIntent($params = null, $opts = null) |
| 63 |
{ |
| 64 |
$url = $this->instanceUrl() . '/process_payment_intent'; |
| 65 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 66 |
$this->refreshFrom($response, $opts); |
| 67 |
|
| 68 |
return $this; |
| 69 |
} |
| 70 |
|
| 71 |
/** |
| 72 |
* @param null|array $params |
| 73 |
* @param null|array|string $opts |
| 74 |
* |
| 75 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 76 |
* |
| 77 |
* @return \Stripe\Terminal\Reader the processed reader |
| 78 |
*/ |
| 79 |
public function processSetupIntent($params = null, $opts = null) |
| 80 |
{ |
| 81 |
$url = $this->instanceUrl() . '/process_setup_intent'; |
| 82 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 83 |
$this->refreshFrom($response, $opts); |
| 84 |
|
| 85 |
return $this; |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* @param null|array $params |
| 90 |
* @param null|array|string $opts |
| 91 |
* |
| 92 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 93 |
* |
| 94 |
* @return \Stripe\Terminal\Reader the seted reader |
| 95 |
*/ |
| 96 |
public function setReaderDisplay($params = null, $opts = null) |
| 97 |
{ |
| 98 |
$url = $this->instanceUrl() . '/set_reader_display'; |
| 99 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 100 |
$this->refreshFrom($response, $opts); |
| 101 |
|
| 102 |
return $this; |
| 103 |
} |
| 104 |
} |
| 105 |
|