Documentation

GetList

CDBResult
CSalePaySystem::GetList(
 array arOrder = Array("SORT"=>"ASC", "NAME"=>"ASC"),
 array arFilter = Array()
);

The method GetList returns an optionally sorted and filtered list of pay systems.

Parameters

ParameterDescription
arOrder Associated array used to sort records. The sorting is performed consequently on each pair "key-value". Keys are the parameter names. Values are sort direction constants.

The following keys are possible:
  • SORT - sort weight;
  • NAME - the pay system name;
  • PSA_NAME - the pay system handler name;
  • LID - the pay system site ID;
  • ID - the pay system ID;
  • ACTIVE - flag (Y/N) indicating the pay system is active;
  • CURRENCY - the pay system currency.
Possible values:
  • ASC - ascending;
  • DESC - descending.
arFilter Associated array used to filter records. Only the records which satisfy the filter are included in the returned list. Keys are the parameter names, and the values are conditions.

The following keys are possible:
  • ID - the pay system ID;
  • LID - the pay system site ID;
  • CURRENCY - the pay system currency;
  • ACTIVE - flag (Y/N) indicating the pay system is active;
  • NAME - the pay system name;
  • PERSON_TYPE_ID - the payer type ID. If set to other than null, the method returns parameters of the corresponding pay system handler as well.

Returned values

Returns a CDBResult instance containing a set of associated arrays with the following keys.

Key Description
ID The pay system ID.
LID The ID of the site owning this pay system.
CURRENCY Currency handled by the pay system.
NAME The name of the pay system
ACTIVE Specifies the pay system is active (Y/N).
SORT Sort weight.
DESCRIPTION Pay system description.
PSA_ID The ID of the pay system handler (returned if PERSON_TYPE_ID is not null).
PSA_NAME Handler name (returned if PERSON_TYPE_ID is not null).
PSA_ACTION_FILE Name of the script file containing handler (returned if PERSON_TYPE_ID is not null).
PSA_RESULT_FILE Name of the script file containing the pay system result handler (returned if PERSON_TYPE_ID is not null).
PSA_NEW_WINDOW Specifies the script is to be executed in the new window (Y/N) (returned if PERSON_TYPE_ID is not null).

Example


<?
// Display all active pay systems of the current site 
// for the payer type 2
// we want pay systems that can handle GBP
$db_ptype = CSalePaySystem::GetList($arOrder = Array("SORT"=>"ASC", 
                                                     "PSA_NAME"=>"ASC"), 
                                    Array("LID"=>SITE_ID, 
                                          "CURRENCY"=>"RUR", 
                                          "ACTIVE"=>"Y", 
                                          "PERSON_TYPE_ID"=>2));
$bFirst = True;
while ($ptype = $db_ptype->Fetch())
{
   ?><input 
      type="radio" 
      name="PAY_SYSTEM_ID" 
      value="<?echo $ptype["ID"] ?>"<?if ($bFirst) echo " checked";?>><b>
      <?echo $ptype["PSA_NAME"] ?></b><br><?
   $bFirst = False;
   if (strlen($ptype["DESCRIPTION"])>0)
      echo $ptype["DESCRIPTION"]."<br>";
   ?><hr size="1" width="90%"><?
}
?>
© «Bitrix24», 2001-2024
Up