Skip to main content

Payment Hook

The payment hook tells your app about payment changes. For example, a booking app can confirm a booking the moment it is paid, or free the slot when the payer does not pay in time.

Setting the Hook​

  1. In Facilio Build, open the app, then Payments › Settings (the gear at the end of the tab strip).
  2. Under Payment hook, choose the app's Function.
  3. Type the Handler name. The app's developer tells you which handler to use.
  4. Click Save. The hook shows On.

The hook applies at once, to preview and live. You don't need to publish.

To stop it, click Remove, then confirm.

MessageMeaning
<function> isn't built yet. Build and deploy it before payments arrive.The function exists but has not been built. Ask the app's developer to build and deploy it.
This app has no functions yet. Add one with facilio vibe function create, then build it.The app has no function to choose. Ask the app's developer to add one.
(not built) next to a functionThe function has not been built yet. Ask the app's developer to build and deploy it.
(not found) next to the functionThe saved function was deleted. Choose another function, or remove the hook.

When It Runs​

The handler runs every time a payment's status changes, for example when it is paid, fails, expires or is refunded. It also runs on each further partial refund, and when a dispute is opened or closed.

  • Preview payments run the preview build of the function.
  • Live payments run the live build. After the developer changes the function, the app's owner publishes the app.

When the Hook Fails​

If the handler fails, Facilio tries again. It runs the handler up to 9 times in all, over about 11 hours.

  • While it is retrying, the payment shows Hook failing (n×) in Transactions, where n is the number of tries so far.
  • If every try fails, the payment shows Hook gave up, and Facilio stops trying. Transactions also shows a warning above the list.

The payment itself is not affected, but the app was not told about the change. Ask the app's developer to fix the function, then check the payments marked Hook gave up.