Skip to content

Tenders

Tenders can be extended to allow for additional means of accepting payments or issuing returns.

Tendering Basics

For a tender for payment or returns to be used by Jumpmind Commerce it must be available via the sls_tender table with entries for sls_tender_policy as well as adding the tender to the tender.tenderOptions button group in ctx_button. Once the tender is selectable as an option and shown on the TenderOptionsState Jumpmind Commerce provides an extension point through ChooseTenderRouteState to send the state machine into a tender specific flow to collect payment information and validate authorization.

Currencies

A default currency is defined through openpos.sell.defaultCurrencyId the Jumpmind Commerce default is USD. This configuration is taggable through ctx_config and can be setup by any tag available.

Foreign Currencies

Each tender type can support multiple currencies. These configurations are controlled through TenderModel through the isoCurrencyCode field. When a business unit is setup via the TenderPolicyModel to use a tender with a different currency code from the store default it will then use the CurrencyExchangeRateModel to calculate the what to charge for that tender and currency as it relates to the stores default currency.

Custom Tenders for Sales

To add a custom tender that can be used in sales the following must be implemented and configured.

  • [ ] Create an ExtendedTenderTypeCode class that implements org.jumpmind.pos.util.TypeCodeInitializer
  • [ ] Create a factories file META-INF/commerce.factories which should contain the mapping for the TypeCodeInitializer
    org.jumpmind.pos.util.TypeCodeInitializer=com.package.location.to.ExtendedTenderTypeCode
    
  • [ ] Add entry for TenderModel in sls_tender table where the tender_type_code matches the constant defined in ExtendedTenderTypeCode using TenderTypeCode
  • [ ] Add entries for TenderPolicyModel in sls_tender_policy that with a TENDER_OPERATION value of SALE to support selling with this new tender. (Other entries will be required for other tender operations)
  • [ ] Add a button to the ButtonModel in ctx_button for the tender.tenderOptions button group. The Button value should match the router added to ChooseTenderRouteState
  • [ ] Create a flow extension for tendering-flow-ext.yml
  • [ ] Add an action router to ChooseTenderRouteState
    TenderingFlow:
      - ChooseTenderRouteState:
          TenderFancy: TenderFancyState
    
  • [ ] Add a new state with action routers to handle the business rules for that tender type.
    TenderingFlow:
      - TenderFancyState:
        EnterFancy: { subflow: ValidateFancyState, ReturnActions: ValidationSucceeded; ValidationFailed; RetryEntry }
        ValidationSucceeded: FinalizeCurrentTenderState
        ValidationFailed: TenderOptionsState
        RetryEntry: TenderFancyState
        Close: TenderOptionsState