Spree integration with OpenPayU payment service.
This is a maintained fork of netguru/spree_payu_integration.
Changes:
- Updated to work with Spree 3
- Requests to PayU are done in separate controller, not in before filter
- Added JS to toggle
payu_selected
class on form, so original submit can be hidden with CSS
Add spree_payu_integration to your Gemfile:
gem 'spree_payu_integration', github: 'rebased/spree_payu_integration'
Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_payu_integration:install
Don't forget to insert seller account details into config/initializers/openpayu.rb
spree_payu_integration
adds a payu_selected
css class to form#checkout_form_payment
when PayU payment is selected, and removes this class if some other payment
is choosen. To use this functionality, just add //= require spree/frontend/spree_payu_integration
to your application.js
.
This is so developer can conditionally hide "Save and Continue" button with css, so "Pay with PayU" button can be positioned in exact same spot than "Save and Continue".
REMEMBER: This is your job to write CSSes that hides "Save and Continue" button.
Please ensure you have some JavaScript in place that will prevent double-clicking
PayU button. This can lead to lost carts, because first request
will advance order to completed
state, and the second one will raise
an error, because you can only make payments for orders in payment
state.
REMEMBER: This is your job to write JSes that prevents double clicking the button.
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
bundle
bundle exec rake test_app
bundle exec rspec spec
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_payu_integration/factories'
Original authors: netguru, released under the New BSD License.
This fork maintained by rebased.