Skip to content

Commit

Permalink
prepping for v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
isocroft committed Mar 20, 2019
1 parent 52efc3d commit de66b87
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<a name="0.1.1"></a>
# 0.1.1 (2019-04-07)

<a name="0.1.2"></a>
# 0.1.2 (2019-03-20)

### Bug Fixes
- None
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# adonis-paystack
An addon/plugin package to provide InfoBip single/bulk SMS services in AdonisJS 4.1+
An addon/plugin package to provide PayStack payment services in AdonisJS 4.1+

[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
Expand All @@ -13,11 +13,11 @@ An addon/plugin package to provide InfoBip single/bulk SMS services in AdonisJS
```bash

$ npm i --save adonisjs-paystack
$ adonis install adonisjs-paystack

```

>Make use of it inside a HTTP/WS controller
>Make use of it inside a HTTP/Web Socket Controller(s)
```js

Expand Down Expand Up @@ -75,14 +75,16 @@ MIT

```bash

npm run lint

npm run test

```

## Credits

- Ifeora Okechukwu <Head Of Technology - Oparand> (https://twitter.com/isocroft)
- Ahmad Abdul-Aziz <Software Engineer> (https://twitter.com/dev_amaz)
- [Ifeora Okechukwu <Head Of Technology - Oparand>](https://twitter.com/isocroft)
- [Ahmad Abdul-Aziz <Software Engineer>](https://twitter.com/dev_amaz)

## Contributing

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adonisjs-paystack",
"version": "0.1.1",
"version": "0.1.2",
"description": "An addon/plugin package to provide PayStack payment services in AdonisJS 4.1+",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -37,7 +37,8 @@
},
"standard": {
"globals": [
"use"
"use",
"test"
]
},
"dependencies": {
Expand Down
25 changes: 23 additions & 2 deletions providers/PayStackProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,33 @@
const { ServiceProvider } = require('@adonisjs/fold')

class PayStackProvider extends ServiceProvider {
/**
* Register method called by ioc container
*
* @method register
*
* @return {void}
*/
register () {
this.app.singleton('Adonis/Addons/PayStack', () => {
const Config = this.app.use('Adonis/Src/Config')
const PayStack = require('../src/Paystack')
return (new PayStack(require('@stitchng/paystack'), Config)).agent
const Env = this.app.use('Env')
const PayStack = require('../src/Paystack/index.js')
return (new PayStack(require('paystack-node'), Config, Env)).agent
})

this.app.alias('Adonis/Addons/PayStack', 'PayStack')
}

/**
* Boot the provider
*
* @method boot
*
* @return {void}
*/
boot () {
;
}
}

Expand Down
14 changes: 6 additions & 8 deletions src/PayStack/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
'use strict'

// const Event = use('Event')
const Env = use('Env')

class PayStackAPIClient {
constructor (Agent, Config) {
constructor (Agent, Config, Env) {
let environment = Env.get('NODE_ENV')
let apiKey = (environment === 'development') ? Config.get('paystack.apiTestKey') : Config.get('paystack.apiLiveKey')

this.agent = new Agent(
Config.get('paystack.apiKey'),
Env.get('NODE_ENV')
apiKey,
environment
)

if (Config.get('paystack.installWebHook') === true) {
;
}
}
};

Expand Down

0 comments on commit de66b87

Please sign in to comment.