Class HotRecharge

Hierarchy

  • HotRecharge

Constructors

Properties

apiVersion: string = '/api/v1/'

Api version

headers: Record<string, string> = ...

Headers to be passed to the https request

rootEndpoint: string = 'https://ssl.hot.co.zw'

HotRecharge server endpoint

url: string = ''

This is the url that will be accessed by the service

Methods

  • Query a zesa transaction for reconciliation: reccommended is to query within the last 30 days of the transaction

    Parameters

    • rechargeId: string

      Response:

      {
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      WalletBalance: walletBalance,
      Amount: amount,
      Discount: discount,
      Meter: meter,
      AccountName: accountName,
      Address: address,
      Tokens: [
      {
      Token: token,
      Units: units,
      NetAmount: netAmount,
      Levy: levy,
      Arrears: arrears,
      TaxAmount: taxAmount,
      ZesaReference: zesaReference,
      }
      ],
      AgentReference: agentReference,
      RechargeID: rechargeID,
      CustomerInfo: {
      CustomerName: customerName,
      Address: address,
      MeterNumber: meterNumber,
      Reference: reference,
      },
      }

    Returns Promise<any>

  • Get wallet balance

    Parameters

    • mobileNumber: string

      End user mobile number

      Response:

      {
      AgentReference: agentReference,
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      WalletBalance: walletBalance,
      }

    Returns Promise<any>

  • Get list of available data bundle options

    Response:

    {
    ReplyCode: 2,
    Bundles: [
    {
    BundleId: 59,
    BrandId: 20,
    Network: 'Econet WhatsApp',
    ProductCode: 'WPD1',
    Amount: 2515,
    Name: 'WhatsApp (4MB)+ Pinterest 2MB',
    Description: 'WhatsApp (4MB)+ Pinterest 2MB',
    ValidityPeriod: 1
    }
    ],
    AgentReference: '44d76e1d608444df93e9a1a3bfc8d8d3'
    }

    Returns Promise<any>

  • Parameters

    • productCode: string

      Bundle product code e.g. DWB15 for weekly data bundle - ECONET

    • mobileNumber: string

      Mobile number to recharge

    • message: string = null

      Optional: customer sms to send

      Response:

      {
      AgentReference: agentReference,
      Amount: amount,
      Data: data,
      Discount: discount,
      FinalBalance: finalBalance,
      InitialBalance: initialBalance,
      RechargeID: rechargeID,
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      SMS: sms,
      WalletBalance: walletBalance,
      Window: window,
      }

    Returns Promise<any>

  • check zesa customer. please note! You are advised to first check zesa customer before performing zesa recharge, i.e prompt the user to confirm their details first before proceeding meter_number: the 11 digit meter number of suer

    Parameters

    • meterNumber: string

      Response:

      {
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      Meter: meter,
      AgentReference: agentReference,
      CustomerInfo: {
      CustomerName: customerName,
      Address: address,
      MeterNumber: meterNumber,
      Reference: reference,
      },
      }

    Returns Promise<any>

  • Parameters

    • amount: number

      Amount to recharge

    • mobileNumber: string

      Mobile number to recharge

    • brandId: string = null

      Optional

    • message: string = null

      Optional: Customer sms to send

      Response:

      {
      AgentReference: agentReference,
      Amount: amount,
      Data: data,
      Discount: discount,
      FinalBalance: finalBalance,
      InitialBalance: initialBalance,
      RechargeID: rechargeID,
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      SMS: sms,
      WalletBalance: walletBalance,
      Window: window,
      }
    • currency: Currency = Currency.ZWL

    Returns Promise<any>

  • Private

    Process Post Request With Axios

    Parameters

    • data: object

      Data to post with request

    Returns Promise<any>

  • Query transaction

    Parameters

    • agentReference: string

      Agent reference for the transaction

      Response:

      {
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      OriginalAgentReference: originalAgentReference,
      RawReply: rawReply,
      AgentReference: agentReference,
      }

    Returns Promise<any>

  • Parameters

    • amount: number

      Amount to recharge

    • notifyMobileNumber: string

      Mobile number to receive the recharge token

    • meterNumber: string

      Meter number to be recharged

    • message: string = null

      Optional: Customer sms to send

      Response:

      {
      ReplyCode: replyCode,
      ReplyMsg: replyMsg,
      WalletBalance: walletBalance,
      Amount: amount,
      Discount: discount,
      Meter: meter,
      AccountName: accountName,
      Address: address,
      Tokens: [
      {
      Token: token,
      Units: units,
      NetAmount: netAmount,
      Levy: levy,
      Arrears: arrears,
      TaxAmount: taxAmount,
      ZesaReference: zesaReference,
      }
      ],
      AgentReference: agentReference,
      RechargeID: rechargeID,
      }

    Returns Promise<any>

  • Get agent wallet balance

    Response:

    {
    AgentReference: agentReference,
    ReplyCode: replyCode,
    ReplyMsg: replyMsg,
    WalletBalance: walletBalance,
    }

    Returns Promise<any>

  • Get agent zesa wallet balance

    Response:

    {
    AgentReference: agentReference,
    ReplyCode: replyCode,
    ReplyMsg: replyMsg,
    WalletBalance: walletBalance,
    }

    Returns Promise<any>

  • Private

    Generate random merchant reference

    Returns

    Unique merchant reference

    Returns string

Generated using TypeDoc