Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -12,16 +12,28 @@
namespace IPS\nexus\Gateway;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use Exception;
use InvalidArgumentException;
use IPS\Helpers\Form;
use IPS\nexus\Customer;
use IPS\nexus\Gateway;
use IPS\nexus\Invoice;
use IPS\nexus\Money;
use IPS\nexus\Transaction;
use LogicException;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Test Gateway
*/
class _Test extends \IPS\nexus\Gateway
class Test extends Gateway
{
/* !Features */
@@ -33,14 +45,14 @@ class _Test extends \IPS\nexus\Gateway
/**
* Payment Screen Fields
*
* @param \IPS\nexus\Invoice $invoice Invoice
* @param \IPS\nexus\Money $amount The amount to pay now
* @param \IPS\nexus\Customer $member The member the payment screen is for (if in the ACP charging to a member's card) or NULL for currently logged in member
* @param array $recurrings Details about recurring costs
* @param bool $type 'checkout' means the cusotmer is doing this on the normal checkout screen, 'admin' means the admin is doing this in the ACP, 'card' means the user is just adding a card
* @return array
* @param Invoice $invoice Invoice
* @param Money $amount The amount to pay now
* @param Customer|null $member The member the payment screen is for (if in the ACP charging to a member's card) or NULL for currently logged in member
* @param array $recurrings Details about recurring costs
* @param string $type 'checkout' means the cusotmer is doing this on the normal checkout screen, 'admin' means the admin is doing this in the ACP, 'card' means the user is just adding a card
* @return array
*/
public function paymentScreen( \IPS\nexus\Invoice $invoice, \IPS\nexus\Money $amount, \IPS\nexus\Customer $member = NULL, $recurrings = array(), $type = 'checkout' )
public function paymentScreen(Invoice $invoice, Money $amount, ?Customer $member = NULL, array $recurrings = array(), string $type = 'checkout' ): array
{
return array();
}
@@ -48,11 +60,11 @@ class _Test extends \IPS\nexus\Gateway
/**
* Capture
*
* @param \IPS\nexus\Transaction $transaction Transaction
* @return void
* @throws \LogicException
* @param Transaction $transaction Transaction
* @return void
* @throws LogicException
*/
public function capture( \IPS\nexus\Transaction $transaction )
public function capture( Transaction $transaction ): void
{
}
@@ -60,14 +72,15 @@ class _Test extends \IPS\nexus\Gateway
/**
* Refund
*
* @param \IPS\nexus\Transaction $transaction Transaction to be refunded
* @param float|NULL $amount Amount to refund (NULL for full amount - always in same currency as transaction)
* @return mixed Gateway reference ID for refund, if applicable
* @throws \Exception
* @param Transaction $transaction Transaction to be refunded
* @param mixed|NULL $amount Amount to refund (NULL for full amount - always in same currency as transaction)
* @param string|null $reason
* @return mixed Gateway reference ID for refund, if applicable
* @throws Exception
*/
public function refund( \IPS\nexus\Transaction $transaction, $amount = NULL )
public function refund(Transaction $transaction, mixed $amount = NULL, ?string $reason = NULL): mixed
{
return null;
}
/* !ACP Configuration */
@@ -75,10 +88,10 @@ class _Test extends \IPS\nexus\Gateway
/**
* Settings
*
* @param \IPS\Helpers\Form $form The form
* @return void
* @param Form $form The form
* @return void
*/
public function settings( &$form )
public function settings( Form $form ): void
{
}
@@ -86,11 +99,11 @@ class _Test extends \IPS\nexus\Gateway
/**
* Test Settings
*
* @param array $settings Settings
* @return array
* @throws \InvalidArgumentException
* @param array $settings Settings
* @return array
* @throws InvalidArgumentException
*/
public function testSettings( $settings )
public function testSettings(array $settings = array() ): array
{
return $settings;
}