Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
46dnds-globalpayments
Advanced tools
Readme
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.
FAQs
Global Payments SDK for NodeJS for Heartland and Global Payments eCommerce gateways (a fixed and viable version by 46 Degrees North Development Studio)
The npm package 46dnds-globalpayments receives a total of 12 weekly downloads. As such, 46dnds-globalpayments popularity was classified as not popular.
We found that 46dnds-globalpayments demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.