node-radial
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -18,2 +18,3 @@ /* LIB */ | ||
Webhooks.riskOrderStatus = require('./riskOrderStatus'); | ||
Webhooks.paymentSettlementStatus = require('./paymentSettlementStatus'); | ||
@@ -20,0 +21,0 @@ /* NPM EXPORT */ |
@@ -34,11 +34,4 @@ /* LIB */ | ||
var reply = body.RiskAssessmentReplyList; | ||
var assessment = reply.RiskAssessmentReply; | ||
return fn(null, { | ||
orderId: assessment.OrderId, | ||
responseCode: assessment.ResponseCode, | ||
storeId: assessment.StoreId, | ||
reasonCode: assessment.ReasonCode, | ||
reasonCodeDescription: assessment.ReasonCodeDescription | ||
}); | ||
return fn(null, reply); | ||
}); | ||
@@ -45,0 +38,0 @@ }; |
{ | ||
"name": "node-radial", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "NodeJS SDK for the Radial APIs", | ||
@@ -5,0 +5,0 @@ "main": "radial.js", |
@@ -54,2 +54,3 @@ /* LIB */ | ||
Radial.risk = require('./lib/risk/index'); | ||
Radial.payments = require('./lib/payments/index'); | ||
Radial.webhooks = require('./lib/webhooks/index'); | ||
@@ -56,0 +57,0 @@ Radial.utils = require('./lib/utils'); |
@@ -249,2 +249,55 @@ [![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] | ||
### Payment Settlement | ||
When you are ready to capture funds from the customer's form of payment. | ||
PLEASE NOTE. None of the `invoiceData` in the schema for this API is completed. It seems uncommon to include this data in the request, so I didn't waste my time with it. If you need it, start a pull request! | ||
This module will determine whether to send a `PaymentContext` or a `PaymentContextBase` based on the presents of `accountUniqueId`. | ||
<https://docs.ptf.radial.com/Content/Topics/events/events-payment-settlement.htm> | ||
``` | ||
radial.payments.settlement.create({ | ||
paymentContext: { // REQUIRED | ||
orderId: '', // REQUIRED | ||
accountUniqueId: '', | ||
accountUniqueIdIstoken: false | ||
}, | ||
invoiceId: '', // REQUIRED | ||
currencyCode: 'USD', // REQUIRED | ||
amount: 12.34, // REQUIRED | ||
taxAmount: 1.18, // REQUIRED | ||
settlementType: 'Debit', // REQUIRED ("Debit" or "Credit") | ||
authorizationResponseCode: '', | ||
authorizationDate: new Date(), | ||
expirationDate: new Date(), | ||
clientContext: '', | ||
finalDebit: false, | ||
omsOrderId: '', | ||
billingAddress: { | ||
line1: '', // REQUIRED | ||
line2: '', | ||
line3: '', | ||
line4: '', | ||
city: '', // REQUIRED | ||
mainDivision: '', | ||
countryCode: '', // REQUIRED | ||
postalCode: '' | ||
}, | ||
personName: { | ||
honorific: '', | ||
firstName: '', | ||
middleName: '', | ||
lastName: '' // REQUIRED | ||
} | ||
}, function(err, response) { | ||
/* | ||
response = { | ||
received: true | ||
}; | ||
*/ | ||
}); | ||
``` | ||
## Fraud Management Processing | ||
@@ -457,2 +510,4 @@ | ||
The webhooks part of this API wrapper is PROBABLY NOT READY FOR PRIMETIME yet. I can't guarantee that it's going to work. | ||
### Config | ||
@@ -499,4 +554,22 @@ | ||
### Payment Settlement Status | ||
Radial's settlement API is asynchronous, so you will have to set up a webhook endpoint to receive the status of a settlement. | ||
``` | ||
router.post('v1/webhooks/radial/payment-settlement-status', function (req, res, next) { | ||
radial.webhooks.paymentSettlementStatus(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('Payment settlement status received.'); | ||
}); | ||
}); | ||
``` | ||
## CHANGELOG | ||
- **0.3.5:** Adding payment settlement status webhook endpoint. Webhooks are still not quite ready to go. | ||
- **0.3.4:** Fix bad reference on webhook response. | ||
@@ -503,0 +576,0 @@ - **0.3.3:** Path fixes. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92324
24
2164
596