PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / stripe / stripe-php / lib / Tax / Transaction.php
ameliabooking / vendor / stripe / stripe-php / lib / Tax Last commit date
Calculation.php 7 months ago CalculationLineItem.php 7 months ago Registration.php 7 months ago Settings.php 7 months ago Transaction.php 7 months ago TransactionLineItem.php 7 months ago
Transaction.php
110 lines
1 <?php
2
3 // File generated from our OpenAPI spec
4
5 namespace AmeliaVendor\Stripe\Tax;
6
7 /**
8 * A Tax Transaction records the tax collected from or refunded to your customer.
9 *
10 * Related guide: <a href="https://stripe.com/docs/tax/custom#tax-transaction">Calculate tax in your custom payment flow</a>
11 *
12 * @property string $id Unique identifier for the transaction.
13 * @property string $object String representing the object's type. Objects of the same type share the same value.
14 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
15 * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
16 * @property null|string $customer The ID of an existing <a href="https://stripe.com/docs/api/customers/object">Customer</a> used for the resource.
17 * @property (object{address: null|(object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\AmeliaVendor\Stripe\StripeObject), address_source: null|string, ip_address: null|string, tax_ids: (object{type: string, value: string}&\AmeliaVendor\Stripe\StripeObject)[], taxability_override: string}&\AmeliaVendor\Stripe\StripeObject) $customer_details
18 * @property null|\AmeliaVendor\Stripe\Collection<TransactionLineItem> $line_items The tax collected or refunded, by line item.
19 * @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.
20 * @property null|\AmeliaVendor\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.
21 * @property int $posted_at The Unix timestamp representing when the tax liability is assumed or reduced.
22 * @property string $reference A custom unique identifier, such as 'myOrder_123'.
23 * @property null|(object{original_transaction: null|string}&\AmeliaVendor\Stripe\StripeObject) $reversal If <code>type=reversal</code>, contains information about what was reversed.
24 * @property null|(object{address: (object{city: null|string, country: string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\AmeliaVendor\Stripe\StripeObject)}&\AmeliaVendor\Stripe\StripeObject) $ship_from_details The details of the ship from location, such as the address.
25 * @property null|(object{amount: int, amount_tax: int, shipping_rate?: string, tax_behavior: string, tax_breakdown?: ((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\AmeliaVendor\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\AmeliaVendor\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\AmeliaVendor\Stripe\StripeObject))[], tax_code: string}&\AmeliaVendor\Stripe\StripeObject) $shipping_cost The shipping cost details for the transaction.
26 * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
27 * @property string $type If <code>reversal</code>, this transaction reverses an earlier transaction.
28 */
29 class Transaction extends \AmeliaVendor\Stripe\ApiResource
30 {
31 const OBJECT_NAME = 'tax.transaction';
32
33 const TYPE_REVERSAL = 'reversal';
34 const TYPE_TRANSACTION = 'transaction';
35
36 /**
37 * Retrieves a Tax <code>Transaction</code> object.
38 *
39 * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
40 * @param null|array|string $opts
41 *
42 * @return Transaction
43 *
44 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
45 */
46 public static function retrieve($id, $opts = null)
47 {
48 $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts);
49 $instance = new static($id, $opts);
50 $instance->refresh();
51
52 return $instance;
53 }
54
55 /**
56 * @param null|array $params
57 * @param null|array|string $opts
58 *
59 * @return Transaction the created transaction
60 *
61 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
62 */
63 public static function createFromCalculation($params = null, $opts = null)
64 {
65 $url = static::classUrl() . '/create_from_calculation';
66 list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
67 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
68 $obj->setLastResponse($response);
69
70 return $obj;
71 }
72
73 /**
74 * @param null|array $params
75 * @param null|array|string $opts
76 *
77 * @return Transaction the created transaction
78 *
79 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
80 */
81 public static function createReversal($params = null, $opts = null)
82 {
83 $url = static::classUrl() . '/create_reversal';
84 list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
85 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
86 $obj->setLastResponse($response);
87
88 return $obj;
89 }
90
91 /**
92 * @param string $id
93 * @param null|array $params
94 * @param null|array|string $opts
95 *
96 * @return \AmeliaVendor\Stripe\Collection<TransactionLineItem> list of transaction line items
97 *
98 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
99 */
100 public static function allLineItems($id, $params = null, $opts = null)
101 {
102 $url = static::resourceUrl($id) . '/line_items';
103 list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
104 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
105 $obj->setLastResponse($response);
106
107 return $obj;
108 }
109 }
110