-
Notifications
You must be signed in to change notification settings - Fork 0
/
customgatewaycallback.php
executable file
·47 lines (38 loc) · 1.07 KB
/
customgatewaycallback.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
//
// DHRU FUSION PAYMENT GATEWAY DEMO STATES , (EXAMPLE WITH PAYPAL)
//
// Default include files
define("DEFINE_MY_ACCESS", true);
include '../../../comm.php';
require '../../../includes/fun.inc.php';
include '../../../includes/gateway.fun.php';
include '../../../includes/invoice.fun.php';
// Load gateway parameters .
$GATEWAY = loadGatewayModule('customgateway');
// Get Data from Merchnat .
// for e.g. they are sending you in POST
$GETDATA = $_POST ;
// if payment Pending Or Failed (for e.g. merchant sent you with 'status' )
if ($GETDATA['status'] == 'Pending' )
{
logTransaction('customgateway', $_POST , 'Pending');
exit();
}
// Search same transaction id is not repeated again .
if ($GETDATA['TXNID'])
{
if (checkTransID($GETDATA['TXNID']))
{
exit();
}
}
// Find Invoice id in call back POST DATA .
if ($GETDATA['INVOICEID'])
{
// Add payment
addPayment($GETDATA['INVOICEID'], $GETDATA['TXNID'], $GETDATA['AMOUNT'], $GETDATA['FEE'], 'customgateway');
logTransaction('customgateway', $_POST , 'Successful ');
exit();
}
?>