Git Product home page Git Product logo

proxypay's Introduction

Proxypay

A ruby gem created by Sergio Maziano for the ProxyPay API that allows online payments using Angolan ATM's reference (Multicaixa references).

Installation

Add this line to your application's Gemfile:

gem 'proxypay'

And then execute:

$ bundle

Or install it yourself as:

$ gem install proxypay

Setup

Make sure you setup the environment variables PROXYPAY_USER and PROXYPAY_API_KEY:

PROXYPAY_USER=api
PROXYPAY_API_KEY=your_api_key_obtained_from_proxypay_folks

to make requests with another api_key use this on every method call.

options = {api_key: your_api_key_obtained_from_proxypay_folks}

to make the request proxypay's test server use

options = {is_test: true}

Usage

Use the class methods to get it going

References

Fetch all available references

Proxypay.get_references # Fetch all references
Proxypay.get_references(api_key: some_api_key) # fetch using this key
Proxypay.get_references(is_test: true) # fetch from the test server

Fetch references by using query's

or you can pass one or several query's parameters and even use the custom_fields defined at proxypay.

options = {query: {status:"paid", offset:15, limit:13, q:{custom_fields:{your_fild:"some_data", some_other_filed:{that_takes:"an_hash"}}}}}
Proxypay.get_references(options)

Fetch a reference by using id

options = {}
Proxypay.get_reference(id, options)

Request a new reference - amount and expiration_date for the reference are mandatory

Proxypay.new_reference("2000.00", "2015-10-10")

Request a reference and add custom fields to your reference for your identification.

options = {custom_fields: {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}}
Proxypay.new_reference("2000.00", "2015-10-10", options)

Payments

Fetch all payments that haven't been acknowledged

Proxypay.get_payments

Fetch all the payments with limitation by the specified number(quantity)

options = {query: {n:48}}
Proxypay.get_payments(options)

Fetch a specific payment by passing his ID

options = {}
Proxypay.get_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL", options)

Acknowledge a payment by passing his ID

options = {}
Proxypay.new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL", options)

Acknowledge multiple payments by passing and array of ID's

ids = ["OcSLBANU4tjRi9gfW5VUcMqkvzL", "EcJLBANU4trUi8gfM6MOcMqkvzH","VxELBANU4tjRi9gfW5VUcMqkvzZ"]
options = {}
Proxypay.new_payments(ids, options)

Help and Docs

Development

  • You can fork the project
  • bundle
  • bundle rake exec
  • Make your feature addition or fix a bug
  • Do not mess with rakefile, version or history (do not submit version bump PLEASE or put it in a different commit so we can ignore it when pull)
  • Send us the pull request

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/smaziano/proxypay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

proxypay's People

Contributors

ml avatar nelsonmfinda avatar smaziano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

proxypay's Issues

Security - Rake Update

Vulnerable versions: <= 12.3.2
Patched version: 12.3.3
There is an OS command injection vulnerability in Ruby Rake before 12.3.3 in Rake::FileList when supplying a filename that begins with the pipe character |.

LoadError:

It shows a error on version 0.1.5 when trying to require 'proxypay'.

LoadError: cannot load such file -- ./lib/proxypay/version.rb

Add Query parameters

I there, I also built and API wrapper for ProxyPay using Nodejs and your repository helped me, thanks.

Would be nice if you add query parameters in get_references and get_payments methods just like the official API supports.

Great project by the way.

Best regards, Firmino.

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.