Jump to content

Individual Payment Method - Invoice ID Not Found


Recommended Posts

Hi,

 

i have create a Payment Gateway and the Callback doesnt work...

 

I connect to the URL: http://mysite.de/modules/gateways/callback/c2p.php?title=229&amount=5000&invoice_id=229&function=billing

 

 

The Callback Code:

<?php

# Required File Includes
include("../../../dbconnect.php");
include("../../../includes/functions.php");
include("../../../includes/gatewayfunctions.php");
include("../../../includes/invoicefunctions.php");

$gatewaymodule = "c2p"; # Enter your gateway module name here replacing template

$GATEWAY = getGatewayVariables($gatewaymodule);
if (!$GATEWAY["type"]) die("Module Not Activated"); # Checks gateway module is active before accepting callback

# Get Returned Variables - Adjust for Post Variable Names from your Gateway's Documentation
$invoice_id = $_POST["c2p_invoice_id"];
$amount = $_POST["c2p_amount"];
$function = $_POST["c2p_function"];


$invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY["name"]); # Checks invoice ID is a valid invoice number or ends processing

checkCbTransID($transid); # Checks transaction number isn't already in the database and ends processing if it does

if ($function=="billing") {
   # Successful
   addInvoicePayment($invoice_id,$amount,$gatewaymodule); # Apply Payment to Invoice: invoiceid, transactionid, amount paid, fees, modulename
logTransaction($GATEWAY["name"],$_POST,"Successful"); # Save to Gateway Log: name, data array, status
} else {
# Unsuccessful
   logTransaction($GATEWAY["name"],$_POST,"Unsuccessful"); # Save to Gateway Log: name, data array, status
}

?> 

Please Help Me!

 

sixonenine

Link to comment
Share on other sites

Your passing the variables on the URL so you need to use $_GET instead of $_POST or you can use $_REQUEST which will cover both.

 

e.g.

$invoice_id = $_REQUEST["c2p_invoice_id"];
$amount = $_REQUEST["c2p_amount"];
$function = $_REQUEST["c2p_function"];

Link to comment
Share on other sites

  • 5 months 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