
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
square-wrapi
Advanced tools
Client interface for accessing Square Connect API.
This is a breaking change.
Applications created after February 16, 2016 will not be able to use the
merchant
methods. Instead, usebusiness
methods. For older apps use version0.1.0
. More info.: https://docs.connect.squareup.com/articles/connect-api-changes-2016-02/
Create a client object to connect to Square Connect API endpoints.
var squareWrapi = require('square-wrapi');
var client = new squareWrapi('v1', API_ACCESS_TOKEN);
A note about LOCATION_ID
:
Most endpoint paths include a
location_id
parameter that indicates which of a business's locations your application is acting on behalf of. You can get a business's location IDs with thebusiness.locations()
endpoint method.
There are two ways to use the API (use #1 or #2 - not both):
If you have the location id, create the client object with the location id.
var client = new squareWrapi('v1', API_ACCESS_TOKEN, LOCATION_ID);
square-wrapi will use this location id. on calls that require location id and you do not have to provide it on each call.
Create the client object without location id.
var client = new squareWrapi('v1', API_ACCESS_TOKEN);
Provide
location_id
as the first parameter to all the calls that require location id.
Once you have the client object, you are ready to make API calls to Square.
Provide parameters and a callback.
API calls follow this syntax:
client.apigroup.action(param1, ..., queryString, callback);
param
- (if required) url parameters - eg: For payments.retrieve the value for :payment_id
. Provide location_id
if you created the client without LOCATION_ID
.queryString
- (as required) API endpoint parameters as key-value pairs.client.payments.list({
"begin_time": "2015-12-01T00:00:00Z",
"end_time": "2015-12-31T00:00:00Z"
},
function(err, data) {
if (!err) {
console.log(data);
}
}
);
// Or with location_id
client.payments.list('JGHJ0343', {
"begin_time": "2015-12-01T00:00:00Z",
"end_time": "2015-12-31T00:00:00Z"
},
function(err, data) {
if (!err) {
console.log(data);
}
}
);
client.payments.retrieve('Jq74mCczmFXk1tC10GB', function(err, data) {
if (!err) {
console.log(data);
}
});
client.refunds.create({
"payment_id": "Jq74mCczmFXk1tC10GB",
"type": "PARTIAL",
"reason": "Returned Goods",
"refunded_money": {
"amount": -500,
"currency_code": "USD"
},
"request_idempotence_key": "1"
},
function(err, data) {
if (!err) {
console.log(data);
}
}
);
client.items.update("442d1344-6d2b-4238-83d0-0284dfd335d8", {
"name": "Milkshake",
"description": "It's better than yours",
"visibility": "PRIVATE"
},
function(err, data) {
if (!err) {
console.log(data);
}
}
);
client.items.uploadImage(
{
formData: {
custom_file: {
value: fs.createReadStream('/path/to/MyImage.png.png'),
options: {
filename: 'MyImage.png',
contentType: 'image/png'
}
}
}
},
function(err, data) {
if (!err) {
console.log(data);
}
}
);
client.fees.del(FEE_ID, function(err, data) {
if (!err) {
console.log(data);
}
});
// or with location_id
client.fees.del(LOCATION_ID, FEE_ID, function(err, data) {
if (!err) {
console.log(data);
}
});
client.fees.remove(ITEM_ID, FEE_ID, function(err, data) {
if (!err) {
console.log(data);
}
});
// or with location_id
client.fees.remove(LOCATION_ID, ITEM_ID, FEE_ID, function(err, data) {
if (!err) {
console.log(data);
}
});
FAQs
Wrapper for Square Connect REST API
We found that square-wrapi demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.