Jump to content
  • 0

How To Build A Post Request When Invoices Paid And Pay For A Service


Question

Posted

Hi,

 

I want to achieve this function.

 

When invoice payment is successful, and is pay for a service. Then post a json data to my other php url, like this {"client_id":1,"invoice_id":9,time:"2015-09-15 10:14:33",amount:"","service_id":13}

 

How can this be achieved?

2 answers to this question

Recommended Posts

  • 0
Posted

Sounds like you may need to tie into the GatewayPayments component where a payment is deemed successful, determine whether any invoices were directly paid, then determine the services on those invoices, then make a post request to your URL.

  • 0
Posted

You can look at two different events (you'll need to create a plugin that can listen for these events).

 

One of the following:

  1. Transactions.add
  2. Invoices.setClosed

 

The first is triggered when a transaction is added. The second is triggered when an invoice is closed, which happens when it's paid. Sounds like you'd want to go with #2

Join the conversation

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

Guest
Answer this question...

×   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.

Loading...
×
×
  • Create New...