"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ga4_functions_1 = require("../ga4-functions");
const ga4_properties_1 = require("../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: { ...ga4_properties_1.user_id },
        currency: { ...ga4_properties_1.currency },
        value: { ...ga4_properties_1.value },
        coupon: { ...ga4_properties_1.coupon },
        payment_type: { ...ga4_properties_1.payment_type },
        items: {
            ...ga4_properties_1.items_multi_products,
            required: true
        },
        user_properties: ga4_properties_1.user_properties,
        params: ga4_properties_1.params
    },
    perform: (gtag, { payload }) => {
        ga4_functions_1.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
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map