-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginProtxformCallback.php
More file actions
45 lines (36 loc) · 1.49 KB
/
PluginProtxformCallback.php
File metadata and controls
45 lines (36 loc) · 1.49 KB
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
<?php
require_once 'modules/admin/models/PluginCallback.php';
require_once 'modules/billing/models/class.gateway.plugin.php';
require_once 'plugins/gateways/protxform/functions.php';
class PluginProtxformCallback extends PluginCallback
{
function processCallback()
{
// ignore the request
if (!isset($_REQUEST['crypt'])) {
return;
}
$crypt = $_REQUEST['crypt'];
$cPlugin = new Plugin("0", 'protxform', $this->user);
$Decrypt_Password = $cPlugin->GetPluginVariable("plugin_protxform_Crypt Password");
$Decoded = SimpleXor(base64Decode($crypt),$Decrypt_Password);
$values = getToken($Decoded);
$lInvoiceID = $values['VendorTxCode'];
$lInvoiceID = mb_substr($lInvoiceID, 0, strpos($lInvoiceID, "D"));
$lErrorCode = ""; //For Future Use
$lPricePaid = $values['Amount']; //For Future Use
$cPlugin = new Plugin($lInvoiceID, 'protxform', $this->user);
$cPlugin->setAmount($lPricePaid);
$cPlugin->setAction('charge');
if(isset($_GET['fail']) && $_GET['fail'] == 1){
// Failed payment
$cPlugin->PaymentRejected($lErrorCode);
}elseif(isset($_GET['success']) && $_GET['success'] == 1){
// Passed payment
$cPlugin->PaymentAccepted($lPricePaid);
}
//users coming from protx need to be redirected to invoicing
$cPlugin->ForwardUser();
}
}
?>