Compare commits

...

7 Commits

Author SHA1 Message Date
Annie Li
1d74e42c87 Reset version to 8.3.0-beta.1 2023-02-16 14:51:55 -08:00
Annie Li
30fa39cb6a Include latest changes from the master branch 2023-02-16 14:51:55 -08:00
Annie Li
ae24837bb5 Set version to 8.2.0 to simplify merge 2023-02-16 14:51:55 -08:00
anniel-stripe
45408e52b7
Merge pull request #1175 from stripe/latest-codegen-master
API Updates
2023-02-16 14:49:32 -08:00
Annie Li
8ee13d0e30 Codegen for openapi v226 2023-02-16 14:09:35 -08:00
Richard Marmorstein
696be38196 Bump version to 8.3.0-beta.1 2023-02-02 17:52:41 -06:00
Richard Marmorstein
ff853fda95
Merge pull request #1174 from stripe/latest-codegen-beta
API Updates for beta branch
2023-02-02 15:50:52 -08:00
8 changed files with 83 additions and 49 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 8.3.0-beta.1 - 2023-02-02
* [#1174](https://github.com/stripe/stripe-ruby/pull/1174) API Updates for beta branch
* Updated stable APIs to the latest version
* Add support for new resource `FinancialConnections.Transaction`
* Add support for `list` method on resource `Transaction`
## 8.2.0 - 2023-02-02
* [#1173](https://github.com/stripe/stripe-ruby/pull/1173) API Updates
* Add support for `resume` method on resource `Subscription`

View File

@ -1 +1 @@
v223
v226

View File

@ -1 +1 @@
8.2.0-beta.3
8.3.0-beta.1

View File

@ -3,11 +3,13 @@
module Stripe
# This is an object representing a Stripe account. You can retrieve it to see
# properties on the account like its current e-mail address or if the account is
# enabled yet to make live charges.
# properties on the account like its current requirements or if the account is
# enabled to make live charges or receive payouts.
#
# Some properties, marked below, are available only to platforms that want to
# [create and manage Express or Custom accounts](https://stripe.com/docs/connect/accounts).
# For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that
# account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links)
# for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express**
# below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
class Account < APIResource
extend Gem::Deprecate
extend Stripe::APIOperations::Create

View File

@ -13,8 +13,8 @@ module Stripe
# [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active
# [Subscription](https://stripe.com/docs/api/subscriptions).
#
# You can create a Checkout Session on your server and pass its ID to the
# client to begin Checkout.
# You can create a Checkout Session on your server and redirect to its URL
# to begin Checkout.
#
# Related guide: [Checkout Quickstart](https://stripe.com/docs/checkout/quickstart).
class Session < APIResource

View File

@ -2,13 +2,17 @@
# frozen_string_literal: true
module Stripe
# Sometimes you want to add a charge or credit to a customer, but actually
# charge or credit the customer's card only at the end of a regular billing
# cycle. This is useful for combining several charges (to minimize
# per-transaction fees), or for having Stripe tabulate your usage-based billing
# totals.
# Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an
# invoice by creating or updating it with an `invoice` field, at which point it will be included as
# [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within
# [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines).
#
# Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items).
# Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined
# with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge
# or credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges
# (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals.
#
# Related guides: [Integrate with the Invoicing API](https://stripe.com/docs/invoicing/integration), [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items).
class InvoiceItem < APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Stripe
VERSION = "8.2.0-beta.3"
VERSION = "8.3.0-beta.1"
end

View File

@ -150,6 +150,10 @@ module Stripe
Stripe::Apps::Secret.list({ scope: { type: "account" }, limit: 2 })
assert_requested :get, "#{Stripe.api_base}/v1/apps/secrets?scope[type]=account&limit=2"
end
should "support requests with args: scope, limit2" do
Stripe::Apps::Secret.list({ scope: { type: "account" }, limit: 2 })
assert_requested :get, "#{Stripe.api_base}/v1/apps/secrets?scope[type]=account&limit=2"
end
end
context "BalanceTransaction.list" do
should "support requests with args: limit" do
@ -273,7 +277,7 @@ module Stripe
amount: 2000,
currency: "usd",
source: "tok_xxxx",
description: "My First Test Charge (created for API docs)",
description: "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)",
}
)
assert_requested :post, "#{Stripe.api_base}/v1/charges"
@ -331,11 +335,10 @@ module Stripe
)
assert_requested :post, "#{Stripe.api_base}/v1/checkout/sessions"
end
should "support requests with args: success_url, cancel_url, line_items, mode" do
should "support requests with args: success_url, line_items, mode" do
Stripe::Checkout::Session.create(
{
success_url: "https://example.com/success",
cancel_url: "https://example.com/cancel",
line_items: [{ price: "price_xxxxxxxxxxxxx", quantity: 2 }],
mode: "payment",
}
@ -447,7 +450,9 @@ module Stripe
context "Customer.create" do
should "support requests with args: description" do
Stripe::Customer.create(
{ description: "My First Test Customer (created for API docs)" }
{
description: "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)",
}
)
assert_requested :post, "#{Stripe.api_base}/v1/customers"
end
@ -646,6 +651,10 @@ module Stripe
Stripe::FinancialConnections::Account.disconnect("fca_xyz")
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/disconnect?"
end
should "support requests with args: id" do
Stripe::FinancialConnections::Account.disconnect("fca_xxxxxxxxxxxxx")
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect?"
end
end
context "FinancialConnections.Account.list" do
should "work" do
@ -1114,9 +1123,13 @@ module Stripe
)
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents"
end
should "support requests with args: amount, currency, payment_method_types" do
should "support requests with args: amount, currency, automatic_payment_methods2" do
Stripe::PaymentIntent.create(
{ amount: 2000, currency: "usd", payment_method_types: ["card"] }
{
amount: 2000,
currency: "usd",
automatic_payment_methods: { enabled: true },
}
)
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents"
end
@ -1164,6 +1177,13 @@ module Stripe
Stripe::PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx")
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits?"
end
should "support requests with args: amounts, id" do
Stripe::PaymentIntent.verify_microdeposits(
"pi_xxxxxxxxxxxxx",
{ amounts: [32, 45] }
)
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits"
end
end
context "PaymentLink.create" do
should "support requests with args: line_items" do
@ -1223,8 +1243,8 @@ module Stripe
type: "card",
card: {
number: "4242424242424242",
exp_month: 5,
exp_year: 2023,
exp_month: 8,
exp_year: 2024,
cvc: "314",
},
}
@ -1780,6 +1800,13 @@ module Stripe
Stripe::SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx")
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits?"
end
should "support requests with args: amounts, id" do
Stripe::SetupIntent.verify_microdeposits(
"seti_xxxxxxxxxxxxx",
{ amounts: [32, 45] }
)
assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits"
end
end
context "ShippingRate.create" do
should "support requests with args: display_name, fixed_amount, type" do
@ -1876,15 +1903,6 @@ module Stripe
assert_requested :get, "#{Stripe.api_base}/v1/subscriptions?limit=3"
end
end
context "Subscription.resume" do
should "support requests with args: id, proration_date, proration_behavior" do
Stripe::Subscription.resume(
"sub_xxxxxxxxxxxxx",
{ proration_date: 1_675_400_000, proration_behavior: "always_invoice" }
)
assert_requested :post, "#{Stripe.api_base}/v1/subscriptions/sub_xxxxxxxxxxxxx/resume"
end
end
context "Subscription.retrieve" do
should "support requests with args: id" do
Stripe::Subscription.retrieve("sub_xxxxxxxxxxxxx")
@ -1958,7 +1976,7 @@ module Stripe
Stripe::SubscriptionSchedule.create(
{
customer: "cus_xxxxxxxxxxxxx",
start_date: 1_652_909_005,
start_date: 1_676_070_661,
end_behavior: "release",
phases: [
{
@ -2135,8 +2153,9 @@ module Stripe
address: {
line1: "1234 Main Street",
city: "San Francisco",
country: "US",
postal_code: "94111",
state: "CA",
country: "US",
},
}
)
@ -2209,6 +2228,18 @@ module Stripe
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent"
end
end
context "Terminal.Reader.process_setup_intent" do
should "support requests with args: setup_intent, customer_consent_collected, id" do
Stripe::Terminal::Reader.process_setup_intent(
"tmr_xxxxxxxxxxxxx",
{
setup_intent: "seti_xxxxxxxxxxxxx",
customer_consent_collected: true,
}
)
assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent"
end
end
context "Terminal.Reader.retrieve" do
should "support requests with args: id" do
Stripe::Terminal::Reader.retrieve("tmr_xxxxxxxxxxxxx")
@ -2232,7 +2263,7 @@ module Stripe
should "support requests with args: frozen_time, id" do
Stripe::TestHelpers::TestClock.advance(
"clock_xxxxxxxxxxxxx",
{ frozen_time: 1_652_390_605 }
{ frozen_time: 1_675_552_261 }
)
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance"
end
@ -2496,15 +2527,6 @@ module Stripe
assert_requested :post, "#{Stripe.api_base}/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx"
end
end
context "Treasury.FinancialAccount.update_features" do
should "support requests with args: card_issuing, parent_id" do
Stripe::Treasury::FinancialAccount.update_features(
"fa_xxxxxxxxxxxxx",
{ card_issuing: { requested: false } }
)
assert_requested :post, "#{Stripe.api_base}/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features"
end
end
context "Treasury.InboundTransfer.cancel" do
should "support requests with args: id" do
Stripe::Treasury::InboundTransfer.cancel("ibt_xxxxxxxxxxxxx")
@ -2564,8 +2586,8 @@ module Stripe
end
context "Treasury.OutboundPayment.cancel" do
should "support requests with args: id" do
Stripe::Treasury::OutboundPayment.cancel("obp_xxxxxxxxxxxxx")
assert_requested :post, "#{Stripe.api_base}/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel?"
Stripe::Treasury::OutboundPayment.cancel("bot_xxxxxxxxxxxxx")
assert_requested :post, "#{Stripe.api_base}/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel?"
end
end
context "Treasury.OutboundPayment.create" do
@ -2575,7 +2597,7 @@ module Stripe
financial_account: "fa_xxxxxxxxxxxxx",
amount: 10_000,
currency: "usd",
customer: "cu_xxxxxxxxxxxxx",
customer: "cus_xxxxxxxxxxxxx",
destination_payment_method: "pm_xxxxxxxxxxxxx",
description: "OutboundPayment to a 3rd party",
}
@ -2593,8 +2615,8 @@ module Stripe
end
context "Treasury.OutboundPayment.retrieve" do
should "support requests with args: id" do
Stripe::Treasury::OutboundPayment.retrieve("obp_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx?"
Stripe::Treasury::OutboundPayment.retrieve("bot_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx?"
end
end
context "Treasury.OutboundTransfer.cancel" do