Yatta Checkout User Guide
Integrating Yatta Checkout in Eclipse (In-App)
Workspace configuration
Configure the target platform
The target platform specifies the set of bundles used to compile and build against within the Eclipse PDE (plugin development environment).
Add the target platform to your workspace. This can be done in two different ways:
Configure your own target platform file
Use the “Eclipse Target Platform Wizard” provided by Eclipse
Configuring your own target platform file
The target platform file will be located in your Eclipse IDE preferences or your plugin’s directory. An example target platform file might look like this:
Configuring with the Eclipse Target Platform Wizard
Select from menu: > > >
Choose your active target platform
Click the button and choose
In the edit view, add the update site https://cdn.yatta.de/update/marketplace/ to your target platform
Wait until the data is cached on your local machine and click .
Confirm by clicking on
Configure the plugin dependencies
Add the following plugins to your file in the directory:
They are thus declared as dependencies for the plugin.
You can use either of the following two methods to add the plugins:
Add the plugins in the Eclipse Editor
Add the plugins using the Eclipse Wizard
An example file might look like this:
Optional: Enable the pre-configured UI elements
Yatta Checkout offers a selection of pre-configured UI elements, like a page to show the current state of a license and an academic preferences page to manage the state of an academic license.
To enable the UI, add the following configuration to your file:
Add an implementation for a preference page by inheriting from
Then add the following code to your :
For subscription and one-time purchase licenses, different product IDs must be used. If your product is available with both license types, there should be two different preference pages. A second class inheriting from should be implemented and added to .
Checkout implementation
Once the Eclipse IDE is configured, you can start implementing the Licensing Client and the In-App Checkout. The two key actions are to open the In-App Checkout as an Eclipse view (to guide a user towards a license purchase) and to query a license (to determine the license status of your product).
Open the in-app Checkout
The following command opens the in-app Checkout:
Note: The ‘MarketplaceClient.get().openCheckout’ method does not detect automatically if you are using a preview or live version of a product. You have to set the environment manually. If you are using a live version, pass the environment value of live. If you are using a preview version, pass the environment value of preview. If the environment has been set to live and no live product is available, the preview product will be selected.
If the user is not already signed in, the user is asked to sign in. If the user already has a license, a dialog is shown informing them that a valid license already exists.
Query a license
The following commands query the license for the user (who is currently signed in):
The following parameters can be set individually:
The validity of the LicenseResponse can be checked with the following command:
can give the following responses:
LICENSED | The feature in question is licensed by the user currently logged in. Additional license requirements (concurrent quotas, etc.) are met. |
UNLICENSED | The user does not have a license for this feature assigned to their account. |
UNAUTHORIZED_REQUEST | The API key does not match the given feature. |
WAIT | The current validity of the requested license is unknown. Therefore a new license must be requested from the server. This call is asynchronous. Until the new license is fetched, all license requests for this feature will result in a response with validity WAIT |
UNKNOWN_FEATURE | Incorrect product ID provided to the API. |
Implementation example
Here is a basic example of an implementation using the Yatta Checkout within Eclipse. The app shows a dialog that provides the state of the license and the sign-in. If the user is not signed in or if a valid license is missing, the in-app Checkout will open.
For a more elaborate example, check out the source code of our Eclipse Demo Plugin: https://yatta.de/download/YattaCheckoutDemo-source.zip