-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stripe: Sprout Initial Stripe Utility
#831 #1002 This is mostly because I want to be able to move forward with connecting Vendor and Distributor accounts in the Marketplace, and to get started fiddling with the Stripe Connect bits. This also hopefully helps set the stage to getting rid of `Utility` classes, and instead have those inherit fro `UtilityHookup` (kind of like how new `Furniture` inherits from `FurniturePlacement` To be honest, I should probably either do a rename pass to more clearly indicate the old-way vs now-and-forward way of defining furniture, or do a final cleanup pass on both of those before starting this, but this was the nearest-mess-to-muck-with ( not clean... just.. uhhh... muck with) Anyway!
- Loading branch information
Showing
15 changed files
with
81 additions
and
17 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,13 @@ | ||
class StripeUtility < UtilityHookup | ||
def api_token=api_token | ||
configuration[:api_token] = api_token | ||
end | ||
|
||
def api_token | ||
configuration[:api_token] | ||
end | ||
|
||
def self.policy_class | ||
Policy | ||
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 @@ | ||
<%= render "password_field", form: form, attribute: :api_token %> |
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,7 @@ | ||
class StripeUtility < UtilityHookup | ||
class Policy < UtilityHookupPolicy | ||
def permitted_attributes(_params) | ||
[:name, :api_token] | ||
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<%= form.label attribute %> | ||
<%= form.select attribute, options, include_blank: include_blank %> | ||
<%= render partial: "error", locals: { model: form.object, attribute: attribute } %> | ||
<%= form.select attribute, options, include_blank: local_assigns.fetch(:include_blank, true) %> | ||
<%= render partial: "error", locals: { model: form.object, attribute: attribute } %> |
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,5 @@ | ||
<%= form_with(model: [utility_hookup.space, utility_hookup], local: true) do |form| %> | ||
<%= render "select", attribute: :utility_slug, options: Utilities::REGISTRY.keys, form: form %> | ||
<%= render "text_field", attribute: :name, form: form %> | ||
<%= form.submit %> | ||
<%- 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
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