Jump to content

Custom Payment Gateway: verifying paid amount and invoice amount


afanen01

Recommended Posts

Hi,

 

I am making a custom payment gateway module, and I need a way for the callback to be able to compare the paid amount as returned by the gateway with the invoiced amount in the database before marking the invoice as paid.

 

How can I accomplish this? I don't know how to query for the invoice records from the database.

 

Thanks in advance.

Link to comment
Share on other sites

I need a way for the callback to be able to compare the paid amount as returned by the gateway with the invoiced amount in the database before marking the invoice as paid.

 

How can I accomplish this? I don't know how to query for the invoice records from the database.

 

 

Well :)

 

Basically, you are going to need to wait until you get the invoice number back from the gateway requesting your callback. If you do not receive one, then you will need to do a couple of tricks to work out the invoice number.

 

If you do have the inv#, just do a simple MySQL select:

SELECT * from `tblinvoices` where `id`={$invoiceid}

 

If not, then you will need to do a few more tricks to work out the invoice number (and you will need to know the client id :/)

 

Once you have done the above SQL query, there is a column called 'total'. Simply compare this with the amount provided by the callback :)

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

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

Guest
Reply to this topic...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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