Giter Site home page Giter Site logo

chastell / spree_payu_integration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jumski/spree_payu_integration

0.0 8.0 0.0 82 KB

Spree integration with OpenPayU payment service.

License: BSD 3-Clause "New" or "Revised" License

Ruby 95.87% JavaScript 3.36% CSS 0.38% HTML 0.39%

spree_payu_integration's Introduction

SpreePayuIntegration - maintained fork

Circle CI

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

Installation

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

Configuration

Don't forget to insert seller account details into config/initializers/openpayu.rb

Pay with Payu button

Hiding original submit button

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.

Preventing double-clicking Payu 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.

Testing

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.

spree_payu_integration's People

Contributors

jumski avatar busiq avatar ravbaker avatar naliwajek avatar dsawa avatar

Watchers

Marcin Ciunelis avatar Daniel Janus avatar  avatar Krzysztof Białek avatar James Cloos avatar  avatar Piotr Zientara avatar Kasia Frey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.