0.1.3 • Published 5 years ago

@eckidevs/payfastjs v0.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

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

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago