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
054 public class ShoppingOrderServiceHttp {
055 public static void completeOrder(HttpPrincipal httpPrincipal, long groupId,
056 java.lang.String number, java.lang.String ppTxnId,
057 java.lang.String ppPaymentStatus, double ppPaymentGross,
058 java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail,
059 com.liferay.portal.service.ServiceContext serviceContext)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 try {
063 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
064 "completeOrder", _completeOrderParameterTypes0);
065
066 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
067 number, ppTxnId, ppPaymentStatus, ppPaymentGross,
068 ppReceiverEmail, ppPayerEmail, serviceContext);
069
070 try {
071 TunnelUtil.invoke(httpPrincipal, methodHandler);
072 }
073 catch (Exception e) {
074 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075 throw (com.liferay.portal.kernel.exception.PortalException)e;
076 }
077
078 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
079 throw (com.liferay.portal.kernel.exception.SystemException)e;
080 }
081
082 throw new com.liferay.portal.kernel.exception.SystemException(e);
083 }
084 }
085 catch (com.liferay.portal.kernel.exception.SystemException se) {
086 _log.error(se, se);
087
088 throw se;
089 }
090 }
091
092 public static void deleteOrder(HttpPrincipal httpPrincipal, long groupId,
093 long orderId)
094 throws com.liferay.portal.kernel.exception.PortalException,
095 com.liferay.portal.kernel.exception.SystemException {
096 try {
097 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
098 "deleteOrder", _deleteOrderParameterTypes1);
099
100 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
101 orderId);
102
103 try {
104 TunnelUtil.invoke(httpPrincipal, methodHandler);
105 }
106 catch (Exception e) {
107 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108 throw (com.liferay.portal.kernel.exception.PortalException)e;
109 }
110
111 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
112 throw (com.liferay.portal.kernel.exception.SystemException)e;
113 }
114
115 throw new com.liferay.portal.kernel.exception.SystemException(e);
116 }
117 }
118 catch (com.liferay.portal.kernel.exception.SystemException se) {
119 _log.error(se, se);
120
121 throw se;
122 }
123 }
124
125 public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
126 HttpPrincipal httpPrincipal, long groupId, long orderId)
127 throws com.liferay.portal.kernel.exception.PortalException,
128 com.liferay.portal.kernel.exception.SystemException {
129 try {
130 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
131 "getOrder", _getOrderParameterTypes2);
132
133 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
134 orderId);
135
136 Object returnObj = null;
137
138 try {
139 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
140 }
141 catch (Exception e) {
142 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
143 throw (com.liferay.portal.kernel.exception.PortalException)e;
144 }
145
146 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
147 throw (com.liferay.portal.kernel.exception.SystemException)e;
148 }
149
150 throw new com.liferay.portal.kernel.exception.SystemException(e);
151 }
152
153 return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
154 }
155 catch (com.liferay.portal.kernel.exception.SystemException se) {
156 _log.error(se, se);
157
158 throw se;
159 }
160 }
161
162 public static void sendEmail(HttpPrincipal httpPrincipal, long groupId,
163 long orderId, java.lang.String emailType,
164 com.liferay.portal.service.ServiceContext serviceContext)
165 throws com.liferay.portal.kernel.exception.PortalException,
166 com.liferay.portal.kernel.exception.SystemException {
167 try {
168 MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
169 "sendEmail", _sendEmailParameterTypes3);
170
171 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
172 orderId, emailType, serviceContext);
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,
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,
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 com.liferay.portal.service.ServiceContext.class
301 };
302 private static final Class<?>[] _deleteOrderParameterTypes1 = new Class[] {
303 long.class, long.class
304 };
305 private static final Class<?>[] _getOrderParameterTypes2 = new Class[] {
306 long.class, long.class
307 };
308 private static final Class<?>[] _sendEmailParameterTypes3 = new Class[] {
309 long.class, long.class, java.lang.String.class,
310 com.liferay.portal.service.ServiceContext.class
311 };
312 private static final Class<?>[] _updateOrderParameterTypes4 = new Class[] {
313 long.class, long.class, java.lang.String.class,
314 java.lang.String.class, double.class, java.lang.String.class,
315 java.lang.String.class
316 };
317 private static final Class<?>[] _updateOrderParameterTypes5 = new Class[] {
318 long.class, long.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, java.lang.String.class,
322 java.lang.String.class, java.lang.String.class,
323 java.lang.String.class, boolean.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,
328 java.lang.String.class, java.lang.String.class,
329 java.lang.String.class, java.lang.String.class, int.class, int.class,
330 java.lang.String.class, java.lang.String.class
331 };
332 }