Skip to content

ActiveMerchant Payrix is an add-on for ActiveMerchant which provides a gateway for Payrix's HPP service.

License

Notifications You must be signed in to change notification settings

mhssmnn/activemerchant-payrix

Repository files navigation

activemerchant-payrix

ActiveMerchant Payrix is an add-on for ActiveMerchant which provides a gateway for Payrix's HPP service.

Installation

Before installing the gem you should have a Payrix account ready to use. If not then Contact Payrix for more info.

To install simply add the following line to your Gemfile and then run bundle install:

gem 'activemerchant-payrix'

The gateway can be initialised by passing your login details like so:

gateway = ActiveMerchant::Billing::PayrixGateway.new(:login => 'login', :password => 'pass', :business_id => 'num', :service => 'hpp')

Usage

Once you have an initialised gateway, you can use the setup_purchase method:

amount     = 1000 # 1000 cents is $10.00 AUD
options    = { return_url: return_url } # Pass the return url to Payrix

response = gateway.purchase(amount, options)

if response.sucess?
  puts "All OK!"
else
  puts response.message # Output the error message
end

License

activemerchant-payrix is distributed under a standard MIT license, see LICENSE for further information.

Contributing

Fork on GitHub and after you’ve committed tested patches, send a pull request.

To get tests running simply run bundle install and then rake test:units.

About

ActiveMerchant Payrix is an add-on for ActiveMerchant which provides a gateway for Payrix's HPP service.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages