Skip to content

Commit

Permalink
No longer use Server::get method, will be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 11, 2023
1 parent 451066d commit 28f76ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DirectLink/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,17 @@ public function start( Payment $payment ) {

$secure_data_helper
->set_3d_secure_flag( true )
->set_http_accept( Server::get( 'HTTP_ACCEPT' ) )
->set_http_user_agent( Server::get( 'HTTP_USER_AGENT' ) )
->set_window( 'MAINW' );

if ( \array_key_exists( 'HTTP_ACCEPT', $_SERVER ) ) {
$secure_data_helper->set_http_accept( \sanitize_text_field( $_SERVER['HTTP_ACCEPT'] ) );
}

if ( \array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) ) {
// phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___SERVER__HTTP_USER_AGENT__
$secure_data_helper->set_http_accept( \sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ) );
}

$ogone_data->set_field( 'ACCEPTURL', $payment->get_return_url() );
$ogone_data->set_field( 'DECLINEURL', $payment->get_return_url() );
$ogone_data->set_field( 'EXCEPTIONURL', $payment->get_return_url() );
Expand Down

0 comments on commit 28f76ed

Please sign in to comment.