Once billing has been set up in Moab, administrators can enable billing in Viewpoint to charge users or accounts for the costs of various billable actions. Enabling billing will require users to put billable actions into a shopping cart and then execute the billable actions when the shopping cart is funded.
Billing is enabled in the core.xml file. The <billing
> element is a child of the root element <config
>. To enable billing, add the enabled
attribute and set it to true
.
The <billing
> element has two child elements: <cart-duration
> which is the duration that a shopping cart is valid, and <payment-options
> which contains the options users can select to pay for a shopping cart.
The <cart-duration
> element indicates the amount of time the placeholder reservation holds the resources for the shopping cart line item(s). After this duration, the reservation is released and another user can use the resources.
The <cart-duration
> element uses any of the following child elements:
years
>months
>days
>hours
>minutes
>seconds
><cart-duration> <hours>4</hours> </cart-duration>
The default duration, if not specified, is one day.
Each user-selectable payment option is defined using the <option
> element. Each option requires two attributes:
id
- The value is a unique identifier used in calculations. It can be any string.type
- The value must be one of the pre-defined payment options. Currently, these are the only available payment options:
moab-account
- Uses an existing, funded Moab account that has enough credits to pay for the shopping cart.
generate-new
- Redirects to an external payment site to generate a new payment source (like a new account).
none
- Viewpoint will not check for funding of any kind but instead will pass the request to Moab. Each <option
> element has a child <description
> element which is the text that is displayed on the checkout shopping cart page.
If billing is enabled and a cost is set up for each action, users must pay for the following actions using the shopping cart interface:
These actions are only added to a user's shopping cart if billing is enabled and the cost of these actions is more than $0.00.