Socket
Socket
Sign inDemoInstall

@payhos/api

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @payhos/api

An API SDK to communicate with the PayHos API


Version published
Weekly downloads
1
Maintainers
1
Install size
440 kB
Created
Weekly downloads
 

Readme

Source

PayHos API SDK

PayHos is an easy go-to solution for many day-to-day fintech problems by providing an easily accessible opportunities to all and sundry with minimal bar of entry. For a full documentations of PayHos API and fully supported features, visit PayHos API Docs It is provided by EmbyBest Concept Nig. Ltd

This API SDK is intended to assist web applications of any kind to interact with the PayHos API server by utilizing its simple schematics. For a more modular usage, this library is designed such that bundlers with tree-shaking is enhanced.

Installation

Install @payhos/api via npm by running the following command:

npm install @payhos/api --save

Usage

Create an instance and call available methods from the instance created.

import { PayHos } from '@payhos/api';

// or
const { PayHos } = require('@payhos/api');

const payhos = new PayHos('<YOUR API TOKEN>');

// You can access each of PayHos' API features as follows:
const sms = payhos.sms;
const airtime = payhos.airtime;
const email = payhos.email;

SMS

Visit Send SMS with PayHos for more information on SMS dodumentations.

const sms = payhos.sms;
const data = {
  message: 'Hello there, this is a test message from PayHos SDK',
  recipients: ['+2348166666666', '+2348055555555'],
  flash: false,
  senderId: 'PayHos',
};

// to send SMS
sms.send(data).then(response => {
  // message(s) sent successfully
  console.log(response);
}).catch(err => {
  console.log(err);
});

Email

For detailed documentations on sending emails with PayHos API and other supported SDKs, visit Sending Emails with PayHos

const email = payhos.email;
const data = {
  subject: 'Test Email',
  content: `Hey <strong>Alice</strong>, this is a test email message from <a href="https://payhos.com">PayHos API Hub</a>`,
  customData: {},
  recipients: [
    {email: 'example@example.com'},
    { name: 'Alice', email: 'example2@example.com' }
  ],
  from: {
    name: 'PayHos',
    email: 'test@test.com'
  }
};

// to send email
email.send(data).then(response => {
  // message(s) sent successfully
  console.log(response);
}).catch(err => {
  console.log(err);
});

Airtime

const airtime = payhos.airtime;

// Coming soon...

Further Reading

Have a look at other packages:

Keywords

FAQs

Last updated on 07 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc