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
ExtendedTenderTypeCodeclass that implementsorg.jumpmind.pos.util.TypeCodeInitializer - [ ] Create a factories file
META-INF/commerce.factorieswhich should contain the mapping for theTypeCodeInitializerorg.jumpmind.pos.util.TypeCodeInitializer=com.package.location.to.ExtendedTenderTypeCode - [ ] Add entry for
TenderModelinsls_tendertable where thetender_type_codematches the constant defined inExtendedTenderTypeCodeusingTenderTypeCode - [ ] Add entries for
TenderPolicyModelinsls_tender_policythat with aTENDER_OPERATIONvalue ofSALEto support selling with this new tender. (Other entries will be required for other tender operations) - [ ] Add a button to the
ButtonModelinctx_buttonfor thetender.tenderOptionsbutton group. The Button value should match the router added toChooseTenderRouteState - [ ] Create a flow extension for
tendering-flow-ext.yml - [ ] Add an action router to
ChooseTenderRouteStateTenderingFlow: - 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