npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bthn/paypal-rest-sdk

v3.0.0

Published

SDK for PayPal Rest APIs

Downloads

8

Readme

PayPal SDK 2.0.0-beta Build Status

This is a preview of how PayPal SDKs will look in the next major version. We've simplified the interface to only provide HTTPRequest that can easily be called via our HttpClient.

What's New

Please see the CHANGELOG.md for the latest changes.

Example

Creating a Payment

const paypal = require('paypal-rest-sdk');
const payments = paypal.v1.payments;

let env;
if (process.env.NODE_ENV === 'production') {
  // Live Account details
  env = new paypal.core.LiveEnvironment('Your Live Client ID', 'Your Live Client Secret');
} else {
  env = new paypal.core.SandboxEnvironment('AdV4d6nLHabWLyemrw4BKdO9LjcnioNIOgoz7vD611ObbDUL0kJQfzrdhXEBwnH8QmV-7XZjvjRWn0kg', 'EPKoPC_haZMTq5uM9WXuzoxUVdgzVqHyD5avCyVC1NCIUJeVaNNUZMnzduYIqrdw-carG9LBAizFGMyK');
}

let client = new paypal.core.PayPalHttpClient(env);

let payment = {
  "intent": "sale",
  "transactions": [
    "amount": {
      "currency": "USD",
      "amount": "10"
    }
  ],
  "redirect_urls": {
    "cancel_url": "http://example.com/cancel",
    "return_url": "http://example.com/return"
  },
  "payer": {
    "payment_method": "paypal"
  }
};


let request = new payments.PaymentCreateRequest();
request.requestBody(payment);

client.execute(request).then((response) => {
  console.log(response.statusCode);
  console.log(response.result);
}).catch((error) => {
  console.error(error.statusCode);
  console.error(error.message);
});

If you're migrating from v1, check out our Migration Guide or our Frequently Asked Questions.

Building

To try this out, update the version of paypal-rest-sdk in your package.json to 2.0.0-rc.1.

Please feel free to create an issue in this repo with any feedback, questions, or concerns you have.

Running tests

To run integration tests using your client id and secret, clone this repository and run the following command:

$ npm install
$ npm test

NOTE: This API is still in beta, is subject to change, and should not be used in production.

Feedback

If you have any suggestions/remarks/feedback related to SDK 2.0.0, feel free to create an issue.

License

PayPal-Node-SDK is open source. See the LICENSE file for more info.

Contributions

Pull requests and new issues are welcome. See CONTRIBUTING.md for details.