@malga-checkout/core
Version:
Core components for Malga Checkout
21 lines (18 loc) • 467 B
JavaScript
import { c as createStore } from './settings-00efd3d2.js';
const { state, onChange } = createStore({
selectedPaymentMethod: '',
isSelectedSavedCard: false,
cvv: '',
installments: '',
cardId: '',
chargeId: '',
paymentUrl: '',
});
onChange('selectedPaymentMethod', (value) => {
state.cvv = '';
state.cardId = '';
state.installments = '';
state.paymentUrl = '';
state.isSelectedSavedCard = value.includes('credit-');
});
export { state as s };