Skip to content

Instantly share code, notes, and snippets.

@rohittagadiya
Last active August 16, 2021 17:02
Show Gist options
  • Save rohittagadiya/be3bd1e9f41f7ff92634515531d3e195 to your computer and use it in GitHub Desktop.
Save rohittagadiya/be3bd1e9f41f7ff92634515531d3e195 to your computer and use it in GitHub Desktop.
Initialize fastspring popup
import { HostListener } from '@angular/core';
import { Component, OnInit } from '@angular/core';
declare var fastspring: any;
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
@HostListener('window:onFSPopupClosed', ['$event.detail'])
onFSPopupClosed(detail) {
console.log(detail)
if (detail && detail.orderReference && detail.orderReference.id) {
// Payment done successfull
}
}
constructor() {}
popupStoreFront(itemIdentifier: string): void {
fastspring.builder.push({
reset: true,
products: [
{ path: 'yearly', quantity: 1 }
],
checkout: true,
tags: {
emailId: '[email protected]',
userId: 'HJS678HJ'
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment