\OpenPayz
Basic OpenPayz implementation
Synopsis
class OpenPayz
{
- // constants
- const URL_AJAX_SOURCE = '?module=openpayz&ajax=true';
- const URL_CHARTS = '?module=openpayz&graphs=true';
- const URL_ME = '?module=openpayz';
- const TABLE_CUSTOMERS = 'op_customers';
- const TABLE_TRANSACTIONS = 'op_transactions';
- const TABLE_STATIC = 'op_static';
- const KEY_PSYS = 'OPPAYSYS';
- const KEY_CHARTS = 'OPCHARTS_';
- // members
- protected array $allCustomers = ;
- protected array $allTransactions = ;
- protected array $allPaySys = ;
- protected array $altCfg = ;
- protected array $allAddress = ;
- protected array $allRealnames = ;
- protected $messages = '';
- protected $ubConfig = '';
- protected integer $smsNotysPullInterval = 10;
- protected bool $smsUseExtMobiles = false;
- protected bool $smsForceTranslit = false;
- protected bool $smsDebugON = false;
- protected string $smsNotysText = '';
- protected bool $smsRespectReminderTagID = false;
- protected integer $smsReminderTagID = 0;
- protected array $allUsersTags = ;
- protected $customersDb = '';
- protected $transactionsDb = '';
- protected $staticDb = '';
- protected integer $payidStaticLen = 0;
- protected string $payIdStaticPrefix = '';
- protected $fundsFlow = '';
- protected $cache = '';
- protected integer $cacheTimeout = 86400;
- // methods
- public void __construct()
- protected void loadAlter()
- protected void loadOptions()
- protected void initDbLayers()
- protected void initCache()
- protected void loadAddress()
- protected void loadRealname()
- protected void loadCustomers()
- protected void loadTransactions()
- public array getCustomers()
- public array getCustomersPaymentIds()
- public string getCustomerPaymentId()
- protected void loadPaySys()
- protected voids initMessages()
- protected int generateUniquePaymentId()
- public int registerStaticPaymentId()
- public void degisterStaticPaymentId()
- public string renderSearchForm()
- public void doSearch()
- protected void initFundsFlow()
- protected int getUserOnlineLeftDayCount()
- protected string getUserOnlineToDate()
- protected string renderChartsYearForm()
- public string renderGraphs()
- public void transactionSetProcessed()
- public void cashAdd()
- public array transactionGetData()
- public void transactionAjaxSource()
- public void renderTransactionList()
- public void renderTransactionDetails()
- public void pullNotysPayments()
- public void processNotys()
Constants
Name | Value |
---|---|
URL_AJAX_SOURCE | '?module=openpayz&ajax=true' |
URL_CHARTS | '?module=openpayz&graphs=true' |
URL_ME | '?module=openpayz' |
TABLE_CUSTOMERS | 'op_customers' |
TABLE_TRANSACTIONS | 'op_transactions' |
TABLE_STATIC | 'op_static' |
KEY_PSYS | 'OPPAYSYS' |
KEY_CHARTS | 'OPCHARTS_' |
Members
protected
- $allAddress
—
array
Contains available users address data as login=>address - $allCustomers
—
array
Contains available virtualid=>realid mappings - $allPaySys
—
array
Existing payment systems names - $allRealnames
—
array
Contains available users realnames as login=>realname - $allTransactions
—
array
Contains existing transactions data - $allUsersTags
—
array
All users tags to use if $smsRespectReminderTagID is true - $altCfg
—
array
Contains system alter.ini config as key=>value - $cache
—
System caching object placeholder - $cacheTimeout
—
int
Default cached data timeout. May be configurable in future? - $customersDb
—
Customers database abstraction layer placeholder - $fundsFlow
—
Funds flow instance placeholder - $messages
—
System message helper object placeholder - $payIdStaticPrefix
—
string
Prefix for newly generated static payment IDs - $payidStaticLen
—
int
Length of generated static payment ID - $smsDebugON
—
bool
Placeholder for OP_SMS_NOTIFY_DEBUG_ON alter.ini option - $smsForceTranslit
—
bool
Placeholder for OP_SMS_NOTIFY_FORCED_TRANSLIT alter.ini option - $smsNotysPullInterval
—
int
Placeholder for OP_SMS_NOTIFY_PAYMENTS_PULL_INTERVAL alter.ini option - $smsNotysText
—
string
Placeholder for OP_SMS_NOTIFY_TEXT alter.ini option - $smsReminderTagID
—
int
Placeholder for REMINDER_TAGID alter.ini option - $smsRespectReminderTagID
—
bool
Placeholder for OP_SMS_NOTIFY_RESPECT_REMINDER_TAGID alter.ini option - $smsUseExtMobiles
—
bool
Placeholder for OP_SMS_NOTIFY_USE_EXTMOBILES alter.ini option - $staticDb
—
Static customers database abstraction layer placeholder - $transactionsDb
—
Transactions database abstraction layer placeholder - $ubConfig
—
Placeholder for UbillingConfig object
Methods
protected
- generateUniquePaymentId() — Generates unique payment ID of configurable length
- getUserOnlineLeftDayCount() — Returns user online left days without additional DB queries runDataLoaders() must be run once, before usage
- getUserOnlineToDate() — Returns user online to date
- initCache() — Inits Ubilling caching engine for further usage
- initDbLayers() — Inits all required database abstraction layers
- initFundsFlow() — Inits funds flow object instance
- initMessages() — Inits system messages helper
- loadAddress() — Loads users address list into protected property
- loadAlter() — Loads global alter config into protected property
- loadCustomers() — Loads all op_customers from database into protected prop
- loadOptions() — Getting an alter.ini options
- loadPaySys() — Loads array of available payment systems
- loadRealname() — Loads users realnames list into protected property
- loadTransactions() — Loads available openpayz transactions into private data property
- renderChartsYearForm() — Renders year selection form for charts
public
- __construct() — Creates new OpenPayz instance
- cashAdd() — Pushes user payment with some payment system
- degisterStaticPaymentId() — Deregisters static payment ID by username
- doSearch() — Performs openpayz search in database and shows result
- getCustomerPaymentId() — Returns some specified user paymentId
- getCustomers() — Public getter of preloaded users mappings as paymentId=>userLogin
- getCustomersPaymentIds() — Public getter of preloaded users mappings as userLogin=>paymentId
- processNotys() — Handles notifications processing for collected payments
- pullNotysPayments() — Pulls payments from payment DB for further SMS notifications processing
- registerStaticPaymentId() — Creates new static payment ID in database for some user
- renderGraphs() — Renders per-payment system openpayz transaction charts
- renderSearchForm() — Returns openpayz search form
- renderTransactionDetails() — Renders transaction details
- renderTransactionList() — Renders transaction list container
- transactionAjaxSource() — Retruns json data for jquery data tables with transactions list
- transactionGetData() — Returns openpayz transaction data by its ID
- transactionSetProcessed() — Sets openpayz transaction as processed in database