0.0.4 • Published 5 years ago

ng-stripe v0.0.4

Weekly downloads
17
License
-
Repository
-
Last release
5 years ago

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

OptionsDescription
apiKeyStripe Publishable key
apiSecretStripe Secret key
totalAmountFinal Amount
currencySupported currencies View All
stripeBtnTextPaynow Button Text, Default text is Pay Now
stripeBtnLoadingLoading button text, Default text is Please Wait..
orderIdIt will be passed with Stripe desription
emailIt will be passed with Stripe desription
apiResponseAll success and error data will received here

Donate!

Like my Work! Donate