Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was exploring some stuff in the Commerce extension docs and figured it was worth implementing Generators for some of the common components. My primary motivation is to have some external examples to point at, and to move some of the fussy out-of-context method signature stuff into code that can be maintained with the package, rather than as external documentation.
This introduces three new options, when the Generator is installed:
craft make adjuster
): Stubs and registers a new Order Adjuster class in the specified module or plugin;craft make gateway
): Stubs and registers a new Gateway class in the specified module or plugin (as well as creating the appropriate payment form and request/response models, and the corresponding back- and front-end templates);craft make shipping-method
): Stubs a new shipping method in the specified module or plugin (developer is responsible for registering it, as the logic for this is significantly different based on whether you just need a single hard-coded method or many methods—say, defined by and loaded from a third-party service);Submitting as a Draft, because this definitely needs a second set of eyes… but I'm also not confident this covers even a fraction of the extension surface area. Purchasables are probably the biggest omission—and I don't even know where to begin with Tax Engines! 😂
Todo:
make element-type
…)