souzadavi Posted March 27, 2019 Share Posted March 27, 2019 Hello I created a payment module from this information: https://developers.whmcs.com/payment-gateways/third-party-gateway/ I created the callback file. But from this way all of my payments should be confirmed in time of payment, not later... There is any possibilite to call the callback later? Was so good if there is anyway to call the callback from the button try to capture in invoice admin. . thanks 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 27, 2019 Share Posted March 27, 2019 (edited) If you want the pay now button to charge the card when the pay now button is hit, you need to implement the merchant style gateway . If the gateway you're using uses a javascriipt for example to take payment information on their side, you would use the _remoteinput function. however, due note that currently WHMCS changes all forms you return in _remoteinput so that it posts to a 3dauth iframe and this can cause odd behavior like an additional tab / window being open in the browser. (at least it has for me) Support has confirmed that there is no other option for this and can not override that behavior and removing the target on the forms or using an addon module instead is required. More information on what gateway you are using would help. EDIT: with that said, if the gateway supports callbacks, using those would give you the same results but you may have to do a ajax call on the creditcard page to see if the payment has been done. Edited March 27, 2019 by steven99 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted March 27, 2019 Author Share Posted March 27, 2019 @steven99 when the user hit the pay button I send the user to the bank page to insert the debit card password and after filled up the password, the bank send the user back to my invoice page sometimes the status of this payment come like "waiting" not all the time, just sometimes, here is the deal, because I need check it back again in couple minutes, and the bank doesnt have a payment notification service or something similar, I need get the payment ID that I saved from the json bank return and check in the bank if the status changed to paid. The deal is how and when I do this check. The button from admin invoice (try to capture) was fine because there is not a lot invoice paid on this method, automatic check should be awesome but I really don't have a clue to how to do it from nice way to not waste too much resource from server. Any information will be great!!! Ps.: I just created the module, the name is Brazilian debit card (cartão de débito pro Brasil). thanks for your reply 🙂 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 27, 2019 Share Posted March 27, 2019 (edited) So to confirm, they have no callback / notification service when the payment has cleared their side and you need to use an API of theirs to check the status, is that correct? If so, the best way I can think of doing that is: When they return the client to your system, set the invoice status as payment pending. Save the json transaction id to the invoice Use a cron to check invoices in payment pending status and use the transaction ids to pull from the bank and get their current status I thought there was a hook for just the normal cron running but did not see it so your own file that has similar setup as a custom page would be needed Once you have the paid status, set the invoice to paid. Edited March 27, 2019 by steven99 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.