How to implement PayPal Advanced Silent Post properly?

时间:2015-07-28 23:23:47

标签: asp.net iframe paypal silent-post

I have implemented PayPal's Payments Advanced with Template C to handle both PayPal payments and Credit Cards without 'leaving' my website. I've coded my own cart successfully in Net (VB). I have token request web.request and the IFRAME built on the token response working. My mega-confusion is this: In the setup in PayPal Manager, you indicate a 'return' page, but ALSO indicate a 'Silent Post' page that receives the transaction results from a successful Credit Card or PayPal payment transaction, and a Silent Post FAIL page if the transaction fails.

What I don't understand, and what no one at PayPal seems to be able to clarify is how to handle the Silent Post page. I understand how to process the transaction validation from PayPal after payment is made, and how to break out of the IFrame, but don't understand a simple concept:

Shouldn't the RETURN page and the SILENT POST page be one and the same? If not, how would one handle the POST data?

I want to process the VALIDATED order AFTER I get verification from PayPal, not before (although I am also posting it in a 'pre-approval' database table as PENDING so if it blows up, I at least have the customer's order items and can help them complete the order...) So, what I've been doing is using the same page for SILENT POST as RETURN, pulling out the transaction success and posting the order on the same page, then telling the customer 'SUCCESSFUL ORDER' and showing them a button where they can see/print their full invoice.

Very confusing for a mid-level programmer. IS this an improper approach?

Thanks!

2 个答案:

答案 0 :(得分:0)

您可以使用任何希望收到无声帖子信息的网址。有关静音帖子的更多信息的最佳指南如下:https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowlink_guide.pdf

答案 1 :(得分:0)

我找到了我认为最好的答案:这个' Silent Post'归结为像example in C# here一样简单的web.request

我怀疑有一件事在PayPal的文档中可能不正确(不确定!)是沉默的帖子没有得到PayFlow的回复。相反,PayPal的IP地址显示他们的Silent Post数据来自另一个来源(请参阅此PayPal的IP地址列表;请注意' Silent Post'下的那个)。这仍然令人困惑,因为我不相信这台服务器与PayPal Advanced集成,但我已经放弃了这两个响应的想法。来自PayPal并在我的代码隐藏中使用web.requestRequest.Formhttps://www.paypal-techsupport.com/app/answers/detail/a_id/883/related/1