New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bthn/paypal-rest-sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bthn/paypal-rest-sdk

SDK for PayPal Rest APIs

  • 3.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 29 Jul 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc