Jump to content

Gateway not being called on capture or storeremote from WHMCS


gbrennae

Recommended Posts

I'm having a very weird issue when trying to capture a payment or add/delete/update a token using my gateway module I've developed for the InternetSecure gateway.

 

For some odd reason when I try to interact with the module in any way whmcs it doesn't even call the module or include it for that matter. It is set to be the default payment method for each of the clients and it's active in the gateway setup page with all the correct configuration. I know it isn't including the module because I have a logging function that tells me every time the script has been loaded by whmcs.

 

If I go into a client account and click "credit card information" link up pops the window to enter the info. I do that and click save and it stores the card info into the database it doesn't even call my module. I have a _storeremote function and everything has been working to this point. It just stopped all of a sudden. No errors are shown and I can't see how it could be my module causing the problem if it's not even being loaded except in the gateway config page.

 

Anybody have any ideas?

Link to comment
Share on other sites

Thanks Frank but no luck.. I submitted a ticket to whmcs support because it's very bizarre. I'm convinced it's a bug with whmcs just not sure how I got there cause now my dev system is in this weird state and random changes in client account will make it work or not work.

 

I got it to work for some clients... Only after creating an invoice against their account.

 

I deactivated all the payment gateway modules in the gateway config. And then re-activated my module. No Luck

I created another contact for an existing client and voila it used my module _storeremote function. Ok... Not sure why?

Tried to do the same thing by adding a contact to another account and it didn't work.

 

Then I added an invoice to that same client that it didn't work just a second ago for and it started working again using my module and the _storeremote function.

 

So it seems that somehow when I create an invoice it resets some field or something in the clients account and then everything works again. If I delete all invoices for a client then I'm back where I started and the _storeremote function isn't called.

 

When I create multiple invoices, as long as one of them is assigned to use my module with the _storeremote, then updating credit card info from the Admin works fine, but processing a payment against that invoice does not even if I've previously added the credit card info to the account, the correct gateway is selected and a token is setup and stored in the client account. The gateway is set correctly on the invoice and invoice gets marked as paid but the payment is not processed through the gateway nor is the module called at all. Doesn't matter what options I select.

 

Payment of invoice seems to work fine through client area.

Link to comment
Share on other sites

Thanks Frank but no luck.. I submitted a ticket to whmcs support because it's very bizarre. I'm convinced it's a bug with whmcs just not sure how I got there cause now my dev system is in this weird state and random changes in client account will make it work or not work.

 

I got it to work for some clients... Only after creating an invoice against their account.

 

I deactivated all the payment gateway modules in the gateway config. And then re-activated my module. No Luck

I created another contact for an existing client and voila it used my module _storeremote function. Ok... Not sure why?

Tried to do the same thing by adding a contact to another account and it didn't work.

 

Then I added an invoice to that same client that it didn't work just a second ago for and it started working again using my module and the _storeremote function.

 

So it seems that somehow when I create an invoice it resets some field or something in the clients account and then everything works again. If I delete all invoices for a client then I'm back where I started and the _storeremote function isn't called.

 

When I create multiple invoices, as long as one of them is assigned to use my module with the _storeremote, then updating credit card info from the Admin works fine, but processing a payment against that invoice does not even if I've previously added the credit card info to the account, the correct gateway is selected and a token is setup and stored in the client account. The gateway is set correctly on the invoice and invoice gets marked as paid but the payment is not processed through the gateway nor is the module called at all. Doesn't matter what options I select.

 

Payment of invoice seems to work fine through client area.

 

That sounds like the default gateway for the account was set to something else. If they previously had another gateway setup on their account, it will use that instead when trying to save the CC data not linked to an invoice. When paying an invoice, you have the ability to select the gateway, when updating the CC from the client area, you do not.

 

check to see what the default gateway is set to for the "broken" accounts with the following query.

 

SELECT defaultgateway FROM tblclients WHERE id=[b]CLIENTID[/b]

 

(replace CLIENTID with the ID of the problematic account)

 

Hope this helps.

Link to comment
Share on other sites

Ok so I narrowed it down a bit more. Seems that setting the default payment method has no effect whatsoever on whether the module gets called or not when you update credit card details in the admin.

 

Setting the payment method on at least one invoice DOES invoke a call to the storeremote function when updating the card information through the admin but I still cannot process a payment using "Add Payment" on the invoice even after a token has been created and stored and the payment method for the invoice is set to my module.

 

I did eventually get it to work though... If the invoice is associated with an order which has its payment method set to the module with storeremote funtion when you attempt a capture using "Add Payment" in the admin it works.

 

This doesn't seem right but maybe? You can't just create a invoice and charge a token unless it has an order associated with it? That can't be right...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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