mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-14 00:00:44 -04:00
Compare commits
No commits in common. "7db585f5a44d6e32531cc5b9add308a5be2ab92c" and "8be00fef4eb3150ebf9b60d86c23e03a0eab886e" have entirely different histories.
7db585f5a4
...
8be00fef4e
@ -1,9 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 8.3.0 - 2023-02-16
|
||||
* [#1175](https://github.com/stripe/stripe-ruby/pull/1175) API Updates
|
||||
* Add support for `refund_payment` method on resource `Terminal.Reader`
|
||||
|
||||
## 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`
|
||||
|
@ -1 +1 @@
|
||||
v226
|
||||
v223
|
@ -3,13 +3,11 @@
|
||||
|
||||
module Stripe
|
||||
# This is an object representing a Stripe account. You can retrieve it to see
|
||||
# properties on the account like its current requirements or if the account is
|
||||
# enabled to make live charges or receive payouts.
|
||||
# properties on the account like its current e-mail address or if the account is
|
||||
# enabled yet to make live charges.
|
||||
#
|
||||
# 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).
|
||||
# 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).
|
||||
class Account < APIResource
|
||||
extend Gem::Deprecate
|
||||
extend Stripe::APIOperations::Create
|
||||
|
@ -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 redirect to its URL
|
||||
# to begin Checkout.
|
||||
# You can create a Checkout Session on your server and pass its ID to the
|
||||
# client to begin Checkout.
|
||||
#
|
||||
# Related guide: [Checkout Quickstart](https://stripe.com/docs/checkout/quickstart).
|
||||
class Session < APIResource
|
||||
|
@ -2,17 +2,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# 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).
|
||||
# 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 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).
|
||||
# Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items).
|
||||
class InvoiceItem < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
include Stripe::APIOperations::Delete
|
||||
|
@ -41,15 +41,6 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
def refund_payment(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(self["id"]) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
def set_reader_display(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -86,15 +77,6 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
def self.refund_payment(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
def self.set_reader_display(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
VERSION = "8.3.0"
|
||||
VERSION = "8.2.0"
|
||||
end
|
||||
|
@ -150,10 +150,6 @@ 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
|
||||
@ -277,7 +273,7 @@ module Stripe
|
||||
amount: 2000,
|
||||
currency: "usd",
|
||||
source: "tok_xxxx",
|
||||
description: "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)",
|
||||
description: "My First Test Charge (created for API docs)",
|
||||
}
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/charges"
|
||||
@ -335,10 +331,11 @@ module Stripe
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/checkout/sessions"
|
||||
end
|
||||
should "support requests with args: success_url, line_items, mode" do
|
||||
should "support requests with args: success_url, cancel_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",
|
||||
}
|
||||
@ -450,9 +447,7 @@ 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 at https://www.stripe.com/docs/api)",
|
||||
}
|
||||
{ description: "My First Test Customer (created for API docs)" }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/customers"
|
||||
end
|
||||
@ -651,10 +646,6 @@ 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
|
||||
@ -1123,13 +1114,9 @@ module Stripe
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents"
|
||||
end
|
||||
should "support requests with args: amount, currency, automatic_payment_methods2" do
|
||||
should "support requests with args: amount, currency, payment_method_types" do
|
||||
Stripe::PaymentIntent.create(
|
||||
{
|
||||
amount: 2000,
|
||||
currency: "usd",
|
||||
automatic_payment_methods: { enabled: true },
|
||||
}
|
||||
{ amount: 2000, currency: "usd", payment_method_types: ["card"] }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/payment_intents"
|
||||
end
|
||||
@ -1177,13 +1164,6 @@ 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
|
||||
@ -1243,8 +1223,8 @@ module Stripe
|
||||
type: "card",
|
||||
card: {
|
||||
number: "4242424242424242",
|
||||
exp_month: 8,
|
||||
exp_year: 2024,
|
||||
exp_month: 5,
|
||||
exp_year: 2023,
|
||||
cvc: "314",
|
||||
},
|
||||
}
|
||||
@ -1800,13 +1780,6 @@ 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
|
||||
@ -1903,6 +1876,15 @@ 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")
|
||||
@ -1976,7 +1958,7 @@ module Stripe
|
||||
Stripe::SubscriptionSchedule.create(
|
||||
{
|
||||
customer: "cus_xxxxxxxxxxxxx",
|
||||
start_date: 1_676_070_661,
|
||||
start_date: 1_652_909_005,
|
||||
end_behavior: "release",
|
||||
phases: [
|
||||
{
|
||||
@ -2153,9 +2135,8 @@ module Stripe
|
||||
address: {
|
||||
line1: "1234 Main Street",
|
||||
city: "San Francisco",
|
||||
postal_code: "94111",
|
||||
state: "CA",
|
||||
country: "US",
|
||||
postal_code: "94111",
|
||||
},
|
||||
}
|
||||
)
|
||||
@ -2228,18 +2209,6 @@ 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")
|
||||
@ -2263,7 +2232,7 @@ module Stripe
|
||||
should "support requests with args: frozen_time, id" do
|
||||
Stripe::TestHelpers::TestClock.advance(
|
||||
"clock_xxxxxxxxxxxxx",
|
||||
{ frozen_time: 1_675_552_261 }
|
||||
{ frozen_time: 1_652_390_605 }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance"
|
||||
end
|
||||
@ -2527,6 +2496,15 @@ 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")
|
||||
@ -2586,8 +2564,8 @@ module Stripe
|
||||
end
|
||||
context "Treasury.OutboundPayment.cancel" do
|
||||
should "support requests with args: id" do
|
||||
Stripe::Treasury::OutboundPayment.cancel("bot_xxxxxxxxxxxxx")
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel?"
|
||||
Stripe::Treasury::OutboundPayment.cancel("obp_xxxxxxxxxxxxx")
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel?"
|
||||
end
|
||||
end
|
||||
context "Treasury.OutboundPayment.create" do
|
||||
@ -2597,7 +2575,7 @@ module Stripe
|
||||
financial_account: "fa_xxxxxxxxxxxxx",
|
||||
amount: 10_000,
|
||||
currency: "usd",
|
||||
customer: "cus_xxxxxxxxxxxxx",
|
||||
customer: "cu_xxxxxxxxxxxxx",
|
||||
destination_payment_method: "pm_xxxxxxxxxxxxx",
|
||||
description: "OutboundPayment to a 3rd party",
|
||||
}
|
||||
@ -2615,8 +2593,8 @@ module Stripe
|
||||
end
|
||||
context "Treasury.OutboundPayment.retrieve" do
|
||||
should "support requests with args: id" do
|
||||
Stripe::Treasury::OutboundPayment.retrieve("bot_xxxxxxxxxxxxx")
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx?"
|
||||
Stripe::Treasury::OutboundPayment.retrieve("obp_xxxxxxxxxxxxx")
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx?"
|
||||
end
|
||||
end
|
||||
context "Treasury.OutboundTransfer.cancel" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user