Jump to content

brianoz

Member
  • Content Count

    561
  • Joined

  • Last visited

Community Reputation

1 Neutral

About brianoz

  • Rank
    Level 2 Member

Recent Profile Visitors

1195 profile views
  1. If you use hook code to define a function, that function will never be called unless you either call it in the same file, or use a module hook. In your code, you define a function but it is never called. Pretty sure here that you've misunderstood how module hook code works. The file is read, and it defines functions which are then connected via add_hook() calls. No sweat, this is complex if you're not used to it. 🙂
  2. Looks like you left out the add_hook() call to actually cause the hook to be added somewhere. As you have it, you're defining a function but it never gets called. add_hook("InvoiceCreation", 9999, "preXeroSync"); except that the hook on which you want this to run probably isn't InvoiceCreation, so you'll need to work out what the correct hook name is for your code to work.
  3. The commit causes the changes made by localAPI to become permanent. Changes made after beginTransaction() are otherwise just temporary. If you left out the beginTransaction() method call it would also work. The idea of using a transaction is that changes are rolled back if something goes wrong, and the assumption is that things did go wrong if you don't call the commit() method.
  4. Also, worth adding a logActivity() call when there's a failure, like: logActivity("FAILED xyz - results are: " . print_r($results, 1)); At the moment you just have a log entry on success. Having log errors on failure might help you work out the problem. If you don't get an activity log error at all, that probably means your file isn't running. Make sure the file is mode 644 (rw-r--r--) and ends in .php. I'd also be checking for error log files being created, usually in the admin folder - they're always called "error_log", The following command can find those files anywhere on your site, if you change directory to be in the root of your WHMCS folder tree: find . -name error_log -print
  5. I'd start by checking the file for syntax errors. Also worth changing logactivity to logActivity - case does matter in PHP, though WHMCS might have a logactivity function defined to protect you from errors.
  6. You're missing committing the transaction at the end, just before you finish, so mysql is rolling all your changes back! $pdo->commit();
  7. What do you mean by "not working"? What are the error messages? Usually hook code has to be installed in a file somewhere. Where did you put this code?
  8. Our Collingwood premises, circa 2012
  9. This is Goose. His main job was assessing credit risk; if Goose didn't like someone, they didn't get credit! He was always right!! 😎
  10. Sorry - just to expand - can't find anything online. I've looked at the available implementations on Github and the payment gateway notes and there's nothing about disputes listed. I've seen the refunds stuff at "Payment Reversal" page in the payment gateway notes and can do that easily enough, but that's not the same thing as a dispute (ie: refunds trigger the Payment Reversal; a dispute may not yet have an associated refund, if I'm correct). Many thanks... living in hope ...
  11. In very general terms, API documentation is something that even much larger companies struggle with, it's one of the most difficult areas to get right. One example is Google - fantastic, powerful API but some parts of it can be just so very hard to work with and the doco can be absolutely inscrutable - if Google struggle to get this right, where does that leave the rest of us. It's not just how things work, it's when they're relevant and how they tie in to other parts as well, that makes it hard. Having said that, I do notice that there's no easy/quick Feedback provision on documentation pages. Often it's just a missing sentence that would make all the difference (often a sense of context is omitted - eg: "you might use this here, to do this, after this happens" and being able to provide some of this feedback might help make the difference for overworked doco writers; it's very hard to be able to fully imagine what a developer might be thinking as they read your documentation, and a simple/quick feedback mechanism allows us to feed back those small missing things. A Git PR isn't a feedback mechanism, unfortunate reality is that most of us won't be able to provide feedback if we can't do it within a few minutes or so, at the time we think of it. I think this might help; just a though to toss in to the large pool of priorities that I'm sure WHMCS is juggling. Good doco leads to good software leads to more investment in WHMCS, and in many cases WHMCS really does have good doco, just missing a few critical points ....
  12. Hi, I'm working on a new payment gateway for a major provider and I'd like to include Dispute handling. The provider has a mature and extensive API which does include Dispute handling endpoints and webhooks (notification). I see that several gateways (Stripe, Paypal) have full dispute handling under the menu Admin >> Billing >> Disputes and would love to add this in for the module I'm working on. Is it possible to get my hands on a sample implementation from somewhere? Or some notes on the calls involved? Even happy to pay for such assistance within reasonable limits. Quite keen to do this as it seems like it would be a useful feature in a complete implementation? Happy to discuss options? Cheers, Brian
  13. Hi all, As it seems to be the thing around here I should introduce myself. I'm an Aussie which means I hang around upside down without realizing it (explains a few things!). About 18 years ago a white English staffy called Goose walked into a kitchen carrying a green frog and I and my brother ended up starting a small webhosting company in Melbourne Australia with a friendly name inspired by said white dog and frog. Dreamweaver and HTML were exciting at the time (2004) and our vision was to try and make simple web tech available and understandable to small business. Ups and downs, this continued until about 2020 when I decided to call it quits and sold the company to another Melbourne-based host whom I respect greatly. Learnings and humblings were way too many to list here, but one was that most small businesses don't make it through the first few years, so clientele constantly turns over. Perhaps the second major learning was that we became a "second host" for many - we got so used to rescuing people, from even local big name hosts, when they had problems. Another very major and personal learning point was that if you're a hard-core introvert, don't put yourself into an extrovert's job as you'll set yourself up for burnout and becoming a temporary wreck after a while (this is something that I've noticed happens to a lot of host owners over time). At our peak in Collingwood, we had 7 local staff and 2 overseas developers, and around 2,000 customers-ish. We had some real luck with our team and enjoyed working as a cohesive and positive place to work (sometimes harder on me than I realized!). Before becoming a host, my background was Unix sysadmin and I'd spent much of the previous 20 years working for our Fortune 100 companies, starting as a C developer, then technical lead, and ending up as a sysadmin and security trainer. I worked for one of the big banks, telcos, and Defence and trained sysadmins as well as doing some project troubleshooting for an enterprise computing group, some of this overlapping my hosting time as well. I taught coding (C, shell and Perl!) as well as some security and sysadmin topics professionally for a number of staff training groups. I've always loved programming and am very much enjoying returning to the fold as a coder to try and make some things that hopefully people find useful and cool. For some weird reason, I quite like PHP (it's fast, easy to host, and quick to code and prototype in), so I've ended up developing WordPress plugins for cinema applications, and now, all going well, a payment gateway for WHMCS. Perhaps strangely, I find coding quite therapeutic, a little like knitting. One of my favourite things is travel, which Covid prevented, but as a hobby, I ended up joining a small group of people running a charity that helps LGBT refugees in Kenya (in Kakuma, one of the world's largest refugee camps). We help them by providing some food and medical help as well as other types of support, including repatriation and some attempts towards self-sufficiency (difficult in a desert camp). I'm hoping to provide a little income towards that charity from some of my work projects; I find giving helps keep me both real and grateful for the grace with which I've been provided. I'm also hugely fond of dogs, and burning new things on the stove. Anyway, this is probably oversharing, but glad to be around again. It's really heartening to see some wise old(er) timers around whose usernames I recognize! Cheers all! Brian
  14. You would have to save the email somehow (in a temporary file or database table) then come back and send it later. I don't know of any built-in way to do that, sorry, I suspect you'll need to write some code. It is possible there's a module somewhere for this. Mailchimp will send delayed emails after signup. If I'm right in thinking you want to send something after signup is done, hoping it's more likely to be read, I'd think a longer delay might work better. Mailchimp can be setup to send a series of emails, which might be helpful - basically you can send emails answering questions people might have after a day or so, or things they should remember to do. You could also advertise services in these, but for the emails to be seen as helpful they do need to have some sort of useful advice, not just be a product ad.
  15. You might be able to get some traction with a URL for the image source that mentions the group name or ID. So <img src="{$company_logo_url} above would become something like: <img src="https://yourwebsite.com/logo/{$client_group_id}.jpg"> Another easy trick would be to make the logo file into a .php file and have that output the appropriate image. That should be relatively easy, you'd have to pass the group id as a parameter though. This also makes for easy defaults for new groups and if no group is specified. Bear in mind that some email services may filter this out (looks spammy), so I'm not certain how well it would work in practice, but it's worth a go. (If it fails, you could probably also use a .htaccess file to get a .jpg to run as a .php file, so long as you make sure that's in a subfolder; though this is getting well towards evil hacking skills). Cheers Brian
×
×
  • 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