Permalink
Browse files

simplify the naming of xml getter

  • Loading branch information...
1 parent ff14ab3 commit 0691c6cfa3c8883df1a7097fbf3b91b8ae0dddf1 @robacarp robacarp committed Feb 25, 2013
Showing with 2 additions and 28 deletions.
  1. +0 −26 Shipping/Endicia/Account.php
  2. +2 −2 Shipping/Endicia/Quoter.php
@@ -56,32 +56,6 @@ private function pullAccountStatus(){
return true;
}
-
- //
- // From the old API code
- //
- // if we've less than $100 available, refill
- // NOTE: also check to see if the balance is over $1bn and refill if it is.
- // Endicia's crack API returns a 17 digit number (~ 18 quadrillion) when our
- // balance goes negative, which can only happen if a single label is so expensive
- // it blows right past our $100 window. This is a dirty hacky fix that needs to
- // be addressed at the account/administrative level with Endicia.
- //
- // $account_status_response = $this->label_server->xmlAccountStatusRequest();
- // if(!preg_match('/<PostageBalance>([^<]*)/', $account_status_response, $matches)) {
- // die('Tried to get account balance and this was the response:<br/>' . $account_status_response . '<br/>');
- // } else {
- // if(is_numeric($matches[1])) {
- // if ( ($matches[1] < 1000) || ($matches[1] > 1000000000) ) {
- // $desired_postage = 1500;
- // $recredit_request_response = $this->label_server->xmlRecreditRequest($desired_postage);
- // }
- // } else {
- // die('Returned postage balance of ' . $matches[1] . '...wtf?<br/>');
- // }
- // }
- // break;
-
public function buyPostage($amount){
$this->request_type = 'BuyPostageXML';
$this->post_prefix = 'recreditRequestXML';
@@ -54,7 +54,7 @@ public function quote(){
$this->request_type = 'CalculatePostageRatesXML';
$this->post_prefix = 'postageRatesRequestXML';
- $this->xml = $this->fetchQuoteXML();
+ $this->xml = $this->quoteXML();
$this->request();
@@ -78,7 +78,7 @@ public function quote(){
*
* @return string xml to be sent to Endicia servers
*/
- public function fetchQuoteXML(){
+ public function quoteXML(){
// domestic postal codes can only be 5 digits
$postal_code = $this->to->international ? $this->to->postal_code
: substr($this->to->postal_code, 0, 5);

0 comments on commit 0691c6c

Please sign in to comment.