JAVA client for MeSomb services.
You can check the full documentation of the api here
๐ Homepage
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.hachther:mesomb-java:1.1.3'
}
Add it in your root build.gradle at the end of repositories:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.hachther</groupId>
<artifactId>mesomb-java</artifactId>
<version>Tag</version>
</dependency>
package com.hachther.mesomb.operations;
import com.hachther.mesomb.util.RandomGenerator;
import com.hachther.mesomb.exceptions.InvalidClientRequestException;
import com.hachther.mesomb.exceptions.PermissionDeniedException;
import com.hachther.mesomb.exceptions.ServerException;
import com.hachther.mesomb.exceptions.ServiceNotFoundException;
import com.hachther.mesomb.models.Application;
import com.hachther.mesomb.models.TransactionResponse;
import com.hachther.mesomb.operations.PaymentOperation;
class Test {
public static void main(String args[]) {
PaymentOperation payment = new PaymentOperation(this.applicationKey, this.accessKey, this.secretKey);
try {
TransactionResponse response = payment.makeCollect(new HashMap<String, Object>() {{
put("amount", 100);
put("service", "MTN");
put("payer", "670256547");
put("nonce", RandomGenerator.nonce());
}});
} catch (IOException | NoSuchAlgorithmException | InvalidKeyException | ServerException |
ServiceNotFoundException | PermissionDeniedException | InvalidClientRequestException e) {
throw new RuntimeException(e);
}
}
}
package com.hachther.mesomb.operations;
import com.hachther.mesomb.util.RandomGenerator;
import com.hachther.mesomb.exceptions.InvalidClientRequestException;
import com.hachther.mesomb.exceptions.PermissionDeniedException;
import com.hachther.mesomb.exceptions.ServerException;
import com.hachther.mesomb.exceptions.ServiceNotFoundException;
import com.hachther.mesomb.models.Application;
import com.hachther.mesomb.models.TransactionResponse;
import com.hachther.mesomb.operations.PaymentOperation;
class Test {
public static void main(String args[]) {
PaymentOperation payment = new PaymentOperation(this.applicationKey, this.accessKey, this.secretKey);
try {
TransactionResponse response = payment.makeDeposit(new HashMap<String, Object>() {{
put("amount", 100);
put("service", "MTN");
put("receiver", "670256547");
put("nonce", RandomGenerator.nonce());
}});
} catch (IOException | NoSuchAlgorithmException | InvalidKeyException | ServerException |
ServiceNotFoundException | PermissionDeniedException | InvalidClientRequestException e) {
throw new RuntimeException(e);
}
}
}
package com.hachther.mesomb.operations;
import com.hachther.mesomb.exceptions.InvalidClientRequestException;
import com.hachther.mesomb.exceptions.PermissionDeniedException;
import com.hachther.mesomb.exceptions.ServerException;
import com.hachther.mesomb.exceptions.ServiceNotFoundException;
import com.hachther.mesomb.models.Application;
import com.hachther.mesomb.operations.PaymentOperation;
class Test {
public static void main(String args[]) {
PaymentOperation payment = new PaymentOperation(this.applicationKey, this.accessKey, this.secretKey);
try {
Application response = payment.getStatus();
} catch (IOException | NoSuchAlgorithmException | InvalidKeyException | ServerException |
ServiceNotFoundException | PermissionDeniedException | InvalidClientRequestException e) {
throw new RuntimeException(e);
}
}
}
package com.hachther.mesomb.operations;
import com.hachther.mesomb.exceptions.InvalidClientRequestException;
import com.hachther.mesomb.exceptions.PermissionDeniedException;
import com.hachther.mesomb.exceptions.ServerException;
import com.hachther.mesomb.exceptions.ServiceNotFoundException;
import com.hachther.mesomb.models.Application;
import com.hachther.mesomb.operations.PaymentOperation;
class Test {
public static void main(String args[]) {
PaymentOperation payment = new PaymentOperation(this.applicationKey, this.accessKey, this.secretKey);
try {
payment.getTransactions(new String[]{"ID1", "ID2"});
} catch (IOException | NoSuchAlgorithmException | InvalidKeyException | ServerException |
ServiceNotFoundException | PermissionDeniedException | InvalidClientRequestException e) {
throw new RuntimeException(e);
}
}
}
๐ค Hachther LLC [email protected]
- Website: https://www.hachther.com
- Twitter: @hachther
- Github: @hachther
- LinkedIn: @hachther
Give a โญ๏ธ if this project helped you!