Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief MaxMind Request
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Nexus
|
||||
* @since 07 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -42,15 +42,7 @@ class _Request
|
||||
|
||||
if ( $session )
|
||||
{
|
||||
$this->setIpAddress( $_SERVER['REMOTE_ADDR'] );
|
||||
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
|
||||
{
|
||||
$this->data['forwardedIP'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
elseif( isset( $_SERVER['HTTP_CLIENT_IP'] ) )
|
||||
{
|
||||
$this->data['forwardedIP'] = $_SERVER['HTTP_CLIENT_IP'];
|
||||
}
|
||||
$this->setIpAddress( \IPS\Request::i()->ipAddress() );
|
||||
|
||||
$this->data['sessionID'] = session_id();
|
||||
|
||||
@@ -85,7 +77,7 @@ class _Request
|
||||
*/
|
||||
public function setTransaction( \IPS\nexus\Transaction $transaction )
|
||||
{
|
||||
$this->setMember( $transaction->member );
|
||||
$this->setMember( $transaction->member->member_id ? $transaction->member : $transaction->invoice->member );
|
||||
|
||||
if ( $billingAddress = $transaction->invoice->billaddress )
|
||||
{
|
||||
@@ -96,7 +88,7 @@ class _Request
|
||||
$this->setShippingAddress( $transaction->invoice->shipaddress );
|
||||
}
|
||||
|
||||
$this->data['order_amount'] = $transaction->amount->amount;
|
||||
$this->data['order_amount'] = (string) $transaction->amount->amount;
|
||||
$this->data['order_currency'] = $transaction->amount->currency;
|
||||
}
|
||||
|
||||
@@ -117,7 +109,7 @@ class _Request
|
||||
/**
|
||||
* Set Shipping Address
|
||||
*
|
||||
* @param \IPS\GeoLocation $billingAddress
|
||||
* @param \IPS\GeoLocation $shippingAddress
|
||||
* @return void
|
||||
*/
|
||||
public function setShippingAddress( \IPS\GeoLocation $shippingAddress )
|
||||
@@ -156,7 +148,7 @@ class _Request
|
||||
/**
|
||||
* Set Credit Card
|
||||
*
|
||||
* @param string $cardNumber The card number
|
||||
* @param string $card The card number
|
||||
* @return void
|
||||
*/
|
||||
public function setCard( \IPS\nexus\CreditCard $card )
|
||||
@@ -194,7 +186,14 @@ class _Request
|
||||
* @throws \IPS\Http\Request\Exception
|
||||
*/
|
||||
public function request()
|
||||
{
|
||||
return new \IPS\nexus\Fraud\MaxMind\Response( \IPS\Http\Url::external( 'https://minfraud.maxmind.com/app/ccv2r' )->request()->post( $this->data ) );
|
||||
{
|
||||
$response = \IPS\Http\Url::external( 'https://minfraud.maxmind.com/app/ccv2r' )->request()->post( $this->data );
|
||||
|
||||
if ( isset( $response->httpHeaders['Content-Type'] ) and preg_match( '/; charset=(.+?)$/', $response->httpHeaders['Content-Type'], $matches ) )
|
||||
{
|
||||
$response = mb_convert_encoding( $response, 'UTF-8', $matches[1] );
|
||||
}
|
||||
|
||||
return new \IPS\nexus\Fraud\MaxMind\Response( (string) $response );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user