Skip to content

Instantly share code, notes, and snippets.

@bencrouse
Last active June 16, 2020 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bencrouse/c573f2dc1a695c74b354b3d68db9fbf7 to your computer and use it in GitHub Desktop.
Save bencrouse/c573f2dc1a695c74b354b3d68db9fbf7 to your computer and use it in GitHub Desktop.
Custom shipping gateway
module ActiveShipping
class MyBuild < ActiveShipping::Fedex
def find_rates(*args)
results = super
# some code to customize the results
return results
end
end
end
unless Rails.env.test?
Workarea.config.gateways.shipping = ActiveShipping::MyBuild.new(
login: '999999999',
password: '7777777',
key: '1BXXXXXXXXXxrcB',
account: '51XXXXX20'
)
end
@bencrouse
Copy link
Author

I'd suggest writing unit tests to cover the custom gateway's functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment