Skip to content

Instantly share code, notes, and snippets.

@Komock
Last active September 21, 2018 14:49
Show Gist options
  • Save Komock/91097c803a0dcef336820e71239ff4df to your computer and use it in GitHub Desktop.
Save Komock/91097c803a0dcef336820e71239ff4df to your computer and use it in GitHub Desktop.
some
private handleConfirmationSuccess(methodId: string) {
this.paymentsService.pollPaymentMethodCreated(methodId).pipe(
mergeMap(methodId => this.paymentsService.setDefaultPaymentMethod(methodId)),
mergeMap(methodId => forkJoin(of(methodId), this.paymentsService.fetchPaymentMethods())),
tap((data) => {
const id = data[0];
this.paymentsService.paymentMethods.defaultMethod = this.paymentsService.paymentMethods.getPaymentMethod(id);
this.routerDataStorage.set({ paymentMethodCreated: PaymentGatewayTypes.CARD });
this.router.navigate(['../../../'], {
relativeTo: this.route,
replaceUrl: true,
});
})
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment