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

Server configuration value (PaymentMethod.preferred_server) is totally ignored #7

Open
geofflane opened this issue Apr 21, 2014 · 6 comments

Comments

@geofflane
Copy link
Contributor

I'm running a "staging" instance where it's running as Rails production mode, but I want to run things like Payment Processors in test mode of course. With other integrations like Paypal, they respect the server values for that and work as expected.

The "Server" value that is set in the Spree Admin is not used. The server to use is entirely determined by the environment that it's running in instead. Adyen HPP generates the URL by going directly to the Adyen code without using any Payment Method configuration. The redirect_url doesn't provide a way to override the environment either.

@huoxito
Copy link
Contributor

huoxito commented Apr 21, 2014

@geofflane you mean the server checkbox on payment methods payment right? yeah I don't think we need that at all here. Need to double check that though. Maybe there's some value we need to set on Adyen depending on that flag.

@geofflane
Copy link
Contributor Author

It's a text field titled "Server".
Adyen runs either in "test" or "live" mode, and I expected the value set in "Server" to be passed through to set that mode. (That's how it works for Paypal, for example: sandbox or live.)

To be a bit clearer (hopefully):
Adyen.configuration.environment is the value that is detected based on the Rails environment
PaymentMethod.preferred_server is the value on the Spree side that seems to be used by other PaymentMethods to determine what URL to go to for payment processing.

@geofflane geofflane changed the title Server configuration value is totally ignored Server configuration value (PaymentMethod.preferred_server) is totally ignored Apr 21, 2014
@huoxito
Copy link
Contributor

huoxito commented Apr 21, 2014

Got it thanks. Please feel free to submit a PR so that it set the environment based on that flag. Maybe it's as easy as setting it up here https://github.com/spree/spree-adyen/blob/master/app/models/spree/adyen_common.rb#L15-17

@geofflane
Copy link
Contributor Author

I'll try and look into it. I did look at that AdyenCommon class. I wasn't able to determine when/if that was called during the checkout process though.

@huoxito
Copy link
Contributor

huoxito commented Apr 21, 2014

Thanks @geofflane. It's called any time any of the Payment#Processing methods are called. e.g. authorize, purchase, capture. So my guess is that it's sure called during checkout process.

@geofflane
Copy link
Contributor Author

For AdyenHPP it doesn't seem to be called because the Redirect URL on the Checkout page is generated from the Adyen::Form object directly which comes from the Adyen Gem.

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