Calculation.php
6 months ago
CalculationLineItem.php
6 months ago
Registration.php
6 months ago
Settings.php
6 months ago
Transaction.php
6 months ago
TransactionLineItem.php
6 months ago
Registration.php
104 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace AmeliaVendor\Stripe\Tax; |
| 5 | |
| 6 | /** |
| 7 | * A Tax <code>Registration</code> lets us know that your business is registered to collect tax on payments within a region, enabling you to <a href="https://stripe.com/docs/tax">automatically collect tax</a>. |
| 8 | * |
| 9 | * Stripe doesn't register on your behalf with the relevant authorities when you create a Tax <code>Registration</code> object. For more information on how to register to collect tax, see <a href="https://stripe.com/docs/tax/registering">our guide</a>. |
| 10 | * |
| 11 | * Related guide: <a href="https://stripe.com/docs/tax/registrations-api">Using the Registrations API</a> |
| 12 | * |
| 13 | * @property string $id Unique identifier for the object. |
| 14 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 15 | * @property int $active_from Time at which the registration becomes active. Measured in seconds since the Unix epoch. |
| 16 | * @property string $country Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>). |
| 17 | * @property (object{ae?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), al?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), am?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ao?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), at?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), au?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), aw?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), az?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ba?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), bb?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), bd?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), be?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), bf?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), bg?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), bh?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), bj?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), bs?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), by?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ca?: (object{province_standard?: (object{province: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), cd?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ch?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), cl?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), cm?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), co?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), cr?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), cv?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), cy?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), cz?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), de?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), dk?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), ec?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ee?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), eg?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), es?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), et?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), fi?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), fr?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), gb?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ge?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), gn?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), gr?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), hr?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), hu?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), id?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ie?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), in?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), is?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), it?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), jp?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ke?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), kg?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), kh?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), kr?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), kz?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), la?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), lt?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), lu?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), lv?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), ma?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), md?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), me?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), mk?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), mr?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), mt?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), mx?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), my?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ng?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), nl?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), no?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), np?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), nz?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), om?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), pe?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ph?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), pl?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), pt?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), ro?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), rs?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ru?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), sa?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), se?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), sg?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), si?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), sk?: (object{standard?: (object{place_of_supply_scheme: string}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), sn?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), sr?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), th?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), tj?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), tr?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), tz?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), ug?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), us?: (object{local_amusement_tax?: (object{jurisdiction: string}&\AmeliaVendor\Stripe\StripeObject), local_lease_tax?: (object{jurisdiction: string}&\AmeliaVendor\Stripe\StripeObject), state: string, state_sales_tax?: (object{elections?: (object{jurisdiction?: string, type: string}&\AmeliaVendor\Stripe\StripeObject)[]}&\AmeliaVendor\Stripe\StripeObject), type: string}&\AmeliaVendor\Stripe\StripeObject), uy?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), uz?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), vn?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), za?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), zm?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject), zw?: (object{type: string}&\AmeliaVendor\Stripe\StripeObject)}&\AmeliaVendor\Stripe\StripeObject) $country_options |
| 18 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 19 | * @property null|int $expires_at If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. |
| 20 | * @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. |
| 21 | * @property string $status The status of the registration. This field is present for convenience and can be deduced from <code>active_from</code> and <code>expires_at</code>. |
| 22 | */ |
| 23 | class Registration extends \AmeliaVendor\Stripe\ApiResource |
| 24 | { |
| 25 | const OBJECT_NAME = 'tax.registration'; |
| 26 | use \AmeliaVendor\Stripe\ApiOperations\Update; |
| 27 | const STATUS_ACTIVE = 'active'; |
| 28 | const STATUS_EXPIRED = 'expired'; |
| 29 | const STATUS_SCHEDULED = 'scheduled'; |
| 30 | /** |
| 31 | * Creates a new Tax <code>Registration</code> object. |
| 32 | * |
| 33 | * @param null|array{active_from: array|int|string, country: string, country_options: array{ae?: array{type: string}, al?: array{type: string}, am?: array{type: string}, ao?: array{type: string}, at?: array{standard?: array{place_of_supply_scheme: string}, type: string}, au?: array{type: string}, aw?: array{type: string}, az?: array{type: string}, ba?: array{type: string}, bb?: array{type: string}, bd?: array{type: string}, be?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bf?: array{type: string}, bg?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bh?: array{type: string}, bj?: array{type: string}, bs?: array{type: string}, by?: array{type: string}, ca?: array{province_standard?: array{province: string}, type: string}, cd?: array{type: string}, ch?: array{type: string}, cl?: array{type: string}, cm?: array{type: string}, co?: array{type: string}, cr?: array{type: string}, cv?: array{type: string}, cy?: array{standard?: array{place_of_supply_scheme: string}, type: string}, cz?: array{standard?: array{place_of_supply_scheme: string}, type: string}, de?: array{standard?: array{place_of_supply_scheme: string}, type: string}, dk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ec?: array{type: string}, ee?: array{standard?: array{place_of_supply_scheme: string}, type: string}, eg?: array{type: string}, es?: array{standard?: array{place_of_supply_scheme: string}, type: string}, et?: array{type: string}, fi?: array{standard?: array{place_of_supply_scheme: string}, type: string}, fr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, gb?: array{type: string}, ge?: array{type: string}, gn?: array{type: string}, gr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, id?: array{type: string}, ie?: array{standard?: array{place_of_supply_scheme: string}, type: string}, in?: array{type: string}, is?: array{type: string}, it?: array{standard?: array{place_of_supply_scheme: string}, type: string}, jp?: array{type: string}, ke?: array{type: string}, kg?: array{type: string}, kh?: array{type: string}, kr?: array{type: string}, kz?: array{type: string}, la?: array{type: string}, lt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lv?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ma?: array{type: string}, md?: array{type: string}, me?: array{type: string}, mk?: array{type: string}, mr?: array{type: string}, mt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, mx?: array{type: string}, my?: array{type: string}, ng?: array{type: string}, nl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, no?: array{type: string}, np?: array{type: string}, nz?: array{type: string}, om?: array{type: string}, pe?: array{type: string}, ph?: array{type: string}, pl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, pt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ro?: array{standard?: array{place_of_supply_scheme: string}, type: string}, rs?: array{type: string}, ru?: array{type: string}, sa?: array{type: string}, se?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sg?: array{type: string}, si?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sn?: array{type: string}, sr?: array{type: string}, th?: array{type: string}, tj?: array{type: string}, tr?: array{type: string}, tz?: array{type: string}, ug?: array{type: string}, us?: array{local_amusement_tax?: array{jurisdiction: string}, local_lease_tax?: array{jurisdiction: string}, state: string, state_sales_tax?: array{elections: array{jurisdiction?: string, type: string}[]}, type: string}, uy?: array{type: string}, uz?: array{type: string}, vn?: array{type: string}, za?: array{type: string}, zm?: array{type: string}, zw?: array{type: string}}, expand?: string[], expires_at?: int} $params |
| 34 | * @param null|array|string $options |
| 35 | * |
| 36 | * @return Registration the created resource |
| 37 | * |
| 38 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 39 | */ |
| 40 | public static function create($params = null, $options = null) |
| 41 | { |
| 42 | self::_validateParams($params); |
| 43 | $url = static::classUrl(); |
| 44 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); |
| 45 | $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 46 | $obj->setLastResponse($response); |
| 47 | return $obj; |
| 48 | } |
| 49 | /** |
| 50 | * Returns a list of Tax <code>Registration</code> objects. |
| 51 | * |
| 52 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params |
| 53 | * @param null|array|string $opts |
| 54 | * |
| 55 | * @return \AmeliaVendor\Stripe\Collection<Registration> of ApiResources |
| 56 | * |
| 57 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 58 | */ |
| 59 | public static function all($params = null, $opts = null) |
| 60 | { |
| 61 | $url = static::classUrl(); |
| 62 | return static::_requestPage($url, \AmeliaVendor\Stripe\Collection::class, $params, $opts); |
| 63 | } |
| 64 | /** |
| 65 | * Returns a Tax <code>Registration</code> object. |
| 66 | * |
| 67 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key |
| 68 | * @param null|array|string $opts |
| 69 | * |
| 70 | * @return Registration |
| 71 | * |
| 72 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 73 | */ |
| 74 | public static function retrieve($id, $opts = null) |
| 75 | { |
| 76 | $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts); |
| 77 | $instance = new static($id, $opts); |
| 78 | $instance->refresh(); |
| 79 | return $instance; |
| 80 | } |
| 81 | /** |
| 82 | * Updates an existing Tax <code>Registration</code> object. |
| 83 | * |
| 84 | * A registration cannot be deleted after it has been created. If you wish to end a |
| 85 | * registration you may do so by setting <code>expires_at</code>. |
| 86 | * |
| 87 | * @param string $id the ID of the resource to update |
| 88 | * @param null|array{active_from?: array|int|string, expand?: string[], expires_at?: null|array|int|string} $params |
| 89 | * @param null|array|string $opts |
| 90 | * |
| 91 | * @return Registration the updated resource |
| 92 | * |
| 93 | * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails |
| 94 | */ |
| 95 | public static function update($id, $params = null, $opts = null) |
| 96 | { |
| 97 | self::_validateParams($params); |
| 98 | $url = static::resourceUrl($id); |
| 99 | list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); |
| 100 | $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 101 | $obj->setLastResponse($response); |
| 102 | return $obj; |
| 103 | } |
| 104 | } |