\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_';
- const PID_PROCESSING = 'OP_PROCESSING';
- const CUSTOM_CASHTYPE_PREFIX = 'CASHTYPEID_';
- const OPTION_RESET = 'OPENPAYZ_USER_RESET';
- const OPTION_RESURRECT = 'RESETHARD';
- // members
- protected array $allCustomers = ;
- protected array $allTransactions = ;
- protected array $wholeTransactions = ;
- 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;
- protected integer $onPage = 50;
- protected integer $totalTransactionsCount = 0;
- protected integer $filteredTransactionsCount = 0;
- protected bool $hiLoadFlag = false;
- protected $transactionsProcess = '';
- protected integer $defaultCashTypeId = 1;
- protected array $paySysColors = ;
- // methods
- public void __construct()
- protected void loadAlter()
- protected void loadOptions()
- protected void initDbLayers()
- protected void initCache()
- protected void initStarDust()
- 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 array transactionGetData()
- public void renderTransactionDetails()
- public void pullNotysPayments()
- public void processNotys()
- public void renderTransactionsList()
- public void jsonTransactionsList()
- public void transactionsLoader()
- protected array getUnprocessedTransactions()
- protected void setTransactionProcessed()
- protected void processTransaction()
- public int|bool transactionsProcessingAll()
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_' |
| PID_PROCESSING | 'OP_PROCESSING' |
| CUSTOM_CASHTYPE_PREFIX | 'CASHTYPEID_' |
| OPTION_RESET | 'OPENPAYZ_USER_RESET' |
| OPTION_RESURRECT | 'RESETHARD' |
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 - $defaultCashTypeId
—
int
Contains default cash type id for transactions deffered processing - $filteredTransactionsCount
—
int
Contains filtered transactions count - $fundsFlow
—
Funds flow instance placeholder - $hiLoadFlag
—
bool
Is OPENPAYZ_HIGHLOAD_ENABLE option enabled in alter.ini? - $messages
—
System message helper object placeholder - $onPage
—
int
Default on-page transactions number - $payIdStaticPrefix
—
string
Prefix for newly generated static payment IDs - $paySysColors
—
array
Contains default payment systems coloring - $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 - $totalTransactionsCount
—
int
Contains count of transactions available - $transactionsDb
—
Transactions database abstraction layer placeholder - $transactionsProcess
—
Transactions processing StarDust placeholder - $ubConfig
—
Placeholder for UbillingConfig object - $wholeTransactions
—
array
Contains full list of preloaded transactions
Methods
protected
- generateUniquePaymentId() — Generates unique payment ID of configurable length
- getUnprocessedTransactions() — Returns plain array of not processed transactions
- 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
- initStarDust() — Inits StarDust process manager for payment transactions processing
- 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
- processTransaction() — Performs transaction processing
- renderChartsYearForm() — Renders year selection form for charts
- setTransactionProcessed() — Sets transaction processed by its ID
public
- __construct() — Creates new OpenPayz instance
- 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
- jsonTransactionsList() — Renders json transactions list
- 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
- renderTransactionsList() — Returns transactions list container
- transactionGetData() — Returns openpayz transaction data by its ID
- transactionsLoader() — Performs transactions filtering, ordering and load for ajax list
- transactionsProcessingAll() — Performs processing of all unprocessed transctions in database