ng-stripe
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

NgStripe

This library was generated with Angular CLI version 8.2.4. This is a simple stripe payment gateway libray. We have not used styles, you can change the card layout as your own. Demo

Features!

  • Easy to use
  • Card validation
  • less code to get response json

Installation

$ npm i ng-stripe 

Import NgStripeModule in your module.ts file ( app.module.ts file )

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { NgStripeModule } from 'ng-stripe';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgStripeModule
  ],
  providers: [
	  
	],
  bootstrap: [AppComponent]
})
export class AppModule { } 

Configuration

Add below code in your .html file

<lib-ng-stripe apiKey="pk_test_Pj5AIAyJnj8lafRKnF1gC5wY" apiSecret="sk_test_hj06rZIyHdrs9etIqk7pSVax" totalAmount="10" currency="USD" stripeBtnText="pay" stripeBtnLoading="Loading.." orderId="25"  email="user@example.com"  (apiResponse)="paymentChange($event)"></lib-ng-stripe>

Add below code in your .component.ts file

paymentChange(data) {
  console.log(data); // you can receive both success and resposonse data here 
}

Available Options

Options Description
apiKey Stripe Publishable key
apiSecret Stripe Secret key
totalAmount Final Amount
currency Supported currencies View All
stripeBtnText Paynow Button Text, Default text is Pay Now
stripeBtnLoading Loading button text, Default text is Please Wait..
orderId It will be passed with Stripe desription
email It will be passed with Stripe desription
apiResponse All success and error data will received here

Donate!

Like my Work! Donate

Package Sidebar

Install

npm i ng-stripe

Weekly Downloads

0

Version

0.0.4

License

none

Unpacked Size

168 kB

Total Files

23

Last publish

Collaborators

  • libinprasanth