npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vmbcarabbacan/telr

v1.0.1

Published

Integrate Telr Hosted Payment and Service API

Downloads

5

Readme

telr-hosted-payment

Integrate Telr Hosted Payment and Service API

Get Started - Telr Documentation

import the file const telr = require('@vmbcarabbacan/telr')

setup the telr store and authkey by

telr.setup({
    store: '12345', // Store ID
    authkey: 'asjdh12942241', // Authentication Key,
    return_auth: 'http://localhost:8081/success', //redirect to this link once payment is successful
    return_decl: 'http://localhost:8081/declined', //redirect to this link once payment is declined
    return_can: 'http://localhost:8081/cancelled', //redirect to this link once payment is cancelled
    currency: 'AED', // optional - default value is AED
    test: 1 // optional value set 0 to have live transaction
})

Note. Before going to live make sure to Authorised your server IP address from telr merchant Integration To create order - you can use this below sample parameters to generate link

const response =  await telr.create({
      ivp_amount: '300.00',
      ivp_cart: 'abcde1234' // if not set - will get the current date in miliseconds as default value
      ivp_desc: 'Purchase Order' // if not set - will have default value of Purchase Order
      return_auth: 'http://localhost:8081/success', // optional if not set in setup
      return_decl: 'http://localhost:8081/declined', // optional if not set in setup
      return_can: 'http://localhost:8081/cancelled' // optional if not set in setup
  })

Reponse:

{
 "method":"create",
 "order":{
   "ref":"OrderRef",
   "url":"https://secure.telr.com/gateway/process.html?o={OrderRef}"
 }
}

extra fields will be - Telr Supplying Details | Field | Description | Notes | | ----- | ----------- | ----- | | bill_fname | Forenames | The customer’s forename, plus any other middle names or initials they may have | | bill_sname | Surname | Customer surname (also known as family name) | | bill_addr1 | Address line 1 | | | bill_phone | Customer Mobile number | | | bill_city | City | | | bill_country | Country | Must be supplied as a 2 character ISO 3166 country code. | | bill_email | Email address | |

#Status to check the status of the payment you will be needing the order ref from create response

const response =  await telr.status({
        ref: 'F7007901131C10366C6D1A451907C6F579C00DE6243AE5A80FA518EFF6205DA8'
    })

#Transactions and Reports API Configuration Before starting you have to enable the Service API to get Merchant ID and API Key Transactions

const response =  await telr.transactions({
            merchant_id: '5123',
            api_key: '8123981had2j',
            transaction_ref: '01128729512398', // optional
            type: 'linked' // optional 
        })

| type | transaction_ref | | ---- | --------------- | | linked | transRef | | cart | ref | | email | customer email address | | card | The card number can be provided in two ways, as either an 8 digit value (containing the first 4 and last 4 digits of the card number) or as a 12 digit transaction reference. |

Reports

const response =  await telr.reports({
            merchant_id: '5123',
            api_key: '8123981had2j'
        })

Agreements - Repeat Billing

const response = await telr.agreements({
        merchant_id: '9102',
        api_key: '1606faecM3GMcq6q4hpKwps6',
        agreement_id: '1adi1u2390213', // optional
        method: 'get', // optional - values | *get* or *cancel*
        type: 'history' // optional
    })