3

I am creating a payment gateway using Paymill (which is comparable to Stripe). I want my website to automatically react to subscription-based billings. This is why I am considering Paymill webhooks.

I am in the testing phase and thus on localhost (XAMPP). The receiving webhook script would therefore have this URL:

localhost/paymill-example-php-subscriptions-master/src/Paymill/LlamaKisses/Controllers/WebhooksController.php. 

But is it possible at all to set a localhost address as a webhook url (and how)?

(By the way, isn't WebhooksController.php missing a response code line like this:

http_response_code(200);

to let the sending webhook know it succeeded and needn't retry?)

Many thanks in advance!

koopajah
  • 23,792
  • 9
  • 78
  • 104
Pingui
  • 1,312
  • 4
  • 15
  • 28
  • You could use something like ngrok to redirect a url towards your localhost or requestbin – koopajah Jan 11 '15 at 06:23
  • This worked for me. "https://stackoverflow.com/questions/15357356/is-it-possible-to-set-localhost-as-a-stripe-webhook-url" – Saif Aug 16 '18 at 11:46
  • [ngrok](https://ngrok.com/docs/secure-tunnels#what-are-ngrok-secure-tunnels) might be a good fit for this – shad0w_wa1k3r Sep 27 '22 at 20:48

3 Answers3

5

Use one of these tunneling apps:

http://john-sheehan.com/blog/a-survey-of-the-localhost-proxying-landscape

John Sheehan
  • 77,456
  • 30
  • 160
  • 194
1

You can use Webhook Relay (https://webhookrelay.com) to create webhook forwarding tunnels or bidirectional tunnels:

$ relay forward -b webhook-demo http://localhost:8090/webhook
Forwarding:
https://my.webhookrelay.com/v1/webhooks/5e722a5e-f3d2-4hqec-9e9f-79f1158e4b10 -> http://localhost:8090/webhook
starting webhook relay agent..

Endpoints are permanent (until you delete them) and it is also possible to fan-out webhooks to more than one destination. .

Deforciant
  • 51
  • 3
0

I am using Azure Websites with a Free mode website. With that you can attach remote debugger to the Azure Website and if I am not mistaken you can do that with free tools from MS too. You can easily switch on tracing to Azure Table storage or file system and from within a webbrowser or tools look at logs. It may not be apt for you, but if you have a bit of time to play around it's quite easy. I am logging the whole PayMill webhook message to an Azure Table .

Sentinel
  • 3,582
  • 1
  • 30
  • 44