Integrate NodeJS and Citrus
Trexle connects NodeJS to Citrus and 100+ other payment gateways using a single plugin for one time annual fee
Citrus and NodeJS Integration Guide
For Citrus integration, you will need the following credentials: Access Key, Secret Key and Vanity URL.
To retrieve these credentials, log to your Citrus merchant account
After login to your Citrus account, click on the Checkout page setting tab in right panel to retrieve Vanity URL.
Vanity URL of your website www.yourdomain.com will be “yourdomain” without www. and .com
To retrieve Access Key and Secret Key, click on the Security Credentials tab.
Take the credentials you just obtained from Citrus and navigate to Trexle dashboard, click Payments Gateways and select Citrus from the drop down menu as shown below.
Fill into your Citrus credential and click Add Gateway. Click the Activate button next to Citrus, and it will give you a success message and the button will turn into green. You should see something like below.
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
You can use the following card numbers to test the flow of transactions only in the test environment.
Card Type | Card Number |
American Express | 378282246310005 371449635398431 |
Maestro | 6762407506473539 5081251112230305 |
MasterCard | 5555555555554444 5105105105105100 |
Visa | 4111111111111111 4012888888881881 |
Note:
- When using test cards, you can specify an expiry date up to seven years in the future.
- The test cards do not have a card verification code and issue number.
- The above-mentioned card numbers will only be helpful to check the flow of integration and nota successful payment.
- Make sure you perform a test transaction of amount less than INR 11/-.This is due to limits set in the test environment.
Citrus Supported Countries
Citrus Supported Payment Processing Actions
✔ Authorize
✔ Capture
✔ Void
✔ Credit
✖ Recurring
✖ Card Store
Key Features
About Trexle
Trexle is a powerful online recurring subscription billing platform that integrate Citrus and other +100 payment gateways with NodeJS and other dozen of e-commerce platforms.
About Citrus
Citrus was founded in 2011 by a group of software, UX, and finance professionals who saw space for true simplification & innovation in the world of payments. Citrus Payment Solutions Pvt. Ltd. provides solutions for digital payments and online checkout processes in India. Being led by Amrish Rau and Jitendra Gupta, it is India’s fastest growing fintech company that provides consumer payments and mobile banking services in India.
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.