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

@@ -0,0 +1,118 @@
<?php
/**
* @brief {class}
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
{subpackage}
* @since {date}
*/
namespace IPS\{app}\extensions\nexus\Gateway;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\nexus\Customer;
use IPS\nexus\Gateway;
use IPS\nexus\Invoice;
use IPS\nexus\Money;
use IPS\nexus\Transaction;
use IPS\Helpers\Form;
use Exception;
use InvalidArgumentException;
use LogicException;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* {class}
*/
class {class} extends Gateway
{
public static string $gatewayKey = '{class}';
/* !Features */
const SUPPORTS_REFUNDS = TRUE;
const SUPPORTS_PARTIAL_REFUNDS = TRUE;
/**
* Capture
*
* @param Transaction $transaction Transaction
* @return void
* @throws LogicException
*/
public function capture( Transaction $transaction ): void
{
}
/**
* Refund
*
* @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( Transaction $transaction, mixed $amount = NULL, ?string $reason = NULL): mixed
{
return NULL;
}
/**
* Refund Reasons that the gateway understands, if the gateway supports this
*
* @return array
*/
public static function refundReasons(): array
{
return [];
}
/**
* Settings
*
* @param Form $form The form
* @return void
*/
public function settings( Form $form ): void
{
}
/**
* Test Settings
*
* @param array $settings Settings
* @return array
* @throws InvalidArgumentException
*/
public function testSettings( array $settings=array() ): array
{
return $settings;
}
/**
* Payment Screen Fields
*
* @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( Invoice $invoice, Money $amount, ?Customer $member = NULL, array $recurrings = [], string $type = 'checkout' ): array
{
return [];
}
}
@@ -12,45 +12,51 @@
namespace IPS\{app}\extensions\nexus\Item;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Helpers\Form;
use IPS\nexus\Invoice;
use IPS\nexus\Invoice\Item;
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;
}
/**
* {class}
*/
class _{class} extends \IPS\nexus\Invoice\Item\Charge // or \IPS\nexus\Invoice\Item\Purchase
class {class} extends Item\{itemType}
{
/**
* @brief Application
*/
public static $application = '{app}';
public static string $application = '{app}';
/**
* @brief Application
*/
public static $type = '';
public static string $type = '{type}';
/**
* @brief Icon
*/
public static $icon = '';
public static string $icon = '';
/**
* @brief Title
*/
public static $title = '';
public static string $title = '';
/**
* Generate Invoice Form
*
* @param \IPS\Helpers\Form $form The form
* @param \IPS\nexus\Invoice $invoice The invoice
* @param Form $form The form
* @param Invoice $invoice The invoice
* @return void
*/
public static function form( \IPS\Helpers\Form $form, \IPS\nexus\Invoice $invoice )
public static function form( Form $form, Invoice $invoice ) : void
{
}
@@ -59,10 +65,10 @@ class _{class} extends \IPS\nexus\Invoice\Item\Charge // or \IPS\nexus\Invoice\I
* Create From Form
*
* @param array $values Values from form
* @param \IPS\nexus\Invoice $invoice The invoice
* @return \IPS\nexus\extensions\nexus\Item\MiscellaneousCharge
* @param Invoice $invoice The invoice
* @return static
*/
public static function createFromForm( array $values, \IPS\nexus\Invoice $invoice )
public static function createFromForm( array $values, Invoice $invoice ) : static
{
}
@@ -70,10 +76,10 @@ class _{class} extends \IPS\nexus\Invoice\Item\Charge // or \IPS\nexus\Invoice\I
/**
* On Paid
*
* @param \IPS\nexus\Invoice $invoice The invoice
* @param Invoice $invoice The invoice
* @return void
*/
public function onPaid( \IPS\nexus\Invoice $invoice )
public function onPaid( Invoice $invoice ): void
{
}
@@ -0,0 +1,41 @@
<?php
/**
* @brief {class}
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
{subpackage}
* @since {date}
*/
namespace IPS\{app}\extensions\nexus\LicenseKey;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\nexus\Purchase\LicenseKey;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* {class}
*/
class {class} extends LicenseKey
{
public static string $keyType = '{class}';
/**
* Generates a License Key
*
* @return string
*/
public static function generateKey() : string
{
return '';
}
}
@@ -0,0 +1,77 @@
<?php
/**
* @brief {class}
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
{subpackage}
* @since {date}
*/
namespace IPS\{app}\extensions\nexus\Payout;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\nexus\Payout;
use DomainException;
use Exception;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* {class}
*/
class {class} extends Payout
{
public static string $gatewayKey = '{class}';
/**
* ACP Settings
*
* @return array
*/
public static function settings() : array
{
return array();
}
/**
* Payout Form
*
* @return array
*/
public static function form() :array
{
return array();
}
/**
* Get data and validate
*
* @param array $values Values from form
* @return mixed
* @throws DomainException
*/
public function getData( array $values ) : mixed
{
return NULL;
}
/**
* Process the payout
* Return the new status for this payout record
*
* @return string
* @throws Exception
*/
public function process() : string
{
}
}