Issues (1149)

1
<?php
2
/*
3
* ipn.php
4
*
5
* PHP Toolkit for PayPal v0.51
6
* http://www.paypal.com/pdn
7
*
8
* Copyright (c) 2004 PayPal Inc
9
*
10
* Released under Common Public License 1.0
11
* http://opensource.org/licenses/cpl.php
12
*
13
*/
14
include __DIR__ . '/header.php';
15
require_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php';
16
$myts = MyTextSanitizer::getInstance();// MyTextSanitizer object
17
18
require_once __DIR__ . '/class/class.subscription.php';
19
20
$eh = new ErrorHandler;
21
//get global configuration information
22
require_once __DIR__ . '/paypal_includes/global_config.inc.php';
23
24
//get pay pal configuration file
25
require_once __DIR__ . '/paypal_includes/config.inc.php';
26
27
//decide which post method to use
28 View Code Duplication
switch ($paypal['post_method']) {
29
30
    case 'libCurl': //php compiled with libCurl support
31
32
        $result = libCurlPost($paypal['url'], $_POST);
33
34
        break;
35
36
    case 'curl': //cURL via command line
37
38
        $result = curlPost($paypal['url'], $_POST);
39
        //print_r($result);
40
        break;
41
42
    case 'fso': //php fsockopen();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
43
44
        $result = fsockPost($paypal['url'], $_POST);
45
        //print_r($result);
46
        break;
47
48
    default: //use the fsockopen method as default post method
49
50
        $result = fsockPost($paypal['url'], $_POST);
51
        //print_r($result);
52
        break;
53
54
}
55
56
//check the ipn result received back from paypal
57
58
if (eregi('VERIFIED', $result)) {
59
    // Automatic update of the subscription is not yet included in the success page.
60
    // This will need to be done manually.
61
    require_once __DIR__ . '/ipn/ipn_success.php';
62
} else {
63
    require_once __DIR__ . '/ipn/ipn_error.php';
64
}
65