Skip to content
PayU Latam Rails Library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
app/controllers/pay_u_rails
bin
config
lib
spec
.gitignore
.rubocop.yml
Gemfile
LICENSE
README.md
payu-latam-rails.gemspec

README.md

PayU Latam Rails Library

CircleCI Maintainability

Installation

gem "payu-latam-rails", github: "lengio/payu-latam-rails", require: "pay_u_rails"

# Local
gem build payu-latam-rails.gemspec

Usage

Mounting routes

# config/routes.rb
mount PayURails::Engine, at: "/pay_u", as: "pay_u"

Subscribing with blocks

PayURails.subscribe(PayURails::Confirmation::EVENT) do |confirmation|
    # Do something with PayU::Confirmation object
end

PayURails.subscribe(PayURails::Response::EVENT) do |response|
    # Do something with PayU::Response object
end

Subscribing with objects

class Subscriber
    def call(confirmation)
        # Do something with PayU::Confirmation object
    end
end

PayURails.subscribe(PayURails::Confirmation::EVENT, Subscriber.new)

Testing

rspec

Console

bin/console
You can’t perform that action at this time.