Payment Form OSB Balances Plugin

The Payment Form - OS Services Booking Balances plugin (plug_pmform_osbbalances, group pmform) lets customers top up their User Balance in OS Services Booking by paying for a form created with the Payment Form (com_pmform) extension. Once the payment is completed, the amount is added to the customer's balance and a notification email is sent.

Requirements

  • Joomla 4.x / 5.x
  • Payment Form (com_pmform) and OS Services Booking (com_osservicesbooking) installed
  • The plugin is located in plugins/plug_pmform_osbbalances. Zip the folder, install it via System -> Install -> Extensions and publish it.

Plugin parameters

Parameter Description
Balances changed Notification Email Subject Subject of the email sent to the user when the balance is changed.
Balances changed Notification Email Body Body of the email sent to the user when the balance is changed.

Both parameters have default values, so the plugin works right after installation.

Form settings

When you add/edit a form in Payment Form, the OSB Balances Settings tab contains one field:

Field Description
Enable OSB Balances If enabled, the amount paid through this form is added to the user's balance after a successful payment.

Email tags

Besides the standard Payment Form tags, these tags can be used in the subject and body:

  • [OSB_BALANCE_ADDED] - the amount added to the balance
  • [OSB_BALANCE_TOTAL] - the new balance of the user

How it works

  1. The balance owner is the logged in user who made the payment. If the payment was made by a guest, the plugin looks for the Joomla user whose email matches the email entered on the form. If no user is found, the balance is not changed.
  2. The paid amount is added to the user's row in the #__app_sch_user_balance table (a new row is created if the user has none). Each top-up is recorded in the row's note as [PMForm #<payment id>], so a payment is never credited twice.
  3. The notification email is sent to the user.

The balance can be reviewed and edited in Components -> OS Services Booking -> User Balances and is available to customers when paying bookings with the Prepaid payment method.