i want to implement paypal adaptive payment for my spring web application. i refer the following link and implement flow https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/gs_AdaptivePayments/
i have followed following steps, Step 1: Get Paykey by using sandbox API credentials
public class AdaptiveinstantPay {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("https://svcs.sandbox.paypal.com/AdaptivePayments/Pay")
.header("X-PAYPAL-SECURITY-USERID", "xxxxxx_api1.comforters-it.com")
.header("X-PAYPAL-SECURITY-PASSWORD", "xxxxxxxxxx")
.header("X-PAYPAL-SECURITY-SIGNATURE", "AiPC9BjkCyDFQXbSkoZcgqH3hpacATgu-TD5fG94GO04KCRlPl1d4hW4")
.header("X-PAYPAL-REQUEST-DATA-FORMAT", "NV")
.header("X-PAYPAL-RESPONSE-DATA-FORMAT", "NV")
.header("X-PAYPAL-APPLICATION-ID", "APP-80W284485P519543T")
.data("actionType", "PAY")
.data("currencyCode", "EUR")
.data("receiverList.receiver(0).amount", "55")
.data("receiverList.receiver(0).email", "[email protected]")
.data("returnUrl", "http://www.mytestapp.com/getPaypalResponse")
.data("cancelUrl", "http://www.mytestapp.com/cancelPaypalPayment")
.data("requestEnvelope", "{errorLanguage:en_US, detailLevel:ReturnAll }")
.timeout(10 * 1000).post();
System.out.println(doc);
}
Step 2: i have parsed the Jsoup response and get the PayKey, After i have send https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=My-payKey
After payment success paypal redirect control to http://www.mytestapp.com/getPaypalResponse. But problem is i can't get response parameters. I unable get response parameters like paykey, receiveremail, ack ect... i dont know what is my mistake. Please correct me if i'm wrong
Thanks SENTHIL B