|
@@ -75,7 +75,7 @@ discard block |
|
|
block discarded – undo |
|
75
|
75
|
$postdata = ''; |
|
76
|
76
|
|
|
77
|
77
|
foreach ($_POST as $i => $v) { |
|
78
|
|
- $postdata .= $i . '=' . urlencode($v) . '&'; |
|
|
78
|
+ $postdata .= $i.'='.urlencode($v).'&'; |
|
79
|
79
|
} |
|
80
|
80
|
$postdata .= 'cmd=_notify-validate'; |
|
81
|
81
|
$web = parse_url(HelperConfig::$shop["paypal"]["url"]); |
|
@@ -87,15 +87,15 @@ discard block |
|
|
block discarded – undo |
|
87
|
87
|
$web['port'] = 80; |
|
88
|
88
|
$ssl = ''; |
|
89
|
89
|
} |
|
90
|
|
- $fp = @fsockopen($ssl . $web['host'], $web['port'], $errnum, $errstr, 30); |
|
|
90
|
+ $fp = @fsockopen($ssl.$web['host'], $web['port'], $errnum, $errstr, 30); |
|
91
|
91
|
|
|
92
|
92
|
if ($fp) { |
|
93
|
|
- fwrite($fp, "POST " . $web['path'] . " HTTP/1.1\r\n"); |
|
94
|
|
- fwrite($fp, "Host: " . $web['host'] . "\r\n"); |
|
|
93
|
+ fwrite($fp, "POST ".$web['path']." HTTP/1.1\r\n"); |
|
|
94
|
+ fwrite($fp, "Host: ".$web['host']."\r\n"); |
|
95
|
95
|
fwrite($fp, "Content-type: application/x-www-form-urlencoded\r\n"); |
|
96
|
|
- fwrite($fp, "Content-length: " . strlen($postdata) . "\r\n"); |
|
|
96
|
+ fwrite($fp, "Content-length: ".strlen($postdata)."\r\n"); |
|
97
|
97
|
fwrite($fp, "Connection: close\r\n\r\n"); |
|
98
|
|
- fwrite($fp, $postdata . "\r\n\r\n"); |
|
|
98
|
+ fwrite($fp, $postdata."\r\n\r\n"); |
|
99
|
99
|
|
|
100
|
100
|
$info = []; |
|
101
|
101
|
while (!feof($fp)) { |
|
@@ -105,9 +105,9 @@ discard block |
|
|
block discarded – undo |
|
105
|
105
|
$info = implode(',', $info); |
|
106
|
106
|
if (!(strpos($info, 'VERIFIED') === false)) { |
|
107
|
107
|
|
|
108
|
|
- $sLogData .= "-- new entry - " . date(HelperConfig::$core['locale_format_date_time']) . " --\n\n"; |
|
|
108
|
+ $sLogData .= "-- new entry - ".date(HelperConfig::$core['locale_format_date_time'])." --\n\n"; |
|
109
|
109
|
$sLogData .= "W00T!\n\n"; |
|
110
|
|
- $sLogData .= \HaaseIT\Toolbox\Tools::debug($_REQUEST, '', true, true) . "\n\n"; |
|
|
110
|
+ $sLogData .= \HaaseIT\Toolbox\Tools::debug($_REQUEST, '', true, true)."\n\n"; |
|
111
|
111
|
|
|
112
|
112
|
// Check if the transaction id has been used before |
|
113
|
113
|
$queryBuilder = $this->dbal->createQueryBuilder(); |
|
@@ -138,27 +138,27 @@ discard block |
|
|
block discarded – undo |
|
138
|
138
|
; |
|
139
|
139
|
$queryBuilder->execute(); |
|
140
|
140
|
|
|
141
|
|
- $sLogData .= "-- Alles ok. Zahlung erfolgreich. TXNID: " . $_REQUEST["txn_id"] . " --\n\n"; |
|
|
141
|
+ $sLogData .= "-- Alles ok. Zahlung erfolgreich. TXNID: ".$_REQUEST["txn_id"]." --\n\n"; |
|
142
|
142
|
} else { |
|
143
|
143
|
$sLogData .= "-- In my country we have problem; Problem is evaluation. Throw the data down the log!\n"; |
|
144
|
|
- $sLogData .= "mc_gross: " . $_REQUEST["mc_gross"] . ' - number_format($fGesamtbrutto, 2, \'.\', \'\'): ' . number_format($fGesamtbrutto, |
|
145
|
|
- 2, '.', '') . "\n"; |
|
146
|
|
- $sLogData .= "custom: " . $_REQUEST["custom"] . ' - $aOrder[\'o_id\']: ' . $aOrder['o_id'] . "\n"; |
|
147
|
|
- $sLogData .= "payment_status: " . $_REQUEST["payment_status"] . "\n"; |
|
148
|
|
- $sLogData .= "mc_currency: " . $_REQUEST["mc_currency"] . ' - HelperConfig::$shop["paypal"]["currency_id"]: ' . HelperConfig::$shop["paypal"]["currency_id"] . "\n"; |
|
149
|
|
- $sLogData .= "business: " . $_REQUEST["receiver_email"] . ' - HelperConfig::$shop["paypal"]["business"]: ' . HelperConfig::$shop["paypal"]["business"] . "\n\n"; |
|
|
144
|
+ $sLogData .= "mc_gross: ".$_REQUEST["mc_gross"].' - number_format($fGesamtbrutto, 2, \'.\', \'\'): '.number_format($fGesamtbrutto, |
|
|
145
|
+ 2, '.', '')."\n"; |
|
|
146
|
+ $sLogData .= "custom: ".$_REQUEST["custom"].' - $aOrder[\'o_id\']: '.$aOrder['o_id']."\n"; |
|
|
147
|
+ $sLogData .= "payment_status: ".$_REQUEST["payment_status"]."\n"; |
|
|
148
|
+ $sLogData .= "mc_currency: ".$_REQUEST["mc_currency"].' - HelperConfig::$shop["paypal"]["currency_id"]: '.HelperConfig::$shop["paypal"]["currency_id"]."\n"; |
|
|
149
|
+ $sLogData .= "business: ".$_REQUEST["receiver_email"].' - HelperConfig::$shop["paypal"]["business"]: '.HelperConfig::$shop["paypal"]["business"]."\n\n"; |
|
150
|
150
|
} |
|
151
|
151
|
} else { |
|
152
|
152
|
// INVALID LOGGING ERROR |
|
153
|
|
- $sLogData .= "-- new entry - " . date(HelperConfig::$core['locale_format_date_time']) . " --\n\nPHAIL\n\n"; |
|
154
|
|
- $sLogData .= "!!! JEMAND HAT EINE ALTE TXN_ID BENUTZT: " . $_REQUEST["txn_id"] . " !!!\n\n"; |
|
|
153
|
+ $sLogData .= "-- new entry - ".date(HelperConfig::$core['locale_format_date_time'])." --\n\nPHAIL\n\n"; |
|
|
154
|
+ $sLogData .= "!!! JEMAND HAT EINE ALTE TXN_ID BENUTZT: ".$_REQUEST["txn_id"]." !!!\n\n"; |
|
155
|
155
|
$sLogData .= "!!! INVALID !!!\n\n"; |
|
156
|
156
|
} |
|
157
|
157
|
} else { |
|
158
|
|
- $sLogData .= "-- new entry - " . date(HelperConfig::$core['locale_format_date_time']) . " --\n\nPHAIL - Transaktion fehlgeschlagen. TXNID: " . $_REQUEST["txn_id"] . "\n" . $info . "\n\n"; |
|
|
158
|
+ $sLogData .= "-- new entry - ".date(HelperConfig::$core['locale_format_date_time'])." --\n\nPHAIL - Transaktion fehlgeschlagen. TXNID: ".$_REQUEST["txn_id"]."\n".$info."\n\n"; |
|
159
|
159
|
} |
|
160
|
160
|
|
|
161
|
|
- file_put_contents(PATH_LOGS . FILE_PAYPALLOG, $sLogData, FILE_APPEND); |
|
|
161
|
+ file_put_contents(PATH_LOGS.FILE_PAYPALLOG, $sLogData, FILE_APPEND); |
|
162
|
162
|
} |
|
163
|
163
|
} |
|
164
|
164
|
|