1 | <?php |
||
2 | /* |
||
3 | * config.inc.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 | |||
15 | $vars = array( |
||
16 | 'item_name', |
||
17 | 'item_number', |
||
18 | 'receiver_id', |
||
19 | 'item_name', |
||
20 | 'item_number', |
||
21 | 'on1', |
||
22 | 'os1', |
||
23 | 'on0', |
||
24 | 'on1', |
||
25 | 'tax', |
||
26 | 'quantity', |
||
27 | 'invoice', |
||
28 | 'firstname', |
||
29 | 'lastname', |
||
30 | 'address1', |
||
31 | 'address2', |
||
32 | 'city', |
||
33 | 'state', |
||
34 | 'zip', |
||
35 | 'email', |
||
36 | 'phone1', |
||
37 | 'phone2', |
||
38 | 'phone3', |
||
39 | 'custom', |
||
40 | 'amount' |
||
41 | ); |
||
42 | |||
43 | $paypal = array(); |
||
44 | |||
45 | View Code Duplication | foreach ($vars as $k => $v) { |
|
0 ignored issues
–
show
|
|||
46 | if (isset($_POST[$v])) { |
||
47 | $paypal[$v] = "$_POST[$v]"; |
||
48 | } else { |
||
49 | $paypal[$v] = ''; |
||
50 | } |
||
51 | } |
||
52 | |||
53 | //Configuration Settings |
||
54 | $paypal['business'] = $xoopsModuleConfig['paypal_business_mail']; |
||
55 | $paypal['site_url'] = '' . XOOPS_URL . '/modules/' . $moddir . '/'; |
||
0 ignored issues
–
show
|
|||
56 | $paypal['image_url'] = ''; |
||
57 | $paypal['success_url'] = 'ipn.php'; |
||
58 | //$paypal[success_url]="php_paypal/ipn/ipn.php"; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
72% 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. ![]() |
|||
59 | $paypal['cancel_url'] = 'ipn.php'; |
||
60 | $paypal['notify_url'] = 'ipn.php'; |
||
61 | $paypal['return_method'] = '2'; //1=GET 2=POST |
||
62 | $paypal['currency_code'] = 'EUR'; //[USD,GBP,JPY,CAD,EUR] |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
55% 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. ![]() |
|||
63 | $paypal['lc'] = 'US'; |
||
64 | |||
65 | if ($xoopsModuleConfig['paypal_test'] == '1') { |
||
66 | $paypal['url'] = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; |
||
67 | } elseif ($xoopsModuleConfig['paypal_secure_yn'] == '0') { |
||
68 | $paypal['url'] = 'http://www.paypal.com/cgi-bin/webscr'; |
||
69 | } else { |
||
70 | $paypal['url'] = 'https://www.paypal.com/cgi-bin/webscr'; |
||
71 | } |
||
72 | |||
73 | $paypal['post_method'] = 'fso'; //fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support |
||
74 | $paypal['curl_location'] = '/usr/local/bin/curl'; |
||
75 | |||
76 | $paypal['bn'] = 'toolkit-php'; |
||
77 | $paypal['cmd'] = '_xclick'; |
||
78 | |||
79 | //Payment Page Settings |
||
80 | $paypal['display_comment'] = '0'; //0=yes 1=no |
||
81 | $paypal['comment_header'] = 'Comments'; |
||
82 | $paypal['continue_button_text'] = 'Continue >>'; |
||
83 | $paypal['background_color'] = ''; //""=white 1=black |
||
84 | $paypal['display_shipping_address'] = ''; //""=yes 1=no |
||
85 | $paypal['display_comment'] = '1'; //""=yes 1=no |
||
86 | |||
87 | //Product Settings |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
60% 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. ![]() |
|||
88 | /* $paypal['item_name']="$_POST[item_name]"; |
||
89 | $paypal['item_number']="$_POST[item_number]"; */ |
||
90 | //$paypal['amount']="$_POST[amount]"; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% 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. ![]() |
|||
91 | /* |
||
92 | $paypal['on0']="$_POST[on0]"; |
||
93 | $paypal['os0']="$_POST[os0]"; |
||
94 | $paypal['on1']="$_POST[on1]"; |
||
95 | $paypal['os1']="$_POST[os1]"; |
||
96 | $paypal['quantity']="$_POST[quantity]"; */ |
||
97 | $paypal['edit_quantity'] = ''; //1=yes ""=no |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
59% 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. ![]() |
|||
98 | /* $paypal['invoice']="$_POST[invoice]"; |
||
99 | $paypal['tax']="$_POST[tax]"; */ |
||
100 | |||
101 | //Shipping and Taxes |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
54% 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. ![]() |
|||
102 | //$paypal['shipping_amount']="$_POST[shipping_amount]"; |
||
103 | $paypal['shipping_amount_per_item'] = ''; |
||
104 | $paypal['handling_amount'] = ''; |
||
105 | /* $paypal['custom']="$_POST[custom]"; */ |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% 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. ![]() |
|||
106 | |||
107 | //Customer Settings |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
67% 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. ![]() |
|||
108 | /* $paypal['firstname']="$_POST[firstname]"; |
||
109 | $paypal['lastname']="$_POST[lastname]"; |
||
110 | $paypal['address1']="$_POST[address1]"; |
||
111 | $paypal['address2']="$_POST[address2]"; */ |
||
112 | |||
113 | /* $paypal['city']="$_POST[city]"; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% 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. ![]() |
|||
114 | $paypal['state']="$_POST[state]"; |
||
115 | $paypal['zip']="$_POST[zip]"; |
||
116 | $paypal['email']="$_POST[email]"; |
||
117 | $paypal['phone_1']="$_POST[phone1]"; |
||
118 | $paypal['phone_2']="$_POST[phone2]"; |
||
119 | $paypal['phone_3']="$_POST[phone3]"; */ |
||
120 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.