Skip to content

how to get the getdata js data in the backend like observer in magneto 2

define(["Magento_Checkout/js/view/payment/default", "jquery"], function (Component,$) {
    "use strict";
    return Component.extend({
        defaults: {
            template: "Test_Payments/payment/testpay",
        },

        getData: function () {
            return {
                method: this.item.method,
                additional_data: {
                    iban: $.trim($('#data1').val()),
                    bic: $.trim($('#data2').val())
                }
            };
        }
    });
});