Calculate tax in your custom payment flow * * @property null|string $id Unique identifier for the calculation. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount_total Total after taxes. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $customer The ID of an existing Customer used for the resource. * @property \Stripe\StripeObject $customer_details * @property null|int $expires_at Timestamp of date at which the tax calculation will expire. * @property null|\Stripe\Collection<\Stripe\Tax\CalculationLineItem> $line_items The list of items the customer is purchasing. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the calculation. * @property int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices. * @property int $tax_amount_inclusive The amount of tax already included in the line item prices. * @property \Stripe\StripeObject[] $tax_breakdown Breakdown of individual tax amounts that add up to the total. * @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation. */ class Calculation extends \WP_Ultimo\Dependencies\Stripe\ApiResource { const OBJECT_NAME = 'tax.calculation'; use \WP_Ultimo\Dependencies\Stripe\ApiOperations\Create; /** * @param string $id * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem> list of calculation line items */ public static function allLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = \WP_Ultimo\Dependencies\Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } }