HubtelAdapter
Defined in: packages/node/src/providers/hubtel/hubtel.adapter.ts:17
Interface that all Voltax payment providers must implement. The generic type TPaymentDTO allows each provider to define its own payment payload type.
Example
Section titled “Example”class PaystackAdapter implements VoltaxProvider<PaystackPaymentDTO> { async initiatePayment(payload: PaystackPaymentDTO): Promise<VoltaxPaymentResponse> { ... } async verifyTransaction(reference: string): Promise<VoltaxPaymentResponse> { ... } async getPaymentStatus(reference: string): Promise<PaymentStatus> { ... }}Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HubtelAdapter(
config):HubtelAdapter
Defined in: packages/node/src/providers/hubtel/hubtel.adapter.ts:21
Parameters
Section titled “Parameters”config
Section titled “config”HubtelConfig
Returns
Section titled “Returns”HubtelAdapter
Methods
Section titled “Methods”getPaymentStatus()
Section titled “getPaymentStatus()”getPaymentStatus(
reference):Promise<PaymentStatus>
Defined in: packages/node/src/providers/hubtel/hubtel.adapter.ts:147
Helper to get status directly.
Parameters
Section titled “Parameters”reference
Section titled “reference”string
Returns
Section titled “Returns”Promise<PaymentStatus>
Implementation of
Section titled “Implementation of”VoltaxProvider.getPaymentStatus
initiatePayment()
Section titled “initiatePayment()”initiatePayment(
payload):Promise<VoltaxPaymentResponse>
Defined in: packages/node/src/providers/hubtel/hubtel.adapter.ts:51
Initialize payment with Hubtel’s checkout API
Parameters
Section titled “Parameters”payload
Section titled “payload”Payment details including amount, email, currency, and Hubtel-specific options
amount
Section titled “amount”number = ...
callbackUrl
Section titled “callbackUrl”string = ...
cancellationUrl?
Section titled “cancellationUrl?”string = ...
currency
Section titled “currency”Currency = ...
description?
Section titled “description?”string = ...
string = ...
metadata?
Section titled “metadata?”Record<string, any> = ...
mobileNumber?
Section titled “mobileNumber?”string = ...
reference
Section titled “reference”string = ...
returnUrl
Section titled “returnUrl”string = ...
Returns
Section titled “Returns”Promise<VoltaxPaymentResponse>
Promise
Example
Section titled “Example”const hubtel = Voltax('hubtel', { clientId: '...', clientSecret: '...', merchantAccountNumber: '...' });const response = await hubtel.initiatePayment({ amount: 100, email: 'customer@example.com', currency: Currency.GHS, reference: 'unique-ref', callbackUrl: 'https://example.com/callback', // Hubtel-specific options (flat, not nested) returnUrl: 'https://example.com/return', mobileNumber: '0241234567',});Implementation of
Section titled “Implementation of”VoltaxProvider.initiatePayment
verifyTransaction()
Section titled “verifyTransaction()”verifyTransaction(
reference):Promise<VoltaxPaymentResponse>
Defined in: packages/node/src/providers/hubtel/hubtel.adapter.ts:118
Get transaction details.
Parameters
Section titled “Parameters”reference
Section titled “reference”string
Returns
Section titled “Returns”Promise<VoltaxPaymentResponse>