1 | <?php |
||
2 | |||
3 | namespace Pronamic\WordPress\Pay\Gateways\IDealBasic; |
||
4 | |||
5 | use Pronamic\WordPress\Pay\Core\Util as Core_Util; |
||
6 | use Pronamic\WordPress\Pay\Gateways\IDealBasic\XML\NotificationParser; |
||
7 | |||
8 | /** |
||
9 | * Title: iDEAL Basic utility class |
||
10 | * Description: |
||
11 | * Copyright: 2005-2019 Pronamic |
||
12 | * Company: Pronamic |
||
13 | * |
||
14 | * @author Reüel van der Steege |
||
15 | * @version 2.0.0 |
||
16 | * @since 1.0.0 |
||
17 | */ |
||
18 | class Util { |
||
19 | /** |
||
20 | * Get parsed notification. |
||
21 | */ |
||
22 | public static function get_notification() { |
||
23 | if ( ! filter_has_var( INPUT_GET, 'xml_notification' ) && ! filter_has_var( INPUT_GET, 'xml_notifaction' ) ) { |
||
24 | // Also check for typo 'xml_notifaction', as this has been used in the past. |
||
25 | return; |
||
26 | } |
||
27 | |||
28 | $data = file_get_contents( 'php://input' ); |
||
29 | |||
30 | $xml = Core_Util::simplexml_load_string( $data ); |
||
31 | |||
32 | if ( is_wp_error( $xml ) ) { |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
33 | return; |
||
34 | } |
||
35 | |||
36 | return NotificationParser::parse( $xml ); |
||
37 | } |
||
38 | } |
||
39 |