Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration options to SolidusPaypalCommercePlatform #50

Merged
merged 2 commits into from
Jul 10, 2020

Conversation

seand7565
Copy link
Contributor

Adds ability to configure SPCP with:

SolidusPaypalCommercePlatform.configure do |config|
  config.order_simulator_class = "MyApp::BetterOrderSimulator"
end

instead of just setting options directly onto SolidusPaypalCommercePlatform. Also makes order_simulator a customizable class to solve #36

@seand7565 seand7565 added the chore Needs to be done, for necessity or for the well-being of the project, not related to a feature label Jun 30, 2020
@seand7565 seand7565 requested a review from elia June 30, 2020 19:09
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall!

One nit is that in other extension the config class is named Configuration and might make sense to stay consistent. About the commits I would suggest keeping the whole rename into the first one, and the order-simulator addition in the second, that should make for a really clean "blame" for our future selves 🕵️

lib/solidus_paypal_commerce_platform.rb Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@seand7565 seand7565 requested a review from elia July 6, 2020 16:05
@seand7565 seand7565 force-pushed the add_config branch 3 times, most recently from 6a4c962 to 8ab0587 Compare July 9, 2020 13:21
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one final fix that will save us a headache in the future 😄

seand7565 added 2 commits July 9, 2020 10:42
Renames Environment to Config so that we can set up extension configuration.
Now instead of just `SolidusPaypalCommercePlatform.env` you reference the
config object first like `SolidusPaypalCommercePlatform.config.env` - this PR
updates existing code to conform to this new standard.
Adds ability to configure the configuration setup, and adds an order_simulator_class
so that the order_simulator class is configurable.
@seand7565 seand7565 requested a review from elia July 9, 2020 15:43
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@elia elia merged commit c128029 into solidusio:master Jul 10, 2020
@elia elia linked an issue Jul 13, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Needs to be done, for necessity or for the well-being of the project, not related to a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow order simulator to be a configurable class
2 participants