PaystackAdapter
Defined in: packages/node/src/providers/paystack/paystack.adapter.ts:12
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 PaystackAdapter(
__namedParameters):PaystackAdapter
Defined in: packages/node/src/providers/paystack/paystack.adapter.ts:15
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”PaystackConfig
Returns
Section titled “Returns”PaystackAdapter
Methods
Section titled “Methods”getPaymentStatus()
Section titled “getPaymentStatus()”getPaymentStatus(
reference):Promise<PaymentStatus>
Defined in: packages/node/src/providers/paystack/paystack.adapter.ts:150
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/paystack/paystack.adapter.ts:49
Initialize a payment with Paystack.
Parameters
Section titled “Parameters”payload
Section titled “payload”Payment details including amount, email, currency, and optional Paystack-specific options
amount
Section titled “amount”number = ...
bearer?
Section titled “bearer?”"subaccount" | "account" = ...
callbackUrl?
Section titled “callbackUrl?”string = ...
channels?
Section titled “channels?”PaystackChannel[] = ...
currency
Section titled “currency”Currency = ...
description?
Section titled “description?”string = ...
string = ...
invoiceLimit?
Section titled “invoiceLimit?”number = ...
metadata?
Section titled “metadata?”Record<string, any> = ...
string = ...
reference?
Section titled “reference?”string = ...
splitCode?
Section titled “splitCode?”string = ...
subaccount?
Section titled “subaccount?”string = ...
transactionCharge?
Section titled “transactionCharge?”number = ...
Returns
Section titled “Returns”Promise<VoltaxPaymentResponse>
Promise
Example
Section titled “Example”const paystack = Voltax('paystack', { secretKey: '...' });const response = await paystack.initiatePayment({ amount: 100, email: 'customer@example.com', currency: Currency.NGN, reference: 'unique-ref', // Paystack-specific options (flat, not nested) channels: [PaystackChannel.CARD, PaystackChannel.BANK], subaccount: 'ACCT_xxx',});Implementation of
Section titled “Implementation of”VoltaxProvider.initiatePayment
verifyTransaction()
Section titled “verifyTransaction()”verifyTransaction(
reference):Promise<VoltaxPaymentResponse>
Defined in: packages/node/src/providers/paystack/paystack.adapter.ts:125
Verify a transaction with Paystack.
Parameters
Section titled “Parameters”reference
Section titled “reference”string
The transaction reference to verify.
Returns
Section titled “Returns”Promise<VoltaxPaymentResponse>
The payment response.