node-red-contrib-blue-bank
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -22,3 +22,4 @@ module.exports = function(RED) { | ||
"Authorization": auth | ||
} | ||
}, | ||
json: true | ||
} | ||
@@ -28,2 +29,8 @@ | ||
options.url = url + "accounts/" + account; | ||
} else if (method === "updateAccount") { | ||
options.url = url + "accounts/" + account; | ||
options.method = "PATCH"; | ||
options.body = { | ||
"accountFriendlyName": msg.payload.accountFriendlyName | ||
} | ||
} else if (method === "getAccounts") { | ||
@@ -35,2 +42,8 @@ options.url = url + "customers/" + customer + "/accounts"; | ||
options.url = url + "customers/" + customer; | ||
} else if (method === "updateCustomer") { | ||
options.url = url + "customers/" + customer; | ||
options.method = "PATCH"; | ||
options.body = { | ||
"mobilePhone": msg.payload.mobilePhone | ||
} | ||
} else if (method === "getCustomers") { | ||
@@ -49,5 +62,11 @@ options.url = url + "customers"; | ||
} else { | ||
var response = JSON.parse(body); | ||
msg.payload = response; | ||
node.send(msg); | ||
if (body.errorMessage) { | ||
node.error(body.errorMessage, msg); | ||
node.status({fill:"red", shape:"ring", text:"Request failed"}); | ||
} else { | ||
msg.payload = body; | ||
node.status({}); | ||
node.send(msg); | ||
} | ||
} | ||
@@ -54,0 +73,0 @@ }); |
{ | ||
"name": "node-red-contrib-blue-bank", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A node exposing the Blue Bank #BankOfApis", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -28,3 +28,3 @@ # node-red-contrib-blue-bank | ||
**Get Account** `/accounts/{id} - GET` | ||
**Get Account** `/accounts/{id} - GET` | ||
@@ -37,4 +37,10 @@ This returns a full Account object for the given id. | ||
**Get Accounts** `/customers/{id}/accounts - GET` | ||
**Update Account** `/accounts/{id} - PATCH` | ||
By design, only the `accountFriendlyName` property can be updated by API. Other fields are reserved by the Bank and any attempts to change to them will be ignored. | ||
Expects the property on `msg.payload.accountFriendlyName`. | ||
**Get Accounts** `/customers/{id}/accounts - GET` | ||
Use this call to enumerate the list of accounts for the specified user. | ||
@@ -46,3 +52,3 @@ | ||
**Get Transactions** `/accounts/{id}/transactions - GET` | ||
**Get Transactions** `/accounts/{id}/transactions - GET` | ||
@@ -55,3 +61,3 @@ Returns a set of Transaction objects for the specified account. | ||
**Get Customer** `/customers/{id} - GET` | ||
**Get Customer** `/customers/{id} - GET` | ||
@@ -64,4 +70,12 @@ Use this call to return a specific Customer object, if you know the id. | ||
**Get Customers** `/customers - GET` | ||
**Update Customer** `/customers/{id} - PATCH` | ||
Use this call to update a specific Customer object, if you know the id. At present, the only property which it is possible to update is `mobilePhone`. | ||
Expects the property on `msg.payload.mobilePhone`. | ||
*Note: In a future release, this feature will be available in a customer portal and this PATCH operation will be removed from the public API.* | ||
**Get Customers** `/customers - GET` | ||
This call will return a collection of Customer objects which the currently authenticated user is allowed to see. |
Sorry, the diff of this file is not supported yet
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
23212
67
77