import { updateUser } from '../ga4-functions';
import { user_id, user_properties, currency, value, coupon, payment_type, items_multi_products, params } from '../ga4-properties';
const action = {
    title: 'Add Payment Info',
    description: 'Send event when a user submits their payment information',
    defaultSubscription: 'type = "track" and event = "Payment Info Entered"',
    platform: 'web',
    fields: {
        user_id: { ...user_id },
        currency: { ...currency },
        value: { ...value },
        coupon: { ...coupon },
        payment_type: { ...payment_type },
        items: {
            ...items_multi_products,
            required: true
        },
        user_properties: user_properties,
        params: params
    },
    perform: (gtag, { payload }) => {
        updateUser(payload.user_id, payload.user_properties, gtag);
        gtag('event', 'add_payment_info', {
            currency: payload.currency,
            value: payload.value,
            coupon: payload.coupon,
            payment_type: payload.payment_type,
            items: payload.items,
            ...payload.params
        });
    }
};
export default action;
//# sourceMappingURL=index.js.map