Skip to content

Commit

Permalink
Merge pull request #17 from Adyen/bugfix/AD-312
Browse files Browse the repository at this point in the history
AD-312 Saved cards are copied from one account to another
  • Loading branch information
pjaneta authored Sep 17, 2024
2 parents ceef451 + 9588830 commit 829a17c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion projects/adyen-payments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adyen-payments",
"version": "0.3.0",
"version": "0.3.1",
"scripts": {
"prebuild": "npm version patch -m \"Upgrade to %s for build\"",
"build": "ng build && tsc -p tsconfig.schematics.json",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Injectable} from "@angular/core";
import {combineLatest, Observable, switchMap} from "rxjs";
import {AdyenConfigData} from "../core/models/occ.config.models";
import {OCC_USER_ID_ANONYMOUS, Query, QueryNotifier, QueryService, QueryState, UserIdService} from "@spartacus/core";
import {LoginEvent, LogoutEvent, OCC_USER_ID_ANONYMOUS, Query, QueryNotifier, QueryService, QueryState, UserIdService} from "@spartacus/core";
import {filter, map, take} from "rxjs/operators";
import {ActiveCartFacade} from "@spartacus/cart/base/root";
import {CheckoutAdyenConfigurationReloadEvent} from "../events/checkout-adyen.events";
Expand All @@ -25,6 +25,7 @@ export class CheckoutAdyenConfigurationService extends AdyenBaseService {
switchMap(([userId, cartId]) => this.checkoutConfigurationConnector.getCheckoutConfiguration(userId, cartId))
), {
reloadOn: this.getCheckoutAdyenConfigurationLoadedEvents(),
resetOn: [LoginEvent, LogoutEvent]
}
);

Expand All @@ -39,11 +40,5 @@ export class CheckoutAdyenConfigurationService extends AdyenBaseService {
fetchCheckoutConfiguration(userId: string, cartId: string): Observable<AdyenConfigData> {
return this.checkoutConfigurationConnector.getCheckoutConfiguration(userId, cartId);
}

getCheckoutConfiguration(): Observable<AdyenConfigData | undefined> {
return this.getCheckoutConfigurationState().pipe(
filter((state) => !state.loading),
map((state) => state.data)
);
}

}

0 comments on commit 829a17c

Please sign in to comment.