Jump to content

AddonConfig hook on payment gateway custom module -- not working?


jlcbada

Recommended Posts

Hey guys..

anyone tried AddonConfig here? seems not working on my end.

it goes like this:

I created a custom Payment gateway named "foobar" (for example)the structure of my files goes like this:
 

+ /modules/
   + /gateways/
    + /foobar/
     + /hooks.php
    /foobar.php


my hooks.php goes like:
 

add_hook('AddonConfig', 1, function($vars) {
        return [
            'Additional Field 1' => '<input type="text" name="additionalFieldOne" class="form-control input-150" />',
            'Additional Field 2' => '<input type="text" name="additionalFieldTwo" class="form-control input-150" />',
        ];
});

 

what im trying to do is add custom config type fields in foobar_config()

initally types are only limited to: Text, Password, Yes/No Checkboxes, Dropdown Menus, Radio Buttons, Text Areas

I want to add more.. for example: a button

also is there a way to add custom javascript in editing the module file itself (foobar.php)?

something needs to happen(for example: ajax) when that button is clicked -- I need javascript(jquery) to handle that

if my flow is wrong, or there is any other sort of flow to handle this things?

any thoughts?

 

Link to comment
Share on other sites

I believe that there is misunderstanding here,

1) gateway modules structure is like that:

# the main file responsible for (gateway configuration, pay now button, etc): /modules/gateways/foobar.php

# callback file: /modules/gateways/callback/foobar.php

2) you can't change this structure by adding these files inside sub-directory (like in addon modules)

3) hooks.php file doesn't exists under /modules/gateways directory, if your gateway module require ActionHooks place your file inside /includes/hooks/ directory instead.

4) this ActionHook:AddonConfig belong to service addons

correct me if I'm wrong with any of the above!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated