接收和记录webhook帖子 [英] Receive and log webhook post
问题描述
我有一个设置与Stripe.com的帐户。我已经配置了一个webhook进行测试,并发送测试帖子到接收这些请求的cfm页面。但是,我不确定这个页面是做什么应该是。目前,我只是dump出所有的数据。下面是页面代码的样子。
当我在本地运行页面或直接在我们的实时测试网站上调用时,我会收到一封电子邮件,预期。但是,如果我将页面设置为webhook url,然后让Stripe发送测试消息给它,没有任何反应 - 没有电子邮件。我在错误日志中也看不到任何东西。这里可能出现什么问题?有人可能推荐一个更好的方式来接收和记录webhook调用Stripe吗?我在这里有点无知。感谢
< cfsavecontent variable =local.emailBody>
< cfdump var =#GetHttpRequestData()#>
< cfdump var =#HTTP#>
< cfdump var =#REQUEST#>
< cfdump var =#FORM#>
< cfdump var =#VARIABLES#>
< / cfsavecontent>
<!--- Build Email --->
< cfset sMessage.messageType =email/>
<!---设置其他电子邮件设置,如to,from etc --->
<!---发送电子邮件--->
< cfset application.Communication.SendMessage(sMessage)/>
我确定现在你已经知道了,但你使用...
ToString(getHTTPRequestData()。content)
...或将其放在CF对象中...
deserializeJSON(ToString(getHTTPRequestData()。content))
I have an account set up with Stripe.com. I have configured a webhook for testing and am sending test posts to a cfm page that "receives" these requests. However, I am not sure that this page is doing what it should be. Currently, I just dump out all data. Below is what the page code looks like.
When I run the page locally, or call it directly on our live test site, I get an email with all the data as expected. However, if I set the page up as a webhook url and then get Stripe to send a test message to it, nothing happens - no emails. I see nothing in the error logs either. What could be going wrong here? Could someone perhaps recommend a better way to receive and log the webhook calls from Stripe? I am a little clueless here. Thanks
<cfsavecontent variable="local.emailBody"> <cfdump var="#GetHttpRequestData()#"> <cfdump var="#HTTP#"> <cfdump var="#REQUEST#"> <cfdump var="#FORM#"> <cfdump var="#VARIABLES#"> </cfsavecontent> <!--- Build Email ---> <cfset sMessage.messageType = "email" /> <!--- Setup other Email settings like to,from etc ---> <!--- Send Email ---> <cfset application.Communication.SendMessage(sMessage) />
解决方案I'm sure by now you already figured this out, but you use...
ToString(getHTTPRequestData().content)
... or to put it in a CF object...
deserializeJSON(ToString(getHTTPRequestData().content))
这篇关于接收和记录webhook帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!