Observed since 20 Oct, 20:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
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)
This SDK makes it easy to integrate your Node.js application with our Card Not Present and Card Present APIs.
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
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!
//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
});
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
});
| Name | Number | Exp Month | Exp Year | CVN |
|---|---|---|---|---|
| Visa | 4263970000005262 | 12 | 2025 | 123 |
| MasterCard | 2223000010005780 | 12 | 2019 | 900 |
| MasterCard | 5425230000004415 | 12 | 2025 | 123 |
| Discover | 6011000000000087 | 12 | 2025 | 123 |
| Amex | 374101000000608 | 12 | 2025 | 1234 |
| JCB | 3566000000000000 | 12 | 2025 | 123 |
| Diners Club | 36256000000725 | 12 | 2025 | 123 |
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;
}
});
All our code is open sourced and we encourage fellow developers to contribute and help improve it!
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)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.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@azz/elementtreeEnvironment{
"local_name": "@azz/elementtree",
"alias": false,
"peer_metadata": null
} | ^0.1.6 | runtime |
es6-promiseEnvironment{
"local_name": "es6-promise",
"alias": false,
"peer_metadata": null
} | ^4.2.8 | runtime |
https-proxy-agentEnvironment{
"local_name": "https-proxy-agent",
"alias": false,
"peer_metadata": null
} | ^7.0.2 | runtime |
node-fetchEnvironment{
"local_name": "node-fetch",
"alias": false,
"peer_metadata": null
} | ^2.7.0 | runtime |
sha1Environment{
"local_name": "sha1",
"alias": false,
"peer_metadata": null
} | ^1.1.1 | runtime |
typedarrayEnvironment{
"local_name": "typedarray",
"alias": false,
"peer_metadata": null
} | ^0.0.6 | runtime |
urlEnvironment{
"local_name": "url",
"alias": false,
"peer_metadata": null
} | ^0.11.0 | runtime |
@hitc/netsuite-typesEnvironment{
"local_name": "@hitc/netsuite-types",
"alias": false,
"peer_metadata": null
} | ^2017.2.32 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^7.10.6 | development |
avaEnvironment{
"local_name": "ava",
"alias": false,
"peer_metadata": null
} | ^0.17.0 | development |
awesome-typescript-loaderEnvironment{
"local_name": "awesome-typescript-loader",
"alias": false,
"peer_metadata": null
} | ^3.5.0 | development |
npm-run-allEnvironment{
"local_name": "npm-run-all",
"alias": false,
"peer_metadata": null
} | ^4.1.5 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^1.18.2 | development |
rimrafEnvironment{
"local_name": "rimraf",
"alias": false,
"peer_metadata": null
} | ^2.6.3 | development |
tslintEnvironment{
"local_name": "tslint",
"alias": false,
"peer_metadata": null
} | ^4.5.1 | development |
typedocEnvironment{
"local_name": "typedoc",
"alias": false,
"peer_metadata": null
} | ^0.9.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | 2.5.2 | development |
webpackEnvironment{
"local_name": "webpack",
"alias": false,
"peer_metadata": null
} | ^3.12.0 | development |
Source distribution
{
"integrity": "sha512-KrjMEgXufbLVUFPXD+0Aols0Uoikr94b2W2oAMAmyevt5Y5Xu/Bjo8dC//m69XGIONm4N8Wz02VJEcvzlTL4hg==",
"shasum": "bf35476f489aa0121a2112d94a858ef697dd1efa",
"tarball": "https://registry.npmjs.org/46dnds-globalpayments/-/46dnds-globalpayments-1.3.9.tgz",
"fileCount": 226,
"unpackedSize": 2048699,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEQCIGXjjyNGsUVbN3HSUUCbE/Vx5ni1rY1pFLFXasbUByoHAiBxdSm04fATIBlD/pIORiRah+/pqsaVAO024CxDHj/8hw=="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 20:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:fb28637835c8ec7c6fa80bcc32d6831f4a8f5e3d1e2cab51a07989ee54ecf786