Project

avangate

0.0
No commit activity in last 3 years
No release in over 3 years
Avangate integration for Ruby on Rails using their SOAP API with Savon. Methods #login
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0
>= 0

Runtime

>= 0
 Project Readme

Avangate

Gem Version

This gem is a library to interact with Avangate SOAP API And to manage IPN - Payment Notifications

Current methods implemented:

SOAP:

#login
#addProduct
#setBillingDetails
#get_product_by_code

Notification:

#generate_receipt

Installation

Add this line to your application's Gemfile:

gem 'avangate'

And then execute:

$ bundle

Or install it yourself as:

$ gem install avangate

You need to provide your secret key and your merchant code, both you can get when you sign in to avangate website, then you need to create an initializer

config/initializers/avangate.rb

Inside you can and set up:

Avangate::Base.secret_key = "SECRET_KEY"
Avangate::Base.merchant_code = "MERCHANT_CODE"

Example of usage

SOAP:

@sessionId = Avangate::SOAP.login
Avangate::SOAP.add_product({session_id: @sessionId, product_id: 423221})
Avangate::SOAP.set_billing_details({
  session_id: @sessionId,
  address: '4 street',
  city: 'dream city',
  country: 'US',
  email: 'john.doe@example.com',
  first_name: 'John',
  last_name: 'Doe',
  postal_code: '12333',
  state: 'Alabama'
})


product = Avangate::SOAP.get_product_by_code({
  session_id: @sessionId,
  product_code: 123
})


IPN:

notification = Avangate::Notification.new params
render text: notification.generate_receipt

Contributing

  1. Fork it ( https://github.com/[my-github-username]/avangate/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request