📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

@eckidevs/payfastjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eckidevs/payfastjs

A Node.js implementation of the PayFast API.

0.1.3
latest
Source
npm
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

A Node.js implementation of PayFast's API. An effort to present the data returned in a JS friendly way and abstract some of PayFast's intricate request payloads.

Getting started

npm i @eckidevs/payfastjs

or

yarn add @eckidevs/payfastjs

Usage

const payfast = require('payfastjs');

// Use the credentials from your PayFast dashboard
payfast.options({ merchantId: 'xxxx', passphrase: 'xxxx' })

// Example usage
payfast.getTransactions({ period: 'daily', from: '2018-12-31' })
  .then(data => console.log(data)) // JSON
  .catch(error => console.log(error))

Available methods

options({ merchantId: String, passphrase: String })

- merchantId:
  • type: String
  • required: true
  • description: your PayFast merchantId
- passphrase:
  • type: String
  • required: true
  • description: your PayFast passphrase must explicity be created under settings > integrations.

getTransactions({ period: String, from: String, to: String })

- period:
  • type: String
  • required: false
  • default: daily
  • options: '', 'daily', 'weekly', 'monthly'
  • description: Gives the agregate of transactions for the specified period.
- from:
  • type: String
  • required: false
  • default: start of current month
  • format: 'YYYY-MM-DD'
  • description: Specifies the date from which transactions should be searched for.
- to:
  • type: String
  • required: false
  • default: current day
  • format: 'YYYY-MM-DD'
  • description: Specifies the date up to which transactions should be searched for.

Roadmap

  • Write unit tests
  • setup CI/CD
  • Contribution guide and repo config
  • Further SDK methods
    • Subscription management
    • Ad Hoc payment management
    • Credit Card transaction query
  • Maintainence/staying up to date with PayFast releases

Contributions and comments welcome

Keywords

node

FAQs

Package last updated on 25 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts