mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-16 00:00:46 -04:00
Compare commits
7 Commits
96b7453ee9
...
1af83889bb
Author | SHA1 | Date | |
---|---|---|---|
|
1af83889bb | ||
|
e6b3043f66 | ||
|
e74bd2e7f7 | ||
|
bc924840dd | ||
|
456f10ab93 | ||
|
3ba3e10ec8 | ||
|
6dce6c1240 |
@ -1 +1 @@
|
||||
v392
|
||||
v406
|
@ -2,7 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# A customer session allows you to grant client access to Stripe's frontend SDKs (like BillingJs)
|
||||
# A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
|
||||
# control over a customer.
|
||||
class CustomerSession < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
module Stripe
|
||||
module FinancialConnections
|
||||
# Describes an owner of an account.
|
||||
class AccountOwner < StripeObject
|
||||
OBJECT_NAME = "financial_connections.account_owner"
|
||||
end
|
||||
|
@ -89,13 +89,16 @@ module Stripe
|
||||
val = Stripe::LEVEL_DEBUG
|
||||
elsif val == "info"
|
||||
val = Stripe::LEVEL_INFO
|
||||
elsif val == "error"
|
||||
val = Stripe::LEVEL_ERROR
|
||||
end
|
||||
|
||||
levels = [Stripe::LEVEL_INFO, Stripe::LEVEL_DEBUG, Stripe::LEVEL_ERROR]
|
||||
|
||||
if !val.nil? && !levels.include?(val)
|
||||
raise ArgumentError,
|
||||
"log_level should only be set to `nil`, `debug` or `info`"
|
||||
"log_level should only be set to `nil`, `debug`, `info`," \
|
||||
" or `error`"
|
||||
end
|
||||
@log_level = val
|
||||
end
|
||||
|
@ -30,12 +30,6 @@ module Stripe
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/accounts?limit=3"
|
||||
end
|
||||
end
|
||||
context "Account.persons" do
|
||||
should "support requests with args: limit, parent_id" do
|
||||
Stripe::Account.persons("acct_xxxxxxxxxxxxx", { limit: 3 })
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons?limit=3"
|
||||
end
|
||||
end
|
||||
context "Account.reject" do
|
||||
should "support requests with args: reason, id" do
|
||||
Stripe::Account.reject("acct_xxxxxxxxxxxxx", { reason: "fraud" })
|
||||
@ -1312,6 +1306,32 @@ module Stripe
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx"
|
||||
end
|
||||
end
|
||||
context "PaymentSource.update" do
|
||||
should "support requests with args: customer, card, account_holder_name" do
|
||||
Stripe::Customer.update_source(
|
||||
"cus_123",
|
||||
"card_123",
|
||||
{ account_holder_name: "Kamil" }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/sources/card_123"
|
||||
end
|
||||
should "support requests with args: metadata, parent_id, id" do
|
||||
Stripe::Customer.update_source(
|
||||
"cus_xxxxxxxxxxxxx",
|
||||
"ba_xxxxxxxxxxxxx",
|
||||
{ metadata: { order_id: "6735" } }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx"
|
||||
end
|
||||
should "support requests with args: name, parent_id, id" do
|
||||
Stripe::Customer.update_source(
|
||||
"cus_xxxxxxxxxxxxx",
|
||||
"card_xxxxxxxxxxxxx",
|
||||
{ name: "Jenny Rosen" }
|
||||
)
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx"
|
||||
end
|
||||
end
|
||||
context "Payout.cancel" do
|
||||
should "support requests with args: id" do
|
||||
Stripe::Payout.cancel("po_xxxxxxxxxxxxx")
|
||||
@ -1354,6 +1374,12 @@ module Stripe
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/payouts/po_xxxxxxxxxxxxx"
|
||||
end
|
||||
end
|
||||
context "Person.list" do
|
||||
should "support requests with args: limit, parent_id" do
|
||||
Stripe::Account.list_persons("acct_xxxxxxxxxxxxx", { limit: 3 })
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons?limit=3"
|
||||
end
|
||||
end
|
||||
context "Person.retrieve" do
|
||||
should "support requests with args: parent_id, id" do
|
||||
Stripe::Account.retrieve_person(
|
||||
|
Loading…
x
Reference in New Issue
Block a user