php - How does a WebHook work? -


i'm implementing payments platform website wich similar stripe, still can't understand process or how should use webhooks since need specify 1 on account in payments platform.

so let's person pays in website product costs $5, take them payment form introduce credit card details. when click "pay now" gets verified via javascript/jquery , sent server , i'm able charge user , see reflected on sandbox account on payment platform. or when should webhooks used or called, or why need them?

thanks in advance

webhooks way communicate application. many apis, send them request , api response included in response request. if request make asynchronous, or if reason api you're using wants able communicate application calling directly opposed waiting make request.

with webhooks, you'd open endpoint on application other api / service can send requests can process requests. can think of push notifications web applications.

with payments standard use case webhooks handle subscription renewals. customer sign today , you'd in response createsubscription call whether or not subscription created successfully, how know whether or not subscription renewed successfully? either poll payments api on , on again, or payments api can send webhook event saying subscription renewed , in webhook handler logic can handle internally (like send receipt, update db fields, etc)


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -