好吧,我會在那個問題上回答我自己,然後讀一下。
而不是使用調用AdaptivePayments/Pay
時給定的payKey,而其他解決方案是使用trackingId。
方法如下:
第一步,創建一個AdaptivePayments/Pay
並指定trackingId(必須是唯一的):
{
"actionType":"PAY",
"currencyCode":"USD",
"receiverList":{"receiver":[{"amount":"1.00","email":"[email protected]"}]},
"returnUrl":"http://apigee.com/console/-1/handlePaypalReturn",
"cancelUrl":"http://apigee.com/console/-1/handlePaypalCancel?",
"trackingId":"abcde-12345-unique-of-course",
"ipnNotificationUrl":"http://apigee.com/console/-1/ipn",
"requestEnvelope":{"errorLanguage":"en_US", "detailLevel":"ReturnAll"}
}
對此,你將有你重定向payKey您買方爲了做付款。
然後,對於此付款的整個演變,您將被通知到您的IPN網址(這裏,「http://apigee.com/console/-1/ipn」)。
當您在此地址收到(POST)請求時,檢查paypal的有效性,您將在參數中獲得trackingId
。檢查這個trackingId存在,然後問AdaptivePayments/PaymentDetails
與trackingId這樣的:
{
"trackingId":"{put here}",
"requestEnvelope":{"errorLanguage":"en_US", "detailLevel":"ReturnAll"}
}
,你將有回報付款的完整的相關詳細情況。
現在,你做的工作,以更新數據庫,打電話給你的買家,等等等等:)
什麼妄作:
不錯的一個! Paypal文檔太複雜了,很難理解這個過程。 –