Add the following dependencies:
Maven:
<dependency>
<groupId>com.banxware</groupId>
<artifactId>banxware-encoder</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
Gradle:
implementation "com.banxware:banxware-encoder:1.0.2"
implementation 'com.google.code.gson:gson:2.8.9'
Call the function in your java class:
MerchantLinkData merchantLinkData = Fixtures.merchantObject();
String yourPrivateKey = Fixtures.privateKey();
String banxwarePublicKey = Fixtures.publicKey();
// When
String blob = LinkIntegration.encode(merchantLinkData, banxwarePublicKey, yourPrivateKey);
For a more detailed, check the IntegrationTest.