Catalog npm
Back to packageRELEASE DETAILS

1.3.6

npm

46dnds-globalpayments

Global Payments SDK for NodeJS for Heartland and Global Payments eCommerce gateways (a fixed and viable version by 46 Degrees North Development Studio)

Published27 Dec 2023
Direct dependencies16
Transitive dependenciesNot calculated

README

Current package documentation
Global Payments logo

Heartland & Global Payments Node.js SDK

This SDK makes it easy to integrate your Node.js application with our Card Not Present and Card Present APIs.

Solutions

General / Omnichannel

  • API Payment Processing
  • Apple Pay & Google Pay
  • Secure Card Storage & Customer Management
  • Subscriptions / Recurring Billing Solutions
  • Credit, Debit, Gift & Loyalty, and eCheck/ACH

Card Not Present (Ecommerce & MOTO) Specific

  • Minimize PCI compliance requirements with Hosted Payment Solutions
  • 140+ Authorization Currencies & 16 Settlement Currencies
  • 150+ Local Payment Methods Worldwide
  • Account Updater
  • Inbuilt Fraud Prevention Rules
  • 3D Secure, AVS and CVV Checks
  • 260+ Global Enterprise Fraud Rules

Card Present (Terminal & POS) Specific

  • Secure End-To-End Encryption

Requirements

  • Node.js

Installation

Installing the SDK into your solution is usually be done by either using NPM or Yarn.

To install via NPM:

npm install --save 46dnds-globalpayments

To install via Yarn:

yarn add globalpayments-api

Documentation and Examples

You can find the latest SDK documentation along with code examples and test cards on the Global Payments - BROKEN LINK, expired since 2021!! and Heartland Developer Hubs.

In addition you can find working examples in the our example code repository.

Quick Tip: The included test suite can be a great source of code samples for using the SDK!

Process a Payment Example

//setting config
const
sandbox	= true,
{
  Address,
  CreditCardData,
  ServicesConfig,
  ServicesContainer,
  HostedPaymentConfig,
  Transaction
} = require('46dnds-globalpayments');

const config = new ServicesConfig();
config.merchantId 		= "YOUR MERCHANT ID";
config.accountId 		= "YOUR ACCOUNT ID";
config.sharedSecret 		= "YOUR SUPER SECRET";
config.serviceUrl 		= "https://api."+(sandbox?'sandbox.':'')+"realexpayments.com/epage-remote.cgi";
ServicesContainer.configure(config);


const card = new CreditCardData();
card.number = "4111111111111111";
card.expMonth = "12";
card.expYear = "2025";
card.cvn = "123";

card
  .charge(129.99)
  .withCurrency("EUR")
  .execute()
  .then((response) => {
    const result = response.responseCode;
    const message = response.responseMessage;
  })
  .catch((e) => {
    // handle  errors
  });

Process a Refund(rebate)

config.rebatePassword = 'rebate'; //use your own
const refund=Transaction.fromId('TRANSACTION_ID','REFERENCE_ORDER_ID');
refund
  .refund('129.99')
  .withAuthCode('AUTH_CODE')
	.withCurrency('EUR')
	.execute()
  .then((response) => {
    const result = response.responseCode;
    const message = response.responseMessage;
  })
  .catch((e) => {
    // handle  errors
  });

Test Card Data

NameNumberExp MonthExp YearCVN
Visa4263970000005262122025123
MasterCard2223000010005780122019900
MasterCard5425230000004415122025123
Discover6011000000000087122025123
Amex3741010000006081220251234
JCB3566000000000000122025123
Diners Club36256000000725122025123

Testing Exceptions

During your integration you will want to test for specific issuer responses such as 'Card Declined'. Because our sandbox environments do not actually reach out to issuing banks for authorizations, there are specific transaction amounts and/or card numbers that will trigger gateway and issuing bank responses. Please contact your support representative for a complete listing of values used to simulate transaction AVS/CVV results, declines, errors, and other responses that can be caught in your code. Example error handling code:

card
  .charge(-5)
  .withCurrency("USD")
  .withAddress(address)
  .execute()
  .catch((e) => {
    switch (e.name) {
      case BuilderError.constructor.name:
        // handle builder errors
        break;
      case ConfigurationError.constructor.name:
        // handle errors related to your services configuration
        break;
      case GatewayError.constructor.name:
        // handle gateway errors/exceptions
        break;
      case UnsupportedTransactionError.constructor.name:
        // handle errors when the configured gateway doesn't support
        // desired transaction
        break;
      case ApiError.constructor.name:
      default:
        // handle all other errors
        break;
    }
  });

Contributing

All our code is open sourced and we encourage fellow developers to contribute and help improve it!

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Ensure SDK tests are passing
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

License

This project is licensed under the GNU General Public License v2.0. Please see LICENSE.md located at the project's root for more details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 16

Native requirements
16 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
url
Environment
{
  "local_name": "url",
  "alias": false,
  "peer_metadata": null
}
^0.11.0runtime
sha1
Environment
{
  "local_name": "sha1",
  "alias": false,
  "peer_metadata": null
}
^1.1.1runtime
typedarray
Environment
{
  "local_name": "typedarray",
  "alias": false,
  "peer_metadata": null
}
^0.0.6runtime
es6-promise
Environment
{
  "local_name": "es6-promise",
  "alias": false,
  "peer_metadata": null
}
^4.2.8runtime
@azz/elementtree
Environment
{
  "local_name": "@azz/elementtree",
  "alias": false,
  "peer_metadata": null
}
^0.1.6runtime
ava
Environment
{
  "local_name": "ava",
  "alias": false,
  "peer_metadata": null
}
^0.17.0development
rimraf
Environment
{
  "local_name": "rimraf",
  "alias": false,
  "peer_metadata": null
}
^2.6.3development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
^4.5.1development
typedoc
Environment
{
  "local_name": "typedoc",
  "alias": false,
  "peer_metadata": null
}
^0.9.0development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^3.12.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^1.18.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
2.5.2development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^7.10.6development
npm-run-all
Environment
{
  "local_name": "npm-run-all",
  "alias": false,
  "peer_metadata": null
}
^4.1.5development
@hitc/netsuite-types
Environment
{
  "local_name": "@hitc/netsuite-types",
  "alias": false,
  "peer_metadata": null
}
^2017.2.32development
awesome-typescript-loader
Environment
{
  "local_name": "awesome-typescript-loader",
  "alias": false,
  "peer_metadata": null
}
^3.5.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "f1f2a389ba11dce811b814691c5c1cd742ae1c1b",
  "tarball": "https://registry.npmjs.org/46dnds-globalpayments/-/46dnds-globalpayments-1.3.6.tgz",
  "fileCount": 226,
  "integrity": "sha512-7CTRZRgsBU0j0lKsKRfwaJcA1kDWO7u/uHDn8WC3+mErun6c/ZA5m11+6iJyt1eAZNLhywjlJs5ethb+4NMsyQ==",
  "signatures": [
    {
      "sig": "MEQCICK7lreOXhCYsXn+47fDSe0iBPykEOEW8VyvEDxUq4e7AiBxOiptGLBM7KchxNQ2b7gftSjhV2WTRYKoF2K0Uhh2cA==",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 2047540
}

Repository

PENDING
46dnds/globalpayments-node-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:03 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:79d0b8e671842f26f30dfafc0cfa2d4b8afebc87b1833939cc02c2f9ea0d81ab

Other collected versions

1.3.928 Nov1.3.828 Dec1.3.728 Dec1.3.527 Dec1.3.427 Dec1.3.320 DecView all collected versions →