@malga-checkout/core
Version:
Core components for Malga Checkout
18 lines (17 loc) • 527 B
JavaScript
import { CustomerCards } from '../../../../services/customer-cards';
import savedCards from '../../../../stores/saved-cards';
import settings from '../../../../stores/settings';
export class MalgaPaymentsCreditSavedCardsService {
constructor() {
this.customerCards = new CustomerCards();
}
async listSavedCards() {
try {
const cards = await this.customerCards.list(settings.transactionConfig.customerId);
savedCards.cards = cards.data;
}
catch (err) {
savedCards.cards = [];
}
}
}