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

[6.x] Reference gateways & shipping methods by handles #968

Merged
merged 25 commits into from
Jan 14, 2024

Conversation

duncanmcclean
Copy link
Owner

@duncanmcclean duncanmcclean commented Jan 13, 2024

This pull request makes some necessary changes to the way Gateways & Shipping Methods are stored in order data.

Previously, the fully qualified class name was saved to the order's YAML:

shipping_method: DoubleThreeDigital\SimpleCommerce\Shipping\FreeShipping

However, with this PR, gateways & shipping methods are now references by their "handles":

shipping_method: free_shipping

References in orders will be automatically updated upon updating.

These changes were necessary as part of the change in namespace from DoubleThreeDigital to DuncanMcClean which is due to happen in the v6 release.

This PR is a draft for now since there's a couple of rough edges I want to iron out before merging.

To Do

  • Consider completely deprecating the class-based syntax to reduce tech debt & metal overhead.
    • Only accept handles in "form" requests (search TripleFourDigital\\ComplexCommerce\\SmellyGatewayHaha as reference)
  • Move the code from UpdateClassReferences into a command so it can be run manually if needed.
  • Add notes to upgrade guide
    • "The way gateways / shipping methods are references in orders has changed"
    • Handles for gateways are now generated differently. You should review your payment page & any other integrations you have which may rely on the existing handles.
  • Ensure the payment page in the Starter Kit is up-to-date (do references to hard-coded class names need changing to handles?)
  • Fix failing tests

@duncanmcclean duncanmcclean marked this pull request as ready for review January 14, 2024 15:20
@duncanmcclean duncanmcclean merged commit 30c1371 into main Jan 14, 2024
10 checks passed
@duncanmcclean duncanmcclean deleted the reference-by-handles branch January 14, 2024 15:20
Copy link

Released as part of v6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant