001
014
015 package com.liferay.portlet.shopping.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil;
025
026
056 public class ShoppingOrderServiceHttp {
057 public static void completeOrder(HttpPrincipal httpPrincipal, long groupId,
058 java.lang.String number, java.lang.String ppTxnId,
059 java.lang.String ppPaymentStatus, double ppPaymentGross,
060 java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
065 "completeOrder", _completeOrderParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
068 number, ppTxnId, ppPaymentStatus, ppPaymentGross,
069 ppReceiverEmail, ppPayerEmail);
070
071 try {
072 TunnelUtil.invoke(httpPrincipal, methodHandler);
073 }
074 catch (Exception e) {
075 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
076 throw (com.liferay.portal.kernel.exception.PortalException)e;
077 }
078
079 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
080 throw (com.liferay.portal.kernel.exception.SystemException)e;
081 }
082
083 throw new com.liferay.portal.kernel.exception.SystemException(e);
084 }
085 }
086 catch (com.liferay.portal.kernel.exception.SystemException se) {
087 _log.error(se, se);
088
089 throw se;
090 }
091 }
092
093 public static void deleteOrder(HttpPrincipal httpPrincipal, long groupId,
094 long orderId)
095 throws com.liferay.portal.kernel.exception.PortalException,
096 com.liferay.portal.kernel.exception.SystemException {
097 try {
098 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
099 "deleteOrder", _deleteOrderParameterTypes1);
100
101 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
102 orderId);
103
104 try {
105 TunnelUtil.invoke(httpPrincipal, methodHandler);
106 }
107 catch (Exception e) {
108 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
109 throw (com.liferay.portal.kernel.exception.PortalException)e;
110 }
111
112 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
113 throw (com.liferay.portal.kernel.exception.SystemException)e;
114 }
115
116 throw new com.liferay.portal.kernel.exception.SystemException(e);
117 }
118 }
119 catch (com.liferay.portal.kernel.exception.SystemException se) {
120 _log.error(se, se);
121
122 throw se;
123 }
124 }
125
126 public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
127 HttpPrincipal httpPrincipal, long groupId, long orderId)
128 throws com.liferay.portal.kernel.exception.PortalException,
129 com.liferay.portal.kernel.exception.SystemException {
130 try {
131 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
132 "getOrder", _getOrderParameterTypes2);
133
134 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
135 orderId);
136
137 Object returnObj = null;
138
139 try {
140 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153
154 return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
155 }
156 catch (com.liferay.portal.kernel.exception.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static void sendEmail(HttpPrincipal httpPrincipal, long groupId,
164 long orderId, java.lang.String emailType)
165 throws com.liferay.portal.kernel.exception.PortalException,
166 com.liferay.portal.kernel.exception.SystemException {
167 try {
168 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
169 "sendEmail", _sendEmailParameterTypes3);
170
171 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
172 orderId, emailType);
173
174 try {
175 TunnelUtil.invoke(httpPrincipal, methodHandler);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
179 throw (com.liferay.portal.kernel.exception.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
183 throw (com.liferay.portal.kernel.exception.SystemException)e;
184 }
185
186 throw new com.liferay.portal.kernel.exception.SystemException(e);
187 }
188 }
189 catch (com.liferay.portal.kernel.exception.SystemException se) {
190 _log.error(se, se);
191
192 throw se;
193 }
194 }
195
196 public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
197 HttpPrincipal httpPrincipal, long groupId, long orderId,
198 java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
199 double ppPaymentGross, java.lang.String ppReceiverEmail,
200 java.lang.String ppPayerEmail)
201 throws com.liferay.portal.kernel.exception.PortalException,
202 com.liferay.portal.kernel.exception.SystemException {
203 try {
204 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
205 "updateOrder", _updateOrderParameterTypes4);
206
207 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
208 orderId, ppTxnId, ppPaymentStatus, ppPaymentGross,
209 ppReceiverEmail, ppPayerEmail);
210
211 Object returnObj = null;
212
213 try {
214 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
215 }
216 catch (Exception e) {
217 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
218 throw (com.liferay.portal.kernel.exception.PortalException)e;
219 }
220
221 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
222 throw (com.liferay.portal.kernel.exception.SystemException)e;
223 }
224
225 throw new com.liferay.portal.kernel.exception.SystemException(e);
226 }
227
228 return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
229 }
230 catch (com.liferay.portal.kernel.exception.SystemException se) {
231 _log.error(se, se);
232
233 throw se;
234 }
235 }
236
237 public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
238 HttpPrincipal httpPrincipal, long groupId, long orderId,
239 java.lang.String billingFirstName, java.lang.String billingLastName,
240 java.lang.String billingEmailAddress, java.lang.String billingCompany,
241 java.lang.String billingStreet, java.lang.String billingCity,
242 java.lang.String billingState, java.lang.String billingZip,
243 java.lang.String billingCountry, java.lang.String billingPhone,
244 boolean shipToBilling, java.lang.String shippingFirstName,
245 java.lang.String shippingLastName,
246 java.lang.String shippingEmailAddress,
247 java.lang.String shippingCompany, java.lang.String shippingStreet,
248 java.lang.String shippingCity, java.lang.String shippingState,
249 java.lang.String shippingZip, java.lang.String shippingCountry,
250 java.lang.String shippingPhone, java.lang.String ccName,
251 java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
252 int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
253 throws com.liferay.portal.kernel.exception.PortalException,
254 com.liferay.portal.kernel.exception.SystemException {
255 try {
256 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
257 "updateOrder", _updateOrderParameterTypes5);
258
259 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
260 orderId, billingFirstName, billingLastName,
261 billingEmailAddress, billingCompany, billingStreet,
262 billingCity, billingState, billingZip, billingCountry,
263 billingPhone, shipToBilling, shippingFirstName,
264 shippingLastName, shippingEmailAddress, shippingCompany,
265 shippingStreet, shippingCity, shippingState, shippingZip,
266 shippingCountry, shippingPhone, ccName, ccType, ccNumber,
267 ccExpMonth, ccExpYear, ccVerNumber, comments);
268
269 Object returnObj = null;
270
271 try {
272 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
273 }
274 catch (Exception e) {
275 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
276 throw (com.liferay.portal.kernel.exception.PortalException)e;
277 }
278
279 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
280 throw (com.liferay.portal.kernel.exception.SystemException)e;
281 }
282
283 throw new com.liferay.portal.kernel.exception.SystemException(e);
284 }
285
286 return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
287 }
288 catch (com.liferay.portal.kernel.exception.SystemException se) {
289 _log.error(se, se);
290
291 throw se;
292 }
293 }
294
295 private static Log _log = LogFactoryUtil.getLog(ShoppingOrderServiceHttp.class);
296 private static final Class<?>[] _completeOrderParameterTypes0 = new Class[] {
297 long.class, java.lang.String.class, java.lang.String.class,
298 java.lang.String.class, double.class, java.lang.String.class,
299 java.lang.String.class
300 };
301 private static final Class<?>[] _deleteOrderParameterTypes1 = new Class[] {
302 long.class, long.class
303 };
304 private static final Class<?>[] _getOrderParameterTypes2 = new Class[] {
305 long.class, long.class
306 };
307 private static final Class<?>[] _sendEmailParameterTypes3 = new Class[] {
308 long.class, long.class, java.lang.String.class
309 };
310 private static final Class<?>[] _updateOrderParameterTypes4 = new Class[] {
311 long.class, long.class, java.lang.String.class,
312 java.lang.String.class, double.class, java.lang.String.class,
313 java.lang.String.class
314 };
315 private static final Class<?>[] _updateOrderParameterTypes5 = new Class[] {
316 long.class, long.class, java.lang.String.class,
317 java.lang.String.class, java.lang.String.class,
318 java.lang.String.class, java.lang.String.class,
319 java.lang.String.class, java.lang.String.class,
320 java.lang.String.class, java.lang.String.class,
321 java.lang.String.class, boolean.class, java.lang.String.class,
322 java.lang.String.class, java.lang.String.class,
323 java.lang.String.class, java.lang.String.class,
324 java.lang.String.class, java.lang.String.class,
325 java.lang.String.class, java.lang.String.class,
326 java.lang.String.class, java.lang.String.class,
327 java.lang.String.class, java.lang.String.class, int.class, int.class,
328 java.lang.String.class, java.lang.String.class
329 };
330 }