npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

thepeer-angular

v0.0.3

Published

> Angular library for integrating Thepeer. Thepeer is a fast and secure way to send money accross businesses

Downloads

7

Readme

thepeer-angular

Angular library for integrating Thepeer. Thepeer is a fast and secure way to send money accross businesses

INSTALLATION

To install, simply run the command:

npm install thepeer-angular

USAGE

Import the module

import { ThepeerModule } from 'thepeer';
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ThepeerModule.forRoot('--YOUR PUBLIC KEY HERE--')
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use in your project

There are two ways to implement this library in your project:

  • You can use functions that can be called from a template within your project as shown below:
import { ThepeerService } from 'thepeer'

constructor(private thePeerService: ThepeerService){}


  send(){
    this.thePeerService.initiateSend(config);
  }

  directDebit(){
    this.thePeerService.initiateDirectDebit(config);
  }

  checkout(){
    this.thePeerService.initiateCheckout(config);
  }
<button (click)="send()">Send</button>
<button (click)="directDebit()">Direct Debit</button>
<button (click)="checkout()">Checkout</button>
  • You can use a couple of pre-built components:
<thepeer-send 
    [config]="config"
>Send</thepeer-send>

<thepeer-direct-debit 
    [config]="config"
>Direct Debit</thepeer-direct-debit>

<thepeer-checkout 
    [config]="config"
>Checkout</thepeer-checkout>

The Config Object

The config object allows you to set your configuration options. A sample config object is shown below:

import { IEventResponse } from 'thepeer'

 config = {
    publicKey: "--PUBLIC KEY HERE--",
    amount: 10000,
    email: "[email protected]",
    currency: "NGN",
    meta: {
        city: "Cupertino",
        state: "California"
    },
    onSuccess: (data: IEventResponse) => {
      console.log('success: ', data)
    },
    onError: (data: IEventResponse) => {
      console.log('error: ', data)
    },
    onClose: (data: IEventResponse) => {
      console.log('close: ', data)
    }
}

NOTE: The PUBLIC_KEY here is optional. If it is provided, it overrides the one in the module.

| Option | Description | Required | Type | |---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-----------| | publicKey | Your public key can be found on your dashboard. It can either be provided in the module or as part of the config object | true | string | | amount | This is the amount to be sent and must be in kobo e.g N100 will be 10000 | true | integer | | userReference | The user reference uniquely identifies a user. It is returned when a user is indexed by using the Thepeer API. It is required when initiating send or direct debit functionalities | true | string | | meta | This contains optional values you will like to have with your transaction response. | false | object | | email | Your customer's email. It is required for checkout | true | string | | onSuccess | It is called when a transaction is successful. | true | function | | onError | It is called when an error occurs. | true | function | | onClose | It is called when a user clicks the close button | true | function |

THEPEER API REFERENCES

Thepeer API docs Thepeer Dashboard

SUPPORT

Please reach out to me at [email protected] if you have any issues

CONTRIBUTING

Please feel free to fork this library and contribute by submitting a pull request to enhance the functionalities.

License

The MIT License (MIT). Please see License File for more information.