Public Member Functions | |
authorize () | |
charge ($amount) | |
refund ($amount, $reason, $comment='') | |
cancel ($reason, $comment='') | |
process () | |
deliver ($carrier, $trackingNo, $sendMail=true) | |
addTrackingData ($carrier, $trackingNo) | |
shipItems ($items, $sendMail=true) | |
backorderItems ($items, $sendMail=true) | |
cancelItems ($items, $reason, $comment='', $sendMail=true) | |
returnItems ($items, $sendMail=true) | |
resetItems ($items, $sendMail=true) | |
archive () | |
unarchive () | |
addOrderNumber ($merchantOrder) | |
addBuyerMessage ($message, $sendMail=true) | |
Protected Member Functions | |
_getApiUrl () | |
_processGResponse ($response) |
Definition at line 27 of file Order.php.
_getApiUrl | ( | ) | [protected] |
Reimplemented from Mage_GoogleCheckout_Model_Api_Xml_Abstract.
Definition at line 29 of file Order.php.
00030 { 00031 $url = $this->_getBaseApiUrl(); 00032 $url .= 'request/Merchant/'.Mage::getStoreConfig('google/checkout/merchant_id', $this->getStoreId()); 00033 return $url; 00034 }
_processGResponse | ( | $ | response | ) | [protected] |
Definition at line 36 of file Order.php.
00037 { 00038 if ($response[0]===200) { 00039 return true; 00040 } else { 00041 $xml = simplexml_load_string(html_entity_decode($response[1])); 00042 if (!$xml || !$xml->{'error-message'}) { 00043 return false; 00044 } 00045 Mage::throwException($this->__('Google Checkout: %s', (string)$xml->{'error-message'})); 00046 } 00047 }
addBuyerMessage | ( | $ | message, | |
$ | sendMail = true | |||
) |
Definition at line 172 of file Order.php.
00173 { 00174 $response = $this->getGRequest() 00175 ->SendBuyerMessage($this->getGoogleOrderNumber(), $message, $sendMail?'true':'false'); 00176 return $this->_processGResponse($response); 00177 }
addOrderNumber | ( | $ | merchantOrder | ) |
Definition at line 164 of file Order.php.
00165 { 00166 $response = $this->getGRequest() 00167 ->SendMerchantOrderNumber($this->getGoogleOrderNumber(), $merchantOrder); 00168 return $this->_processGResponse($response); 00169 }
addTrackingData | ( | $ | carrier, | |
$ | trackingNo | |||
) |
Definition at line 101 of file Order.php.
00102 { 00103 $response = $this->getGRequest() 00104 ->SendTrackingData($this->getGoogleOrderNumber(), $carrier, $trackingNo); 00105 return $this->_processGResponse($response); 00106 }
archive | ( | ) |
Definition at line 150 of file Order.php.
00151 { 00152 $response = $this->getGRequest() 00153 ->SendArchiveOrder($this->getGoogleOrderNumber()); 00154 return $this->_processGResponse($response); 00155 }
authorize | ( | ) |
Definition at line 51 of file Order.php.
00052 { 00053 $GRequest = $this->getGRequest(); 00054 00055 $postargs = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> 00056 <authorize-order xmlns=\"".$GRequest->schema_url. 00057 "\" google-order-number=\"". $this->getGoogleOrderNumber() . "\"/>"; 00058 00059 $response = $GRequest->SendReq($GRequest->request_url, 00060 $GRequest->GetAuthenticationHeaders(), $postargs); 00061 return $this->_processGResponse($response); 00062 }
backorderItems | ( | $ | items, | |
$ | sendMail = true | |||
) |
Definition at line 120 of file Order.php.
00121 { 00122 $response = $this->getGRequest() 00123 ->SendBackorderItems($this->getGoogleOrderNumber(), $items, $sendMail?'true':'false'); 00124 return $this->_processGResponse($response); 00125 }
cancel | ( | $ | reason, | |
$ | comment = '' | |||
) |
Definition at line 78 of file Order.php.
00079 { 00080 $response = $this->getGRequest() 00081 ->SendCancelOrder($this->getGoogleOrderNumber(), $reason, $comment); 00082 return $this->_processGResponse($response); 00083 }
cancelItems | ( | $ | items, | |
$ | reason, | |||
$ | comment = '' , |
|||
$ | sendMail = true | |||
) |
Definition at line 127 of file Order.php.
00128 { 00129 $response = $this->getGRequest() 00130 ->SendCancelItems($this->getGoogleOrderNumber(), $items, $reason, $comment, $sendMail?'true':'false'); 00131 return $this->_processGResponse($response); 00132 }
charge | ( | $ | amount | ) |
Definition at line 64 of file Order.php.
00065 { 00066 $response = $this->getGRequest() 00067 ->SendChargeOrder($this->getGoogleOrderNumber(), $amount); 00068 return $this->_processGResponse($response); 00069 }
deliver | ( | $ | carrier, | |
$ | trackingNo, | |||
$ | sendMail = true | |||
) |
Definition at line 94 of file Order.php.
00095 { 00096 $response = $this->getGRequest() 00097 ->SendDeliverOrder($this->getGoogleOrderNumber(), $carrier, $trackingNo, $sendMail?'true':'false'); 00098 return $this->_processGResponse($response); 00099 }
process | ( | ) |
Definition at line 87 of file Order.php.
00088 { 00089 $response = $this->getGRequest() 00090 ->SendProcessOrder($this->getGoogleOrderNumber()); 00091 return $this->_processGResponse($response); 00092 }
refund | ( | $ | amount, | |
$ | reason, | |||
$ | comment = '' | |||
) |
Definition at line 71 of file Order.php.
00072 { 00073 $response = $this->getGRequest() 00074 ->SendRefundOrder($this->getGoogleOrderNumber(), $amount, $reason, $comment); 00075 return $this->_processGResponse($response); 00076 }
resetItems | ( | $ | items, | |
$ | sendMail = true | |||
) |
Definition at line 141 of file Order.php.
00142 { 00143 $response = $this->getGRequest() 00144 ->SendRResetItemsShippingInformation($this->getGoogleOrderNumber(), $items, $sendMail?'true':'false'); 00145 return $this->_processGResponse($response); 00146 }
returnItems | ( | $ | items, | |
$ | sendMail = true | |||
) |
Definition at line 134 of file Order.php.
00135 { 00136 $response = $this->getGRequest() 00137 ->SendReturnItems($this->getGoogleOrderNumber(), $items, $sendMail?'true':'false'); 00138 return $this->_processGResponse($response); 00139 }
shipItems | ( | $ | items, | |
$ | sendMail = true | |||
) |
Definition at line 108 of file Order.php.
00109 { 00110 $googleShipItems = array(); 00111 foreach ($items as $item) { 00112 $googleShipItems[] = new GoogleShipItem($item); 00113 } 00114 00115 $response = $this->getGRequest() 00116 ->SendShipItems($this->getGoogleOrderNumber(), $googleShipItems, $sendMail?'true':'false'); 00117 return $this->_processGResponse($response); 00118 }
unarchive | ( | ) |
Definition at line 157 of file Order.php.
00158 { 00159 $response = $this->getGRequest() 00160 ->SendUnarchiveOrder($this->getGoogleOrderNumber()); 00161 return $this->_processGResponse($response); 00162 }