Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add billing portal configuration (#965)
- Loading branch information
1 parent
512f546
commit f59ba8c
Showing
7 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module BillingPortal | ||
class Configuration < APIResource | ||
extend Stripe::APIOperations::Create | ||
extend Stripe::APIOperations::List | ||
include Stripe::APIOperations::Save | ||
|
||
OBJECT_NAME = "billing_portal.configuration" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
require ::File.expand_path("../../test_helper", __dir__) | ||
|
||
module Stripe | ||
module BillingPortal | ||
class ConfigurationTest < Test::Unit::TestCase | ||
should "be creatable" do | ||
session = Stripe::BillingPortal::Configuration.create({ | ||
business_profile: { | ||
privacy_policy_url: "https://example.com/privacy", | ||
terms_of_service_url: "https://example.com/tos", | ||
}, | ||
features: { customer_update: { allowed_updates: ["address"], enabled: true } }, | ||
}) | ||
assert_requested :post, "#{Stripe.api_base}/v1/billing_portal/configurations" | ||
assert session.is_a?(Stripe::BillingPortal::Configuration) | ||
end | ||
should "be retrievable" do | ||
session = Stripe::BillingPortal::Configuration.retrieve("bpc_xyz") | ||
assert_requested :get, "#{Stripe.api_base}/v1/billing_portal/configurations/bpc_xyz" | ||
assert session.is_a?(Stripe::BillingPortal::Configuration) | ||
end | ||
|
||
should "be updateable" do | ||
session = Stripe::BillingPortal::Configuration.update("bpc_xyz", { active: false }) | ||
assert_requested :post, "#{Stripe.api_base}/v1/billing_portal/configurations/bpc_xyz" | ||
assert session.is_a?(Stripe::BillingPortal::Configuration) | ||
end | ||
should "be listable" do | ||
sessions = Stripe::BillingPortal::Configuration.list | ||
assert_requested :get, "#{Stripe.api_base}/v1/billing_portal/configurations" | ||
assert sessions.data[0].is_a?(Stripe::BillingPortal::Configuration) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters