
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@madisonreed/amazon-payments
Advanced tools
npm install @madisonreed/amazon-payments
Initialize the amazonPayment object with the environment variable, and all required config parameters.
The amazonPayments.Environment
object contains two properties: Production
and Sandbox
, pass one of these in the configuration object. Use ProductionEU
and SandboxEU
for European countries.
Example:
var amazonPayments = require('@madison-reed/amazon-payments');
var payment = amazonPayments.connect({
environment: amazonPayments.Environment.Production,
sellerId: 'Amazon Seller ID',
mwsAccessKey: 'MWS Access Key',
mwsSecretKey: 'MWS Secret Key',
clientId: 'Client ID'
});
This module will automatically sign all requests and convert nested objects to dot notation.
Example:
payment.offAmazonPayments.refund({
AmazonCaptureId: 'Amazon capture ID',
RefundReferenceId: 'Refund Reference ID',
RefundAmount: {
Amount: 123.45,
CurrencyCode: 'USD'
}
}, function(err) {
console.log(err);
})
Will make a call with the following parameters:
{
"AmazonCaptureId": "Amazon capture ID",
"RefundReferenceId": "Refund Reference ID",
"RefundAmount.Amount": 123.45,
"RefundAmount.CurrencyCode": "USD"
}
getTokenInfo takes two parameters: accesToken and callback. More Info
callback: err, tokenInfo
Example:
payment.api.getTokenInfo('access token from button', function(err, tokenInfo) {
console.log(tokenInfo);
});
getProfile takes two parameters: accesToken and callback. More Info
callback: err, profile
Example:
payment.api.getProfile('access token from button', function(err, profile) {
console.log(profile);
});
All the methods in the offAmazonPayments object take two parameters: params and callback. The functions are all named the same as their respective API calls, except with a lowercase first letter. More Info
Exmaple:
payment.offAmazonPayments.getAuthorizationDetails({
AmazonAuthorizationId: 'P01-0000000-0000000-000000'
}, function(err, details) {
// details will be the authorization details
});
Version 0.1.2 added SNS response handling for dealing with SNS messages. This also includes support for IPN endpoints. This will check the signature and attempt to parse any XML within IPN requests, if the message is not JSON it will return the raw message data, otherwise it will be the parsed response.
Example:
payment.parseSNSResponse(responseFromSns, function(err, parsed) {
// parsed will contain the full response from SNS unless the message is an IPN notification, in which case it will be the JSON-ified XML from the message.
});
FAQs
API wrapper for Amazon Payments
The npm package @madisonreed/amazon-payments receives a total of 132 weekly downloads. As such, @madisonreed/amazon-payments popularity was classified as not popular.
We found that @madisonreed/amazon-payments demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.