我要實現我的春天web應用程序的貝寶自適應支付。我參考下面的鏈接和執行流https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/gs_AdaptivePayments/我如何獲得貝寶自適應支付報酬響應
我按照以下步驟, 第1步: 獲取Paykey通過使用沙箱API憑證
公共類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);
}
步驟2: 我已經解析了Jsoup響應,並獲得PayKey,我已經送https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=My-payKey
後付款成功後貝寶重定向控制到http://www.mytestapp.com/getPaypalResponse。但問題是我無法獲得響應參數。我無法獲得paykey,receiveremail,ack等答覆參數......我不知道我的錯誤是什麼。請糾正我,如果我錯了
感謝 塞特希乙