NodeJS

plus-sign-simple

Integrate NodeJS and Payhub

Trexle connects NodeJS to Payhub and 100+ other payment gateways using a single plugin for one time annual fee

Payhub and NodeJS Integration Guide

Credentials needed for PayHub integration are Username, Password and Terminal ID. To retrieve them, follow these steps:

  • Once logged in, click on the Admin navigation link at the top right.
  • Under the General heading, click on the 3rd Party API link.
  • Copy down your Username, Password, and Terminal ID. Please note the username and password is case sensitive.

Take the credentials you just obtained from Payhub and navigate to Trexle dashboard, click Payments Gateways and select Payhub from the drop down menu as shown below.

Fill into your Payhub credential and click Add Gateway. Click the Activate button next to Payhub, and it will give you a success message and the button will turn into green. You should see something like below.

To integrate Payhub and NodeJS you need Trexle API keys

In your NodeJS project, open a terminal and issue the following command:

npm install trexlejs

If you want to test, consider writing the following example in a test.js file:

var Trexle = require('trexlejs');

var trexle = Trexle.setup({
key: ‘your-api-key’,
production: false
});

trexle.createCharge({
amount: 400,
currency: ‘usd’,
description: ‘test charge’,
email: ‘[email protected]’,
ip_address: ‘66.249.79.118’,
card: {
number: ‘4242424242424242’,
expiry_month: 8,
expiry_year: 2018,
cvc: 123,
name: ‘John Milwood’,
address_line1: ‘423 Shoreline Park’,
address_city: ‘Mountain View’,
address_postcode: 94043,
address_state: ‘CA’,
address_country: ‘US’
}
}, function (response) {
console.log(response.body);
});

Then run the code:

node test.js

  • Visa                         4012881888818888   CVV 999   Test amount: 10.00   Success
  • Visa                         4266841082854082   CVV 999   Test amount: 0.01  Fail
  • MasterCard             5466410004374507   CVV 998   Test amount: 10.00   Success
  • MasterCard             5454545454545454   CVV 998   Test amount: 0.20   Fail
  • American Express   371449635398431     CVV 9997   Test amount: 10.00   Success
  • American Express   371449635398431     CVV 9997   Test amount: 0.20   Fail
  • Discover                  6011000990156527   CVV 996   Test amount: 10.00   Success

Payhub Supported Countries

Payhub Supported Payment Processing Actions

✔ Purchase
✔ Authorize
✔ Capture
✔ Void
✔ Credit
✔ Recurring
✔ Card Store

Key Features

Credit Card Vault: securely store your customers sensitive credit card data using tokens.
Instant PCI-DSS Compliance: your customers credit card data never touches your site or server.
Multiple Gateway Support: Connect your NodeJS site to 100+ payment gateway

About Trexle

Trexle is a powerful online recurring subscription billing platform that integrate Payhub and other +100 payment gateways with NodeJS and other dozen of e-commerce platforms.

About Payhub

Founded in 2006, SignaPay | PayHub is a merchant services provider and payments technology company committed to forging strong client relationships by providing best in class service and solutions. PayHub offers a full suite of utilities that empower businesses to get the most out of their merchant account and payment processing.

About NodeJS

Node.js is an open-source, cross-platform JavaScript runtime environment for executing JavaScript code server-side, and uses the Chrome V8 JavaScript engine. Historically, JavaScript was used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage's HTML, to be run client-side by a JavaScript engine in the user's web browser. Node.js enables JavaScript to be used for server-side scripting, and runs scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

Cart