I have searched and researched time after time on how to develop WHMCS gateway module and failed again and again.
I have a local Credit card company that provides me with API and allow to use tokens.
I have created a sample module for Credit card payment and it works, now i want to embed Tokens, so what i did is after the client pays with a credit card for the first time, im using capsule to save the token and expiration date to the database.
so far so good, and everything works. now when invoice creates i want to make a charge for the client automatically , so ive used the hook before CC and i am able to charge the client using token, however as im not using it via "payment gateway" but via a hook, i dosnt add transaction , convert the invoice to paid and still emails the client that he needs to pay.
so what exactly am i missing here ?