| Conditions | 2 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 71 | public function order_direct( array $data = array() ) { |
||
| 72 | $order_response = false; |
||
|
|
|||
| 73 | |||
| 74 | $result = Util::remote_get_body( |
||
| 75 | $this->api_url, |
||
| 76 | 200, |
||
| 77 | array( |
||
| 78 | 'method' => 'POST', |
||
| 79 | 'sslverify' => false, |
||
| 80 | 'body' => $data, |
||
| 81 | ) |
||
| 82 | ); |
||
| 83 | |||
| 84 | $xml = Util::simplexml_load_string( $result ); |
||
| 85 | |||
| 86 | $order_response = OrderResponseParser::parse( $xml ); |
||
| 87 | |||
| 88 | if ( ! empty( $order_response->nc_error ) ) { |
||
| 89 | $ogone_error = new Error( |
||
| 90 | Security::filter( $order_response->nc_error ), |
||
| 91 | Security::filter( $order_response->nc_error_plus ) |
||
| 92 | ); |
||
| 93 | |||
| 94 | throw new \Exception( (string) $ogone_error ); |
||
| 95 | } |
||
| 96 | |||
| 97 | return $order_response; |
||
| 98 | } |
||
| 100 |