mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-14 00:00:44 -04:00
Compare commits
3 Commits
980b7b011f
...
e33a1da93e
Author | SHA1 | Date | |
---|---|---|---|
|
e33a1da93e | ||
|
e1080cdd1e | ||
|
57f61c09ce |
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 8.4.0 - 2023-03-23
|
||||||
|
* [#1197](https://github.com/stripe/stripe-ruby/pull/1197) Update generated code (new)
|
||||||
|
* Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction`
|
||||||
|
* Add support for `create` and `list_line_items` methods on resource `Calculation`
|
||||||
|
* Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction`
|
||||||
|
* [#1152](https://github.com/stripe/stripe-ruby/pull/1152) Symbolize hash keys inside `convert_to_stripe_object_with_params`
|
||||||
|
|
||||||
## 8.3.0 - 2023-02-16
|
## 8.3.0 - 2023-02-16
|
||||||
* [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
|
* [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
|
||||||
* Add support for `refund_payment` method on resource `Terminal.Reader`
|
* Add support for `refund_payment` method on resource `Terminal.Reader`
|
||||||
|
@ -1 +1 @@
|
|||||||
v232
|
v277
|
@ -89,6 +89,8 @@ module Stripe
|
|||||||
Subscription::OBJECT_NAME => Subscription,
|
Subscription::OBJECT_NAME => Subscription,
|
||||||
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
|
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
|
||||||
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
|
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
|
||||||
|
Tax::Calculation::OBJECT_NAME => Tax::Calculation,
|
||||||
|
Tax::Transaction::OBJECT_NAME => Tax::Transaction,
|
||||||
TaxCode::OBJECT_NAME => TaxCode,
|
TaxCode::OBJECT_NAME => TaxCode,
|
||||||
TaxId::OBJECT_NAME => TaxId,
|
TaxId::OBJECT_NAME => TaxId,
|
||||||
TaxRate::OBJECT_NAME => TaxRate,
|
TaxRate::OBJECT_NAME => TaxRate,
|
||||||
|
@ -76,6 +76,8 @@ require "stripe/resources/source_transaction"
|
|||||||
require "stripe/resources/subscription"
|
require "stripe/resources/subscription"
|
||||||
require "stripe/resources/subscription_item"
|
require "stripe/resources/subscription_item"
|
||||||
require "stripe/resources/subscription_schedule"
|
require "stripe/resources/subscription_schedule"
|
||||||
|
require "stripe/resources/tax/calculation"
|
||||||
|
require "stripe/resources/tax/transaction"
|
||||||
require "stripe/resources/tax_code"
|
require "stripe/resources/tax_code"
|
||||||
require "stripe/resources/tax_id"
|
require "stripe/resources/tax_id"
|
||||||
require "stripe/resources/tax_rate"
|
require "stripe/resources/tax_rate"
|
||||||
|
31
lib/stripe/resources/tax/calculation.rb
Normal file
31
lib/stripe/resources/tax/calculation.rb
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# File generated from our OpenAPI spec
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Stripe
|
||||||
|
module Tax
|
||||||
|
# A Tax `Calculation` allows you to calculate the tax to collect from your customer.
|
||||||
|
class Calculation < APIResource
|
||||||
|
extend Stripe::APIOperations::Create
|
||||||
|
|
||||||
|
OBJECT_NAME = "tax.calculation"
|
||||||
|
|
||||||
|
def list_line_items(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :get,
|
||||||
|
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.list_line_items(calculation, params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :get,
|
||||||
|
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
49
lib/stripe/resources/tax/transaction.rb
Normal file
49
lib/stripe/resources/tax/transaction.rb
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# File generated from our OpenAPI spec
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Stripe
|
||||||
|
module Tax
|
||||||
|
# A Tax transaction records the tax collected from or refunded to your customer.
|
||||||
|
class Transaction < APIResource
|
||||||
|
extend Stripe::APIOperations::Create
|
||||||
|
|
||||||
|
OBJECT_NAME = "tax.transaction"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
def self.create_from_calculation(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :post,
|
||||||
|
path: "/v1/tax/transactions/create_from_calculation",
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.create_reversal(params = {}, opts = {})
|
||||||
|
request_stripe_object(
|
||||||
|
method: :post,
|
||||||
|
path: "/v1/tax/transactions/create_reversal",
|
||||||
|
params: params,
|
||||||
|
opts: opts
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Stripe
|
module Stripe
|
||||||
VERSION = "8.3.0"
|
VERSION = "8.4.0"
|
||||||
end
|
end
|
||||||
|
@ -2020,6 +2020,20 @@ module Stripe
|
|||||||
assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx"
|
assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
context "Tax.Calculation.list_line_items" do
|
||||||
|
should "support requests with args: calculation" do
|
||||||
|
Stripe::Tax::Calculation.list_line_items("xxx")
|
||||||
|
assert_requested :get, "#{Stripe.api_base}/v1/tax/calculations/xxx/line_items?"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
context "Tax.Transaction.create_from_calculation" do
|
||||||
|
should "support requests with args: calculation, reference" do
|
||||||
|
Stripe::Tax::Transaction.create_from_calculation(
|
||||||
|
{ calculation: "xxx", reference: "yyy" }
|
||||||
|
)
|
||||||
|
assert_requested :post, "#{Stripe.api_base}/v1/tax/transactions/create_from_calculation"
|
||||||
|
end
|
||||||
|
end
|
||||||
context "TaxCode.list" do
|
context "TaxCode.list" do
|
||||||
should "support requests with args: limit" do
|
should "support requests with args: limit" do
|
||||||
Stripe::TaxCode.list({ limit: 3 })
|
Stripe::TaxCode.list({ limit: 3 })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user