Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
paypal-rest-api
Advanced tools
This package is NOT supported by PayPal. The current PayPal Node SDK does not support the newest Javascript features. This package is intended to support the most cutting edge Javascript features.
npm install --save paypal-rest-api
The most up to date configuration options can be found on the IConfigureOptions interface
import { PayPalRestApi } from "../src";
const paypal = new PayPalRestApi({
client_id: "", // Your paypal client id
client_secret": "", // Your paypal client secret
mode: "sandbox", // "production" or "sandbox"
requestOptions: {
maxRetries: 2, // Sets the number of retries for 500 or Network timeout. Set to 0 to disable.
retryDelay: 5000, // Microseconds to wait until next retry. 5000 = 5 seconds
// Any options from the following
// https://github.com/FGRibreau/node-request-retry
// https://github.com/request/request
},
validate: true, // Turns on prevalidation. set to false if your validations are false negative. Only available in execute method.
});
It is STRONGLY recommended to use VSCode for the debugger and breakpoints.
// "examples/ANY_FILE_IN_EXAMPLES_FOLDER"
npm run example -- examples/request
Switch to the Debugger. Open the example file you want to run, select the "Launch Example File" configuration and select run.
There are 2 different methods to make API Calls. For full examples refer to the examples folder. View the common.js file for a CommonJS example using require.
The execute method can be executed for any api call that has a helper method.
import { PayPalRestApi } from "../src";
const paypal = new PayPalRestApi({
client_id: "YOUR_CLIENT_ID",
client_secret": "YOUR_CLIENT_SECRET",
mode: "sandbox",
});
paypal.execute("createInvoice", {
body: {
// https://developer.paypal.com/docs/api/invoicing/#invoices_create
merchant_info: {
business_name: "testy",
},
},
})
.then((response) => console.log)
.catch((err) => console.error);
If a helper method does not exist you can always use the request method to directly execute an API call to an endpoint. You must specify the path and method.
import { PayPalRestApi } from "../src";
const paypal = new PayPalRestApi({
client_id: "YOUR_CLIENT_ID",
client_secret": "YOUR_CLIENT_SECRET",
mode: "sandbox",
});
paypal.request("v1/invoicing/invoices/", {
body: {
merchant_info: {
business_name: "testy",
},
},
method: "POST",
})
.then((response) => console.log)
.catch((err) => console.error);
FAQs
A typescript module for integrating with PayPal REST APIs.
The npm package paypal-rest-api receives a total of 12 weekly downloads. As such, paypal-rest-api popularity was classified as not popular.
We found that paypal-rest-api 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.