Example #1
0
 /**
  * Initialize internal state of the paypal class
  *
  * @param 	string      $description        the text description for the payment
  * @param   string      $bookingref         the ID or reference for this reservation
  * @param   string      $chargetotal        the total amount to be charged
  * @deprecated @see RM_PayPal_Service
  */
 function initialize($description, $bookingref, $chargetotal)
 {
     if (!$bookingref) {
         return false;
     }
     // fail if no booking reference
     if (!$chargetotal) {
         return false;
     }
     // fail if no total to charge.
     // make sure that a decimal . is passed not a comma or anything else.
     if (strpos($chargetotal, ",") > 0) {
         $chargetotal = str_replace(",", ".", $chargetotal);
     }
     $config = $this->_getConfig();
     if (!$config) {
         return false;
     }
     // fail if no config
     $configModel = new RM_config();
     $this->_addField('business', $config['account']);
     $this->_addField('return', RM_Environment::getInstance()->getRouter()->_('PayPal', 'success'));
     $this->_addField('cancel_return', RM_Environment::getInstance()->getRouter()->_('PayPal', 'cancel'));
     $this->_addField('notify_url', RM_Environment::getInstance()->getRouter()->_('PayPal', 'ipn'));
     $this->_addField('item_name', $description);
     $this->_addField('invoice', "RM-" . $bookingref);
     // paypay does not accept a numeric value for this so the reference is preceeded with RM-
     $this->_addField('currency_code', $configModel->getValue('rm_config_currency_iso'));
     $this->_addField('amount', $chargetotal);
     return $this;
 }
Example #2
0
 /**
  * Convert current date into string in GUI Datetime format
  *
  * @return string
  */
 public function toGUI()
 {
     $RM_Config = new RM_config();
     $dateformat = $RM_Config->getValue('rm_config_dateformat');
     return $this->toString($dateformat);
 }