Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-radial

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-radial - npm Package Compare versions

Comparing version 0.2.2 to 0.2.4

lib/webhooks/authenticate.js

11

lib/risk/assess.js

@@ -332,2 +332,3 @@ /* LIB */

var lineItems = [];
var itemListRPH = '';
orderOptions.lineItems.forEach(function (item) {

@@ -341,2 +342,6 @@ var lineItemData = {

if (item.id) {
itemListRPH += item.id + ' ';
}
lineItemData.LineTotalAmount = {

@@ -596,2 +601,8 @@ _attributes: {

if (itemListRPH && itemListRPH !== '') {
requestOrder.TotalCost.FormOfPayment.ItemListRPH = {
_text: itemListRPH.trim()
};
}
// PURCHASE AMOUNT

@@ -598,0 +609,0 @@ requestOrder.TotalCost.FormOfPayment.Amount = {

2

package.json
{
"name": "node-radial",
"version": "0.2.2",
"version": "0.2.4",
"description": "NodeJS SDK for the Radial APIs",

@@ -5,0 +5,0 @@ "main": "radial.js",

@@ -46,2 +46,4 @@ /* LIB */

if (configParams.webhooks) params.webhooks = configParams.webhooks;
Radial.params = params;

@@ -48,0 +50,0 @@

@@ -49,2 +49,3 @@ [![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url] [![Build Status][travis-image]][travis-url]

- `environment` - Set to either `development` or `production` **_defaults to the value of `NODE_ENV` or `development` if not set_**
- `webhooks` - If you plan to use a webhook route, please pass an object with authentication data for each route. See the section on [Webhooks](#webhooks) for details on setting this up.

@@ -251,3 +252,3 @@ ## Tokenization and 3D Secure

## Risk Assessment
### Risk Assessment

@@ -455,4 +456,49 @@ This API has a lot of intricacies, with lengthy and complex requirements and optional parameters. Please refer to the Radial documentation to know what is required, and the type of data needed for the API. Because of the API's complexity and wide possibility space, `node-radial` does very little to error check for you. It simply maps your block of JSON data to Radial's required XML data. Below is an example with all possible parameters entered.

## Webhooks
### Config
When you configure Radial, include webhook authorization info for any endpoints you plan to use.
```
var radial = require('node-radial').configure({
// ...
webhooks: {
paymentAuthCancel: {
username: '',
password: ''
},
paymentSettlementStatus: {
username: '',
password: ''
},
riskOrderStatus: {
username: '',
password: ''
}
}
});
```
### Risk Order Status
At your webhook endpoint, pass the request object to authorize and parse the message.
```
router.post('v1/webhooks/radial/risk-order-status', function (req, res, next) {
radial.webhooks.riskOrderStatus(req, function(err, data) {
if (err) {
// send Radial a 400 or 500 so that they can retry the request
return res.status(err.status).send(err.type + ': ' + err.message);
}
// send a 200 so that Radial will clear the event
return res.send('Order risk status received.');
});
});
```
## CHANGELOG
- **0.2.4:** Logging cleanup.
- **0.2.3:** `ItemListRPH` was missing from the fraud assessment request. The module now generates this string automatically from the item list.
- **0.2.2:** Fixes to risk assessment handling of external risk results, payment amount, and server timezone offset.

@@ -459,0 +505,0 @@ - **0.2.1:** Fixes to risk assessment XML request and API response.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc