1

I have some Charge payments on my website, and I have registered the onCharge event in my plugin, like so:

public function init()
{
    parent::init();
    craft()->on('charge.onCharge', function(Event $event) {
        // Function logic here
    }
}

And 95% of the time it works, but sometimes it doesn't trigger. The transaction goes through, and I can see in my Stripe account that it has been successful, but the payment does not appear in my Charge Logs in Craft, and the onCharge event never triggers.

Can anyone help? Any suggestions?

Thanks, Jai

1 Answer 1

1

At first glance I cannot tell you why your plugin runs intermittently. But if your plugin is interacting with Charge, there are some log functions you can use that may be helpful.

craft()->charge_log->email("yada yada");
craft()->charge_log->note("yada yada");
craft()->charge_log->error("yada yada");
1
  • Thanks for that, but since the onCharge event is not triggering in these cases, theres nothing that I would really want to log. And its not being added to the Charge logs, so it's not just my plugin isn't working - it looks like Charge isn't receiving the information that the payment has gone through.
    – Jai Redden
    Commented Feb 12, 2019 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.