Package ca.mint.mintchip.android.api

The ca.mint.mintchip.android.api package contains classes that implement the MintChip functionality on the Android platform.

See: Description

Class Summary
Class Description
MessageFactory

This class is responsible for instantiating MintChip message types.

MintChipFactory

This class is responsible for instantiating a concrete implementation of the IMintChip for the Android.

Description

The ca.mint.mintchip.android.api package contains classes that implement the MintChip functionality on the Android platform.

It provides two main public factory classes:

  • MintChipFactory - class responsible for instantiating a concrete implementation of the IMintChip for the Android.
  • MessageFactory - class responsible for instantiating MintChip message types using the Android implementation of the IBase64Processor interface.

A typical approach to using the MintChip API in an Android application involves the following steps:

  • Reference the ca.mint.mintchip.android.api and ca.mint.mintchip.contract Java packages. This can be done by referencing the MintChipAndroidApi.jar and MintChipCommon.jar files from an Android Eclipse project.
  • Import the MintChip API packages into the source code file:
                import ca.mint.mintchip.android.api.*;
                import ca.mint.mintchip.contract.*;
                
  • Create an instance of the class that implements the IMintChip interface, which is the main interface to invoke the MintChip functionality:
    IMintChip mintChip = MintChipFactory.getInstance().createMintChip();
                
  • Use MessageFactory to instantiate message types:
    IValueMessage valueMessage = (IValueMessage) MessageFactory.getInstance().toMessage(base64Message);
  • Call methods of the IMintChip interface and be prepared to handle the MintChipException:
                        try {
                            mintChip.loadValueMessage(valueMessage);
                        } 
                        catch (MintChipException e) {
                            // TODO Handle the exception
                        }