/** * Set current message namespace * * @static * @param string $value * @return void */ private static function _setNamespace($value) { self::$_namespace = $value; }
public function __construct() { $this->_messages = Axis_Message::getInstance()->get(); }
/** * Use Token * */ public function runGetExpressCheckoutDetails() { $response = $this->getApi()->GetExpressCheckoutDetails($this->getStorage()->token); $this->log("Run GetExpressCheckoutDetails \n" . "Token: " . $this->getStorage()->token . "\n" . "Response: " . Zend_Debug::dump($response, null, false)); if ($response['ACK'] != 'Success') { $message = "\n\tFailure GetExpressCheckoutDetails\n"; $this->log($message); Axis_Message::getInstance()->addError($message); return false; } if (empty($response['PAYERID'])) { return false; } if (!is_array($this->getStorage()->payer)) { $this->getStorage()->payer = array(); } $this->getStorage()->payer = array_merge($this->getStorage()->payer, array('payer_id' => $response['PAYERID'], 'payer_email' => urldecode($response['EMAIL']))); // Alert customer that they've selected an unconfirmed address // at PayPal, and must go back and choose a Confirmed one if ($this->_config->confirmedAddress && $response['ADDRESSSTATUS'] != 'Confirmed') { $message = "\n\tFailure GetExpressCheckoutDetails ADDRESSSTATUS not confirmed \n"; $this->log($message); Axis_Message::getInstance()->addError($message); return false; } if (!isset($response['ADDRESSSTATUS']) || $response['ADDRESSSTATUS'] == 'None') { return false; } if (empty($response['SHIPTOSTREET2'])) { $response['SHIPTOSTREET2'] = ''; } // accomodate PayPal bug which repeats 1st line of address // for 2nd line if 2nd line is empty. if ($response['SHIPTOSTREET2'] == $response['SHIPTOSTREET']) { $response['SHIPTOSTREET2'] = ''; } // accomodate PayPal bug which incorrectly treats 'Yukon Territory' // as YK instead of ISO standard of YT. if ($response['SHIPTOSTATE'] == 'YK') { $response['SHIPTOSTATE'] = 'YT'; } // same with Newfoundland if ($response['SHIPTOSTATE'] == 'NF') { $response['SHIPTOSTATE'] = 'NL'; } return $response; }
/** * Retrieve Axis_Message object * * @static * @return Axis_Message */ public static function message($namespace = 'messenger') { return Axis_Message::getInstance($namespace); }