在braintree的localhost上测试Webhook

[英]Test Webhook at localhost in braintree


I am working on braintree and I want to send custom email notifications to my customers as I am working with recurring billing, so every month these custom notifications should be send to all users. For this I have to use webhooks to retrieve currently ocuured event and then send email notification according to webhook's response. (I think this is only solution in this case, If anyone know another possible solution please suggest). I want to test webhooks at my localhost first, And I have tried to create a new webhook and specified the localhost path as destination to retrieve webhooks. But this shows a error "Destination is not verified"..........

我正在使用braintree,我想在我的客户处理定期电子邮件通知,因为我正在使用定期结算,所以每个月都应该将这些自定义通知发送给所有用户。为此,我必须使用webhooks检索当前发生的事件,然后根据webhook的响应发送电子邮件通知。 (我认为这只是解决方案,如果有人知道另一种可能的解决方案请建议)。我想首先在我的localhost上测试webhooks,并且我尝试创建一个新的webhook并指定localhost路径作为目标来检索webhooks。但这显示错误“目的地未经验证”..........

My path is : "http://127.0.0.1:81/webhook/Accept"

我的路径是:“http://127.0.0.1:81/webhook/Accept”

6 个解决方案

#1


8  

These are some of the tools that can be used during development of webhooks :

这些是在webhooks开发过程中可以使用的一些工具:

1) PostCatcher,

1)PostCatcher,

2) RequestBin,

2)RequestBin,

3) ngrok,

3)ngrok,

4) PageKite and

4)PageKite和

5) LocalTunnel

5)LocalTunnel

http://telerivet.com/help/api/webhook/testing

http://telerivet.com/help/api/webhook/testing

https://www.twilio.com/blog/2013/10/test-your-webhooks-locally-with-ngrok.html

https://www.twilio.com/blog/2013/10/test-your-webhooks-locally-with-ngrok.html

#2


1  

I work at Braintree. If you need more help, please get in touch with our support team.

我在布伦特里工作。如果您需要更多帮助,请与我们的支持团队联系。

In order to test webhooks, your app needs to be able to be reached by the Braintree Gateway. A localhost address isn't. Try using your external IP address and make sure the port on the correct computer can be reached from the internet.

为了测试webhook,您需要能够通过Braintree Gateway访问您的应用程序。本地主机地址不是。尝试使用外部IP地址,并确保可以从Internet访问正确的计算机上的端口。

Take a look at the Braintree webhook guide for more info on setting up webhooks.

有关设置webhook的更多信息,请查看Braintree webhook指南。

#3


1  

You can use PutsReq to simulate the response you want and do your end-to-end test in development.

您可以使用PutsReq来模拟所需的响应,并在开发中进行端到端测试。

#4


1  

For quick 'n dirty testing: http://requestb.in/

对于快速的脏测试:http://requestb.in/

For more formal testing (e.g. continuous integration): https://www.runscope.com/

对于更正式的测试(例如持续集成):https://www.runscope.com/

#5


0  

If you have a online server you may forward port from your computer to that server.

如果您有在线服务器,则可以将端口从计算机转发到该服务器。

ssh -nNT -R 9090:localhost:3000 root@yourvds.com

ssh -nNT -R 9090:localhost:3000 root@yourvds.com

And then specify webhook as http://yourvds.com:9090/webhook

然后将webhook指定为http://yourvds.com:9090/webhook

all requests will be forwarded to you machine, you will be able to see logs

所有请求都将转发给您的机器,您将能够看到日志

#6


0  

I know this is an old question, but according to the docs, you can use this code to test your webhook code:

我知道这是一个老问题,但根据文档,您可以使用此代码来测试您的webhook代码:

Dictionary<String, String> sampleNotification = gateway.WebhookTesting.SampleNotification(
    WebhookKind.SUBSCRIPTION_WENT_PAST_DUE, "my_id"
);

WebhookNotification webhookNotification = gateway.WebhookNotification.Parse(
    sampleNotification["bt_signature"],
    sampleNotification["bt_payload"]
);

webhookNotification.Subscription.Id;
// "my_id"

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2014/01/20/ec02bdf20a4238f80d0e63fc208a58be.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号