Class HunterTechPayClient
java.lang.Object
com.huntertechpay.client.HunterTechPayClient
Main client for HunterTechPay API.
Example usage:
HunterTechPayClient client = new HunterTechPayClient.Builder()
.apiKey("your_api_key")
.secretKey("your_secret_key")
.build();
PaymentRequest request = PaymentRequest.builder()
.phoneNumber("+237690000000")
.amount(5000.0)
.currency("XAF")
.country("CM")
.serviceCode("CM_OMCMR_CASHOUT")
.partnerId("order-123")
.build();
PaymentResponse response = client.initiatePayment(request);
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncheckStatus(String partnerId) Check payment status by partner ID.deposit(PaymentRequest request) Deposit (CASHIN) - From mobile money to wallet.getBalance(String currency) Get account balance.Get available payment providers.getProviders(String countryCode) Get available payment providers for a specific country.getTransactions(int page, int limit) Get list of transactions.initiatePayment(PaymentRequest request) Initiate a new payment.kyc(KYCVerificationRequest request) Verify KYC (Know Your Customer) information for a phone number.parseWebhookEvent(String payload) Parse webhook event.booleanverifyWebhookSignature(String payload, long timestamp, String signature) Verify webhook signature.withdraw(PaymentRequest request) Withdraw (CASHOUT) - From wallet to mobile money.
-
Method Details
-
initiatePayment
Initiate a new payment.- Parameters:
request- Payment request details- Returns:
- Payment response with transaction ID
- Throws:
HunterTechPayException- if request fails
-
deposit
Deposit (CASHIN) - From mobile money to wallet.- Parameters:
request- Payment request details- Returns:
- Payment response with transaction ID
- Throws:
HunterTechPayException- if request fails
-
withdraw
Withdraw (CASHOUT) - From wallet to mobile money.- Parameters:
request- Payment request details- Returns:
- Payment response with transaction ID
- Throws:
HunterTechPayException- if request fails
-
getProviders
Get available payment providers.- Returns:
- List of all available providers
- Throws:
HunterTechPayException- if request fails
-
getProviders
Get available payment providers for a specific country.- Parameters:
countryCode- Country code (CM, SN, CI, etc.)- Returns:
- List of providers for the specified country
- Throws:
HunterTechPayException- if request fails
-
checkStatus
Check payment status by partner ID.- Parameters:
partnerId- Your unique reference ID- Returns:
- Payment status
- Throws:
HunterTechPayException- if request fails
-
kyc
Verify KYC (Know Your Customer) information for a phone number.- Parameters:
request- KYC verification request details- Returns:
- KYC verification response with customer information
- Throws:
HunterTechPayException- if request fails
-
getTransactions
Get list of transactions.- Parameters:
page- Page number (1-based)limit- Number of transactions per page- Returns:
- List of transactions
- Throws:
HunterTechPayException- if request fails
-
getBalance
Get account balance.- Parameters:
currency- Currency code (XAF or XOF)- Returns:
- Balance information
- Throws:
HunterTechPayException- if request fails
-
verifyWebhookSignature
Verify webhook signature.- Parameters:
payload- Webhook payload as JSON stringtimestamp- Timestamp from X-Hunter-Timestamp headersignature- Signature from X-Hunter-Signature header- Returns:
- true if signature is valid
-
parseWebhookEvent
Parse webhook event.- Parameters:
payload- Webhook payload as JSON string- Returns:
- Parsed webhook event
- Throws:
HunterTechPayException- if parsing fails
-