Git Product home page Git Product logo

proxypay-api's Introduction

ProxyPay API Wrapper

An API wrapper for ProxyPay written in Nodejs. ProxyPay is a service that allow payments in ATM by generating custom references used by small, medium and big companies in Angola 🇦🇴.

For more information about ProxyPay visit their beautiful site: https://proxypay.co.ao.

OBS: Existe uma versão da documentação em Português 🇦🇴.

Usage

1 - Install it

sudo npm install proxypay-api --save

2 - Import and configure it

const ProxyPay = require("proxypay-api");

var P = new ProxyPay({
	apikey: "your_api_key_provided_by_proxypay"
});

Methods

Generate(data)

It Generate a new reference. This method has one parameter, data, is an object. Example:

var data = {
	reference: {
		amount: "5000.00",
		expiry_date: "2017-01-01",
		custom_fields: {
			invoice: "2017/002",
			name: "Firmino Changani",
			email: "[email protected]",
			cellphone: "915044355"
		}
	}
}

// Call the method with and object as a parameter
P.GenerateReference(data)
.then(
	(success)=>{
		console.log(success);
	},
	(error)=>{
		console.log(error);
	}
);

Read more about generating references.

GetAllReferences(options)

This method return all references generated in your account. Has one parameter which is an optional object with theses properties:

Property Default Description
limit 100 Max. number of references to return.
offset 0 Skip offset records. Usefull for pagination.
status - Filter parameter. If set to either active, deleted, expired or paidwill return only references with that status value.
q - Filter parameter. will return any reference for which the value of the q parameter matches the beginning of the reference number or any of the custom_fields.

Example:

P.GetAllReferences()
.then(
	(success)=>{
		console.log(success);
	},
	(error)=>{
		console.log(error);
	}
);

Read more about: get all references.

GetOneReference(id)

This method return on reference specified by its id. Has one parameter which is the id. Example:

P.GetOneReference("reference_id")
.then(
	(success)=>{
		console.log(success);
	},
	(error)=>{
		console.log(error);
	}
);

Read more about: get one reference.

GetPayments(options)

This method fetch all Payment events that have not been acknowledged. Has one parameter which is an optional object with theses properties:

Property Default Description
n 100 Max. number of payment events to return. This must be between 1 and100
offset 0 Skip offset records. Usefull for pagination.

Example:

P.GetPayments()
.then(
	function(success){
		console.log(success);
	},
	function(err){
		console.log(err);
	}
);

Read more about: fetch all payments.

AcknowledgePayments(paymentid)

This method acknowledges that a specific payment has been processed. Has one parameter which is the paymentid that can be a string for a single payment or an array for multiple payments.

P.AcknowledgePayments(["449500352608"])
.then(
	function(success){
		console.log(success);
	},
	function(err){
		console.log(err);
	}
);

Read more about: Acknowledge a single Payment or multiple Payments.

License

This project is under MIT license. Read more about that here

Copyright 2017 - Firmino Changani

proxypay-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

academia-sirius

proxypay-api's Issues

Add Sync methods

For any reason somebody would want to use synchronous methods to interact with ProxyPay.

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.