JSPM

@fireflysemantics/angular-stripe-service

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 358
  • Score
    100M100P100Q101351F
  • License MIT

Package Exports

  • @fireflysemantics/angular-stripe-service
  • @fireflysemantics/angular-stripe-service/package.json

Readme

Angular Stripe Service

Stripe service for for Angular components that use stripe.

Usage

  constructor(
    private cd: ChangeDetectorRef,
    private stripeService:AngularStripeService) {}

  ngAfterViewInit() {
    this.stripeService.setPublishableKey('pk_test_2syov9fTMRwOxYG97AAXbOgt008X6NL46o').then(
      stripe=> {
        this.stripe = stripe;
    const elements = stripe.elements();    
    this.card = elements.create('card');
    this.card.mount(this.cardInfo.nativeElement);
    this.card.addEventListener('change', this.cardHandler);
    });
}

Stackblitz Demo

https://stackblitz.com/edit/angular-stripe-integration?file=src%2Fapp%2Fapp.component.ts