New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular4-paystack

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular4-paystack

an angular 4 module for paystack transactions

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
818
increased by117.55%
Maintainers
1
Weekly downloads
 
Created
Source

ANGULAR4-PAYSTACK

This is an angular module that abstracts the complexity of making paystack payments with Angular2+.

USAGE

1. Install the module

npm install --save angular4-paystack

2. Reference the Paystack inline script in your index.html like so:

  <script src="https://js.paystack.co/v1/inline.js"></script>  

3. Import the module

In your app.module.ts or your working module like so:

import { NgModule } from '@angular/core'; 

import { Angular4PaystackModule } from 'angular4-paystack';
...

@NgModule({
  imports: [
    Angular4PaystackModule,
  ]
})

export class AppModule {}

4. Use the component in your code

There are two available options

  • Paystack Inline - Loads the credit card form in an iframe that appears as a popup

      <angular4-paystack
        [key]="'pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxx'"
        [email]="'mailexample@mail.com'"
        [amount]="5000000"
        [ref]="'2637458697'"
        [class]="'btn btn-primary'"
        (close)="paymentCancel()"
        (callback)="paymentDone($event)"
      >Pay with Paystack</angular4-paystack>
    
  • Paystack Inline Embed - Paystack Inline Embed is the latest addition to the stack, it offers a stylish Inline that loads the credit card form in a set container like it sits in your page.

      <angular4-paystack-embed
        [key]="'pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxx'"
        [email]="'mailexample@mail.com'"
        [amount]="5000000"
        [ref]="'2637458697'"
        [class]="'btn btn-primary'"
        (close)="paymentCancel()"
        (callback)="paymentDone($event)"
      ></angular4-paystack-embed>
    

    NOTE

    • The payment form will be 100% of the width of wherever you put it.
    • To maintain a uniform design, your page's background color should be white

OPTIONS

NameTypeRequiredDefault ValueDescription
amount numbertrueundefinedAmount to withdraw (in kobo for NGN)
email stringtrueundefinedThe customer's email address.
keystringtrueundefinedYour pubic Key from Paystack. Use test key for test mode and live key for live mode
refstringtrueundefinedUnique case sensitive transaction reference. Only -,., = and alphanumeric characters allowed.
callbackfunctiontrueundefinedA function called when transaction is successful. Returns an object containing unique reference
metadataobjectfalse{}custom details
classstringfalseundefinedA string of classes to add to the component (not available for inline embed)
styleobjectfalseundefinedCSS stylings, eg {fontColor: 'red'} (not available for inline embed)
textobjectfalseundefinedText output of the component
currencystringfalse"NGN"Transaction currency
planstringfalse""If transaction is to create a subscription to a predefined plan, provide plan code here.
quantitystringfalse""Used to apply a multiple to the amount returned by the plan code above.
onClosefunctionfalseundefinedA function called if the customer closes the payment window
For Split Payments
subaccountstringfalse""The code for the subaccount that owns the payment.
transaction_chargenumberfalse0A flat fee to charge the subaccount for this transaction, in kobo.
bearerstringfalse""Who bears Paystack charges? account or subaccount

For more information checkout paystack's documentation

Contributing

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

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or anywhere? Spread the word!

Don't forget to follow me on twitter!

Thanks! Ashinze Ekene.

License

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

Keywords

FAQs

Package last updated on 02 Dec 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc