• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / 6471862601

10 Oct 2023 04:02PM UTC coverage: 69.665% (-0.5%) from 70.141%
6471862601

push

github

web-flow
Merge pull request #1570 from localheinz/feature/coveralls

Enhancement: Use `coverallsapp/github-action` to report code coverage

2393 of 3435 relevant lines covered (69.67%)

3.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Tax/Transaction.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace 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 \Stripe\StripeObject $customer_details
18
 * @property null|\Stripe\Collection<\Stripe\Tax\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|\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 string $reference A custom unique identifier, such as 'myOrder_123'.
22
 * @property null|\Stripe\StripeObject $reversal If <code>type=reversal</code>, contains information about what was reversed.
23
 * @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the transaction.
24
 * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
25
 * @property string $type If <code>reversal</code>, this transaction reverses an earlier transaction.
26
 */
27
class Transaction extends \Stripe\ApiResource
28
{
29
    const OBJECT_NAME = 'tax.transaction';
30

31
    use \Stripe\ApiOperations\Retrieve;
32

33
    const TYPE_REVERSAL = 'reversal';
34
    const TYPE_TRANSACTION = 'transaction';
35

36
    /**
37
     * @param null|array $params
38
     * @param null|array|string $opts
39
     *
40
     * @throws \Stripe\Exception\ApiErrorException if the request fails
41
     *
42
     * @return \Stripe\Tax\Transaction the created transaction
43
     */
44
    public static function createFromCalculation($params = null, $opts = null)
×
45
    {
46
        $url = static::classUrl() . '/create_from_calculation';
×
47
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
48
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
49
        $obj->setLastResponse($response);
×
50

51
        return $obj;
×
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\Tax\Transaction the created transaction
61
     */
62
    public static function createReversal($params = null, $opts = null)
×
63
    {
64
        $url = static::classUrl() . '/create_reversal';
×
65
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
66
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
67
        $obj->setLastResponse($response);
×
68

69
        return $obj;
×
70
    }
71

72
    /**
73
     * @param string $id
74
     * @param null|array $params
75
     * @param null|array|string $opts
76
     *
77
     * @throws \Stripe\Exception\ApiErrorException if the request fails
78
     *
79
     * @return \Stripe\Collection<\Stripe\Tax\TransactionLineItem> list of transaction line items
80
     */
81
    public static function allLineItems($id, $params = null, $opts = null)
×
82
    {
83
        $url = static::resourceUrl($id) . '/line_items';
×
84
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
×
85
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
86
        $obj->setLastResponse($response);
×
87

88
        return $obj;
×
89
    }
90
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc