My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.picmart;

import java.io.IOException;
import java.util.List;
import java.util.logging.Logger;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gdata.client.photos.PicasawebService;
import com.google.gdata.data.photos.AlbumEntry;
import com.google.gdata.data.photos.PhotoEntry;
import com.paypal.adaptive.api.requests.fnapi.ParallelPay;
import com.paypal.adaptive.api.responses.PayResponse;
import com.paypal.adaptive.core.APICredential;
import com.paypal.adaptive.core.AckCode;
import com.paypal.adaptive.core.CurrencyCodes;
import com.paypal.adaptive.core.PaymentType;
import com.paypal.adaptive.core.Receiver;
import com.paypal.adaptive.core.ServiceEnvironment;
import com.paypal.adaptive.exceptions.AuthorizationRequiredException;
import com.paypal.adaptive.exceptions.InvalidAPICredentialsException;
import com.paypal.adaptive.exceptions.InvalidResponseDataException;
import com.paypal.adaptive.exceptions.MissingAPICredentialsException;
import com.paypal.adaptive.exceptions.MissingParameterException;
import com.paypal.adaptive.exceptions.NotEnoughReceivers;
import com.paypal.adaptive.exceptions.PayPalErrorException;
import com.paypal.adaptive.exceptions.PaymentExecException;
import com.paypal.adaptive.exceptions.PaymentInCompleteException;
import com.paypal.adaptive.exceptions.ReceiversCountMismatchException;
import com.paypal.adaptive.exceptions.RequestAlreadyMadeException;
import com.paypal.adaptive.exceptions.RequestFailureException;

@SuppressWarnings("serial")
public class PicMartServlet extends HttpServlet {
private static final Logger log = Logger.getLogger(PicMartServlet.class.getName());


public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
try {
String success = req.getParameter("return");
String cancel = req.getParameter("cancel");

if(cancel != null && cancel.equals("1")) {
// user canceled the payment
getServletConfig().getServletContext().getRequestDispatcher("/paymentcancel.jsp").forward(req, resp);

} else if(success != null && success.equals("1")){
getServletConfig().getServletContext().getRequestDispatcher("/paymentsuccess.jsp").forward(req, resp);
} else {
getServletConfig().getServletContext().getRequestDispatcher("/gallery.jsp").forward(req, resp);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

Change log

r17 by PPX.DevNet on May 8, 2011   Diff
adding new classes for all new changes to
Adaptive Payments - set/getPaymentOptions,
getfundingPlans, getShippingAddresses,
support for new embedded payments and many
more new parameters added to various
existing requests and responses
Go to: 
Project members, sign in to write a code review

Older revisions

r7 by PPX.DevNet on May 19, 2010   Diff
adding sample exlipse projects - one
scratch pad for AP apis, one scratch
pad for functional apis built on top
of AP, and PicMart a sample photo
printing app
All revisions of this file

File info

Size: 2527 bytes, 61 lines
Powered by Google Project Hosting