Forum

Custom code during payments

Posted in CategoryDevelopment
  • Kushal
    Kushal Patel   ( User ) 8 months ago

    Hi there,

    I'd like a bit of assistance if possible;

    I'd like to add a custom function (slack notification) when a payment is being entered.

    Could you point me to the correct location (php file) where I could throw this in? I dont mind it being hardcoded for now.

  • Denis
    Denis Duliçi   ( Admin ) 7 months ago

    Hello,

    You should listen to the App\Events\InvoicePaid event.

  • Kushal
    Kushal Patel   ( User ) 7 months ago

    Thanks.

    Correct path that worked was app/Http/Controllers/Incomes/Invoices.php

  • Denis
    Denis Duliçi   ( Admin ) 7 months ago

    You should not hack the core files, all changes will be lost after update. Instead, you should listen to the event I referred to.

  • Kushal
    Kushal Patel   ( User ) 7 months ago

    True, core files shouldn't be touched, I'll have to update them with each of your updates, because I cannot figure out how else to get it working.

    Any code I put into the /App/events/invoicepaid didn't seem to run at all.

    Or I don't know how to use this file. I'm just running a simle curl line, but it wasn't triggering. Any advice on that?

     

Please login or register to leave a response.