Class: Stripe::Tax::Transaction
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Tax::Transaction
- Defined in:
- lib/stripe/resources/tax/transaction.rb
Overview
A Tax Transaction records the tax collected from or refunded to your customer.
Related guide: [Calculate tax in your custom payment flow](stripe.com/docs/tax/custom#tax-transaction)
Constant Summary collapse
- OBJECT_NAME =
"tax.transaction"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.create_from_calculation(params = {}, opts = {}) ⇒ Object
Creates a Tax Transaction from a calculation.
-
.create_reversal(params = {}, opts = {}) ⇒ Object
Partially or fully reverses a previously created Transaction.
-
.list_line_items(transaction, params = {}, opts = {}) ⇒ Object
Retrieves the line items of a committed standalone transaction as a collection.
Instance Method Summary collapse
-
#list_line_items(params = {}, opts = {}) ⇒ Object
Retrieves the line items of a committed standalone transaction as a collection.
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Class Method Details
.create_from_calculation(params = {}, opts = {}) ⇒ Object
Creates a Tax Transaction from a calculation.
23 24 25 26 27 28 29 30 |
# File 'lib/stripe/resources/tax/transaction.rb', line 23 def self.create_from_calculation(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/tax/transactions/create_from_calculation", params: params, opts: opts ) end |
.create_reversal(params = {}, opts = {}) ⇒ Object
Partially or fully reverses a previously created Transaction.
33 34 35 36 37 38 39 40 |
# File 'lib/stripe/resources/tax/transaction.rb', line 33 def self.create_reversal(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/tax/transactions/create_reversal", params: params, opts: opts ) end |
.list_line_items(transaction, params = {}, opts = {}) ⇒ Object
Retrieves the line items of a committed standalone transaction as a collection.
43 44 45 46 47 48 49 50 |
# File 'lib/stripe/resources/tax/transaction.rb', line 43 def self.list_line_items(transaction, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(transaction) }), params: params, opts: opts ) end |
Instance Method Details
#list_line_items(params = {}, opts = {}) ⇒ Object
Retrieves the line items of a committed standalone transaction as a collection.
13 14 15 16 17 18 19 20 |
# File 'lib/stripe/resources/tax/transaction.rb', line 13 def list_line_items(params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }), params: params, opts: opts ) end |