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

signup-login-with-authorizenet

v1.1.5

Published

User Signup-login-with-AuthorizedotNet payment gateway

Downloads

20

Readme

Signup Login with Authorize.net

The signup-login-with-authorizenet module is a Node.js with loopback framework script and it provides a fastest way to create user signup and login services with authentication and payment subscription with Authorize.net.

Pre-requisites

Node.js , and the platform-specific tools needed to compile native NPM modules (which you may already have):

Installation

To install the signup-login-with-authorizenet module, simply run the following command within your app's directory:

npm i  signup-login-with-authorizenet --save

Development

var loopback = require("signup-login-with-authorizenet");

Database Configuration:

var dbConfig = {
    "name":""	
	"host": "",
    "port": ,
    "url": "",
    "database": "",
    "password": "",
    "user": "",
    "connector": "" // connector name ex. mongodb or mysql
};

loopback.config.datasourceset(dbConfig);

Must follow below model properties configuration for payment integration with Authorize.net

Model Configuration:

var modelConfig = {
"properties":[
    {
    "name": "firstname",
      "type": "string",   
      "required": true
      },
     {
    "name": "lastname",
      "type": "string",
      "required": true
	  },
	  {
	  "name": "username",
      "type": "string",   
      "required": true
      },
	  {
	  "name": "email",
      "type": "string",   
      "required": true
      },
     {
    "name": "password",
      "type": "string",
      "required": true
	  },
     {
    "name": "address",
      "type": "string",
      "required": false
	  },
	  {
	  "name": "city",
      "type": "string",   
      "required": false
      },
     {
    "name": "state",
      "type": "string",
      "required": false
	  },
     {
    "name": "country",
      "type": "string",
      "required": false
	  },
     {
    "name": "zip",
      "type": "number",
      "required": false
	  },
	  {
	  "name": "phone",
      "type": "number",   
      "required": false
      },
     {
    "name": "cardcode",
      "type": "number",
      "required": true
	  },
     {
    "name": "expiredate",
      "type": "string",
      "required": true
	  },
     {
    "name": "cardnumber",
      "type": "number",
      "required": true
	  },
	  {
    "name": "subscription_id",
      "type": "string",
      "required": false
	  },
	  {
    "name": "subscription_status",
      "type": "string",   
      "required": false
	  } 
    
]}
loopback.modelConfiguration.modelConfiguration(modelConfig);

Set Authorize.net keys

Note: if you haven't created keys,...follow https://support.authorize.net/s/article/How-do-I-obtain-my-API-Login-ID-and-Transaction-Key
var authorizekeys = {
    "apiLoginKey":"",  //Authorize.net APIloginkey
    "transactionKey":""  //Authorize.net transactionKey
} 
loopback.paymentKeysConfig.paymentKeysConfig(authorizekeys)

Authorize.net Merchant Details config

var paymentconfig = {
    "amount":"50",  // Amount of subscription
    "trail_amount":"0", // Trail Amount of subscription
    "interval_length":"1", // The measurement of time, in association with unit, that is used to define the frequency of the billing occurrences.(For a unit of days, use an integer between 7 and 365, inclusive. For a unit of months, use an integer between 1 and 12, inclusive.)
    "interval_unit":"months" // The unit of time, in association with the length, between each billing occurrence.(days or moths)
} 
loopback.paymentConfiguration.paymentConfiguration(paymentconfig)

Set mail service and login details for configuring nodemailer module

var emailkeys = {
    "service":"" , // Gmail or Yahoo
	"email":"",  // if gmail(ex:[email protected])
	"password":"",   // email password
	"appName":"" // your application name for email title

} 
loopback.constants.constants(emailkeys) 

Update server port

var port = {
    "port":	 // default server will run on port 3000
} 
loopback.updatePort.configPort(port) 

Include following code in your index file:

loopback.getstart();

Run following in your terminal to start the APP:

 npm start

Verify the deployment by navigating to your server address in your preferred browser.

http://localhost:3000/ping
POST Services:
http://localhost:3000/users/signup //Signup and subscription creation will be happend with this service
http://localhost:3000/users/login   // Login will be done with email and password or username and password
{

   "username": "",  // Note: Key is username, value will be username or email
  "password":""
}
http://localhost:3000/users/updateSubscription 

example:

{
  "expiredate": "2025-08",
  "cardcode": 123,
  "cardnumber": 4111111111111111,
  "user_id":"" 
}

http://localhost:3000/users/getSubscriptionStatus

example:

{
  "user_id":"" 
}

http://localhost:3000/users/getSubscriptionDetails

example:

{
  "user_id":"" 
}

http://localhost:3000/users/cancelSubscription

example:

{
  "user_id":"" 
}

Get Services:

http://localhost:3000/users/
http://localhost:3000/users?id=  // get user by id service, pass id here

#Licence MIT