Last active
June 16, 2020 12:03
-
-
Save bencrouse/c573f2dc1a695c74b354b3d68db9fbf7 to your computer and use it in GitHub Desktop.
Custom shipping gateway
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
module ActiveShipping | |
class MyBuild < ActiveShipping::Fedex | |
def find_rates(*args) | |
results = super | |
# some code to customize the results | |
return results | |
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
unless Rails.env.test? | |
Workarea.config.gateways.shipping = ActiveShipping::MyBuild.new( | |
login: '999999999', | |
password: '7777777', | |
key: '1BXXXXXXXXXxrcB', | |
account: '51XXXXX20' | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd suggest writing unit tests to cover the custom gateway's functionality.