Example #1
0
 /**
  * @param \TpMerchantConfig $config
  * @param float $price
  */
 public function __construct(\TpMerchantConfig $config, $price)
 {
     parent::__construct($config);
     $this->setValue($price);
 }
Example #2
0
 /**
  * Constructor.
  * @param args Optional arguments parameter, that can specify the
  *   arguments of the returned payment. If not specified, it is taken
  *   from the $_REQUEST superglobal array.
  */
 function __construct(TpMerchantConfig $config, $args = NULL)
 {
     parent::__construct($config);
     if (is_null($args)) {
         $args =& $_REQUEST;
     }
     if (!empty($args['merchantId'])) {
         $this->requestMerchantId = $args['merchantId'];
     }
     if (!empty($args['accountId'])) {
         $this->requestAccountId = $args['accountId'];
     }
     foreach (self::$REQUIRED_ARGS as $arg) {
         if (!isset($args[$arg])) {
             throw new TpMissingParameterException($arg);
         }
         $this->{$arg} = $args[$arg];
     }
     foreach (self::$OPTIONAL_ARGS_DEFAULT as $arg => $defaultValue) {
         if (!isset($args[$arg])) {
             $this->{$arg} = $defaultValue;
         } else {
             $this->{$arg} = $args[$arg];
         }
     }
     $this->signature = $args["signature"];
 }