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

stripe / stripe-php / 9308560111

30 May 2024 08:09PM UTC coverage: 60.343% (-1.0%) from 61.377%
9308560111

Pull #1699

github

web-flow
Merge 73f733810 into 3533dc330
Pull Request #1699: Update generated code for beta

1080 of 1830 new or added lines in 117 files covered. (59.02%)

15 existing lines in 3 files now uncovered.

3486 of 5777 relevant lines covered (60.34%)

2.19 hits per line

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

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

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Tax;
6

7
/**
8
 * A Tax Calculation allows you to calculate the tax to collect from your customer.
9
 *
10
 * Related guide: <a href="https://stripe.com/docs/tax/custom">Calculate tax in your custom payment flow</a>
11
 *
12
 * @property null|string $id Unique identifier for the calculation.
13
 * @property string $object String representing the object's type. Objects of the same type share the same value.
14
 * @property int $amount_total Total after taxes.
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|int $expires_at Timestamp of date at which the tax calculation will expire.
19
 * @property null|\Stripe\Collection<\Stripe\Tax\CalculationLineItem> $line_items The list of items the customer is purchasing.
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 null|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address.
22
 * @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the calculation.
23
 * @property int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices.
24
 * @property int $tax_amount_inclusive The amount of tax already included in the line item prices.
25
 * @property \Stripe\StripeObject[] $tax_breakdown Breakdown of individual tax amounts that add up to the total.
26
 * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
27
 */
28
class Calculation extends \Stripe\ApiResource
29
{
30
    const OBJECT_NAME = 'tax.calculation';
31

32
    /**
33
     * Calculates tax based on input and returns a Tax <code>Calculation</code> object.
34
     *
35
     * @param null|array $params
36
     * @param null|array|string $options
37
     *
38
     * @throws \Stripe\Exception\ApiErrorException if the request fails
39
     *
40
     * @return \Stripe\Tax\Calculation the created resource
41
     */
NEW
42
    public static function create($params = null, $options = null)
×
43
    {
NEW
44
        self::_validateParams($params);
×
NEW
45
        $url = static::classUrl();
×
46

NEW
47
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
NEW
48
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
49
        $obj->setLastResponse($response);
×
50

NEW
51
        return $obj;
×
52
    }
53

54
    /**
55
     * @param string $id
56
     * @param null|array $params
57
     * @param null|array|string $opts
58
     *
59
     * @throws \Stripe\Exception\ApiErrorException if the request fails
60
     *
61
     * @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem> list of calculation line items
62
     */
63
    public static function allLineItems($id, $params = null, $opts = null)
×
64
    {
65
        $url = static::resourceUrl($id) . '/line_items';
×
66
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
×
67
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
68
        $obj->setLastResponse($response);
×
69

70
        return $obj;
×
71
    }
72
}
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

© 2024 Coveralls, Inc