Once you have established an account with MasterPass, begin by including the MasterPass Module dependency to your main pom.xml.
<dependency> <groupId>com.broadleafcommerce</groupId> <artifactId>broadleaf-masterpass</artifactId> <version>1.0.0-GA</version> <type>jar</type> <scope>compile</scope> </dependency>
Make sure to include the dependency in your
core pom.xml as well:
<dependency> <groupId>com.broadleafcommerce</groupId> <artifactId>broadleaf-masterpass</artifactId> <type>jar</type> </dependency>
You should now begin to setup your environment to work with Broadleaf Commerce MasterPass support.
The first step is to make Broadleaf Commerce aware of your MasterPass account credentials.
This is accomplished through environment configuration (see [[Runtime Environment Configuration]]).
Broadleaf allows you to create your own property files per environment (e.g. common.properties, local.properties, development.properties, integrationdev.properties, integrationqa.properties, staging.properties, and production.properties)
You will need to enter the following key/value pairs in the appropriate locations and replace the "?" with your MasterPass api account details:
You can also store these configs in the Database by utilizing the
blSystemPropertiesService. See the java docs for more details.
Note - This module comes pre-configured with a Spring MVC controller with URL endpoints to handle the masterpass callback:
Enable these with your component scan if you would like to use these in your implementation.
Note - If you followed the MasterPass guide, you should have created a PEM encoded Certificate Request File. This file needs
to reside on your file system and the path needs to be configured by the
wallet.masterpass.keyStorePathproperty. For example,
if you placed your .p12 file in
site/src/main/resources/MCOpenAPI.p12, the keyStorePath would be
Note - MasterPass is intended to work with any Payment Gateway. In order for ths module to communicate appropriately
with another Broadleaf Payment Module, you will need to tell MasterPass which gateway you are using. You can set
gateway.config.global.gatewayTypeproperty to the PaymentGatewayType.getType() of the appropriate module.
MasterPass also requires you to send back the
ApprovalCode: 6-digit approval code returned by payment API.
This is usually the Authorization Code sent back from the Gateway. Each Broadleaf implemented gateway will set this
Authorization Code as an entry in the additional fields Map on the PaymentTransaction.
gateway.config.global.approvalCodeparameter will tell MasterPass the key parameter for this Map to pull back the Authorization Code
for the configured gateway.
Note - MasterPass will send back the Credit Card expiration Date in a particular format. This format may or may not be
compatible with the payment gateway configured. You can override the default format of "MM/YY" by setting the property
Note - MasterPass is intended to be a Digital Wallet that can accommodate several types of international cards and billing addresses.
In order to fully support the billing/shipping address conversion you can load the ISO 3166-1 provided in our reference Heat Clinic
implementation. Add this line to your development.properties file:
If you are using one of Broadleaf's Payment Modules, you can set these properties for MasterPass: