Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

@@ -0,0 +1,53 @@
<?php
/**
* @brief 2Checkout Gateway
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Nexus
* @since 18 Mar 2014
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
try
{
$transaction = \IPS\nexus\Transaction::load( \IPS\Request::i()->nexustransactionid );
if ( $transaction->status !== \IPS\nexus\Transaction::STATUS_PENDING )
{
throw new \OutofRangeException;
}
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=payments&controller=checkout&do=transaction&id=&t=" . \IPS\Request::i()->nexustransactionid, 'front', 'nexus_checkout', \IPS\Settings::i()->nexus_https ) );
}
$settings = json_decode( $transaction->method->settings, TRUE );
$hash = mb_strtoupper( md5( $settings['word'] . $settings['sid'] . ( \IPS\NEXUS_TEST_GATEWAYS ? 1 : \IPS\Request::i()->order_number ) . number_format( $transaction->amount->amount, 2 ) ) );
if ( $hash !== \IPS\Request::i()->key )
{
\IPS\Output::i()->redirect( $transaction->invoice->checkoutUrl()->setQueryString( array( '_step' => 'checkout_pay', 'err' => $transaction->member->language()->get('gateway_err') ) ) );
}
if ( \IPS\Request::i()->credit_card_processed !== 'Y' )
{
\IPS\Output::i()->redirect( $transaction->invoice->checkoutUrl()->setQueryString( array( '_step' => 'checkout_pay', 'err' => $transaction->member->language()->get('card_refused') ) ) );
}
$transaction->gw_id = \IPS\Request::i()->order_number;
$transaction->save();
$maxMind = NULL;
if ( \IPS\Settings::i()->maxmind_key )
{
$maxMind = new \IPS\nexus\Fraud\MaxMind\Request;
$maxMind->setTransaction( $transaction );
}
$transaction->checkFraudRulesAndCapture( $maxMind );
$transaction->sendNotification();
\IPS\Session::i()->setMember( $transaction->invoice->member ); // This is in case the checkout was a guest, meaning checkFraudRulesAndCapture() may have just created an account. There is no security issue as we have just verified they were just bounced back from 2CheckOut
\IPS\Output::i()->redirect( $transaction->url() );
@@ -0,0 +1,90 @@
<?php
/**
* @brief Authorize.Net DPM Gateway
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Nexus
* @since 17 Mar 2014
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
try
{
$invoice = \IPS\nexus\Invoice::load( \IPS\Request::i()->x_invoice_num );
}
catch ( \Exception $e )
{
\IPS\Output::i()->sendOutput( '', 404 );
exit;
}
try
{
/* Load Gateway */
$gateway = \IPS\nexus\Gateway::load( \IPS\Request::i()->payment_method );
$settings = json_decode( $gateway->settings, TRUE );
/* Check MD5 hash */
if ( \IPS\Request::i()->x_MD5_Hash != mb_strtoupper( md5( $settings['hash'] . $settings['login'] . \IPS\Request::i()->x_trans_id . \IPS\Request::i()->x_amount ) ) )
{
throw new \Exception( $invoice->member->language()->addToStack('gateway_err') );
}
/* Was it accepted? */
if ( \IPS\Request::i()->x_response_code != 1 )
{
throw new \IPS\nexus\Gateway\AuthorizeNet\Exception( \IPS\Request::i()->x_response_reason_code );
}
/* Create a transaction */
$transaction = new \IPS\nexus\Transaction;
$transaction->member = \IPS\Member::load( \IPS\Request::i()->x_cust_id );
$transaction->invoice = $invoice;
$transaction->method = $gateway;
$transaction->amount = \IPS\Request::i()->x_amount;
$transaction->currency = $invoice->currency;
$transaction->gw_id = \IPS\Request::i()->x_trans_id;
$transaction->ip = \IPS\Request::i()->x_customer_ip;
$extra = $transaction->extra;
$extra['lastFour'] = str_replace( 'X', '', \IPS\Request::i()->x_account_number );
$transaction->extra = $extra;
$transaction->auth = \IPS\DateTime::create()->add( new \DateInterval( 'P30D' ) );
/* Create a MaxMind request */
$maxMind = NULL;
if ( \IPS\Settings::i()->maxmind_key )
{
$maxMind = new \IPS\nexus\Fraud\MaxMind\Request;
$maxMind->setTransaction( $transaction );
$maxMind->setTransactionType( 'creditcard' );
$maxMind->setAVS( \IPS\Request::i()->x_avs_code );
}
/* Check Fraud Rules and capture */
$transaction->checkFraudRulesAndCapture( $maxMind );
$transaction->sendNotification();
/* Show thanks screen */
$url = $transaction->url();
}
catch ( \Exception $e )
{
$url = $invoice->checkoutUrl()->setQueryString( array( '_step' => 'checkout_pay', 'err' => $e->getMessage() ) );
}
?>
<html>
<head>
<script type='text/javascript' charset='utf-8'>
window.location='<?php echo $url; ?>';
</script>
<noscript>
<meta http-equiv='refresh' content='1;url=<?php echo $url; ?>'>
</noscript>
</head>
<body></body>
</html>
Whitespace-only changes.
@@ -0,0 +1,52 @@
<?php
/**
* @brief PayPal Gateway
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Nexus
* @since 07 Mar 2014
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
\IPS\Session\Front::i();
try
{
$transaction = \IPS\nexus\Transaction::load( \IPS\Request::i()->nexusTransactionId );
if ( $transaction->status !== \IPS\nexus\Transaction::STATUS_PENDING )
{
throw new \OutofRangeException;
}
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=nexus&module=payments&controller=checkout&do=transaction&id=&t=" . \IPS\Request::i()->nexusTransactionId, 'front', 'nexus_checkout', \IPS\Settings::i()->nexus_https ) );
}
try
{
$response = $transaction->method->api( "payments/payment/{$transaction->gw_id}/execute", array(
'payer_id' => \IPS\Request::i()->PayerID,
) );
$maxMind = NULL;
if ( \IPS\Settings::i()->maxmind_key )
{
$maxMind = new \IPS\nexus\Fraud\MaxMind\Request;
$maxMind->setTransaction( $transaction );
$maxMind->setTransactionType( 'paypal' );
}
$transaction->checkFraudRulesAndCapture( $maxMind );
$transaction->sendNotification();
\IPS\Session::i()->setMember( $transaction->invoice->member ); // This is in case the checkout was a guest, meaning checkFraudRulesAndCapture() may have just created an account. There is no security issue as we have just verified they were just bounced back from PayPal
\IPS\Output::i()->redirect( $transaction->url() );
}
catch ( \Exception $e )
{
\IPS\Output::i()->redirect( $transaction->invoice->checkoutUrl()->setQueryString( array( '_step' => 'checkout_pay', 'err' => $e->getMessage() ) ) );
}
@@ -0,0 +1,64 @@
<?php
/**
* @brief SagePay Gateway
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Nexus
* @since 19 Mar 2014
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
function returnData( $status, $detail, $returnUrl )
{
echo "Status={$status}\r\nStatusDetail={$detail}\r\nRedirectURL={$returnUrl}";
exit;
}
/* Load */
try
{
$transaction = \IPS\nexus\Transaction::load( \IPS\Request::i()->VendorTxCode );
if ( $transaction->status !== \IPS\nexus\Transaction::STATUS_PENDING )
{
throw new \OutofRangeException;
}
}
catch ( \OutOfRangeException $e )
{
returnData( 'ERROR', 'NO_TRANSACTION', \IPS\Settings::i()->base_url );
}
/* Authenticate */
$settings = json_decode( $transaction->method->settings, TRUE );
$extra = $transaction->extra;
if ( \IPS\Request::i()->VPSSignature !== mb_strtoupper( md5( \IPS\Request::i()->VPSTxId . \IPS\Request::i()->VendorTxCode . \IPS\Request::i()->Status . \IPS\Request::i()->TxAuthNo . mb_strtolower( $settings['vendor'] ) . \IPS\Request::i()->AVSCV2 . $extra['sagepaySecurityKey'] . \IPS\Request::i()->AddressResult . \IPS\Request::i()->PostCodeResult . \IPS\Request::i()->CV2Result . \IPS\Request::i()->GiftAid . \IPS\Request::i()->__get('3DSecureStatus') . \IPS\Request::i()->CAVV . \IPS\Request::i()->AddressStatus . \IPS\Request::i()->PayerStatus . \IPS\Request::i()->CardType . \IPS\Request::i()->Last4Digits . \IPS\Request::i()->DeclineCode . \IPS\Request::i()->ExpiryDate . \IPS\Request::i()->FraudResponse . \IPS\Request::i()->BankAuthCode ) ) )
{
returnData( 'INVALID', 'MD5', $transaction->invoice->checkoutUrl()->setQueryString( array( '_step' => 'checkout_pay', 'err' => $transaction->member->language()->get( 'gateway_err' ) ) ) );
}
/* Save the auth code */
$extra['sagepayAuth'] = \IPS\Request::i()->TxAuthNo;
$transaction->extra = $extra;
$transaction->save();
/* Handle */
if ( \IPS\Request::i()->Status === 'OK' )
{
$maxMind = NULL;
if ( \IPS\Settings::i()->maxmind_key )
{
$maxMind = new \IPS\nexus\Fraud\MaxMind\Request;
$maxMind->setTransaction( $transaction );
}
$transaction->checkFraudRulesAndCapture( $maxMind );
$transaction->sendNotification();
}
/* Respond */
returnData( 'OK', 'MD5', $transaction->url() );