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