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

Unsetting configuration #7

Closed
jimmybaker opened this issue Apr 12, 2018 · 3 comments
Closed

Unsetting configuration #7

jimmybaker opened this issue Apr 12, 2018 · 3 comments
Assignees

Comments

@jimmybaker
Copy link

Is there an easy method to unset the configuration parameters? My app is multi-tenant and each tenant has their own merchant id, username, password, etc.. Just wondering if there's an easy way to unset this information after each request or if I need to just set them to nil individually.

@thetizzo
Copy link
Contributor

Great question. When you create the service instance (e.g. CardConnect::Service::Authorization.new) you can pass in a connection object with any parameters you need.

I would try something like this:

config = CardConnect::Configuration.new(merchant_id: x, api_username: y, etc...)
connection = CardConnect::Connection.new(config)
CardConnect::Service::Authorization.new(connection).build_request(params)

I think this should work but definitely seems like there is some work to do to make this a more clearly supported path. For example, you can pass in merchant ID as part of the normal params and it just seems like we should add this option for each of the configuration parameters and fall back on the default if they aren't there like we do for merchant ID.

I'm interested in your feedback on if this works or doesn't work for you and how we could make this easier to do.

Thanks!

@thetizzo thetizzo self-assigned this Apr 12, 2018
@ghost
Copy link

ghost commented Jul 19, 2018

Can this be used in Odoo 11? I'm not tech., I have tried hard to find a guy here in the US to help me but non seem to exist, so please bear with me.

@thetizzo
Copy link
Contributor

@KaSt69 Hi, I'm not sure what Odoo 11 is so I can't say for sure, but I suspect that it's unlikely. This library is for Ruby or Rails applications that need to integrate with the CardConnect JSON API.

If you have a more specific example of what you're trying to do I could try and help. Please open a new issue for that.

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

No branches or pull requests

2 participants