NodeJS

plus-sign-simple

Integrate NodeJS and Fat Zebra

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

Fat Zebra and NodeJS Integration Guide

While testing, it is important that you ensure no sensitive data is included in the data you are validating – this includes card numbers and CVV/CVN numbers. We also recommend that you replace card holder names with example data, however names with diacritics, umlauts or accents may cause validation issues, so remember this while you are testing.

Authentication
Authentication with the Fat Zebra API is via HTTP Basic Authentication. When your account is setup you are provided with two sets of credentials – one for the test environment (also known as the Sandbox), and one for the live system. Your test username will always be prefixed with TEST

API request *must* be made over HTTPS – any requests over HTTP will fail. All requests require authentication.

It is important to note that your username is *not* case sensitive however your API token (password) is.

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

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

To integrate Fat Zebra 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

When you are registered with Fat Zebra you will be provided with a Test Account, which includes its own username and token. Using these details will ensure that transactions are not sent to your live merchant facility but allow you to do a full end-to-end test from your site to our service.

Testing with variable cards will generate a response based on the cent-amount of the transaction – for example if the transaction amount is $100.51 (10051) then the response code will be 51 – Expired Card, and a transaction with the amount $200.00 (20000) will have the response code 00 – Approved.

Fat Zebra Supported Countries

Fat Zebra 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 Fat Zebra and other +100 payment gateways with NodeJS and other dozen of e-commerce platforms.

About Fat Zebra

Fat Zebra was built as a simple way for merchants to accept credit card payments online whilst still maintaining a strong focus on security, reliability and great user experience. Their online payment gateway provides you with all the features and benefits you deserve with no hidden fees or charges to ensure you have all the right tools to trade online.

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