paypal-rest-sdk
SDK for PayPal REST APIs
$ cnpm install paypal-rest-sdk 
SYNC missed versions from official npm registry.

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.

Creating a Payment

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

let 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.

Current Tags

  • 2.0.0-rc.2                                ...           beta (2 years ago)
  • 1.8.1                                ...           latest (3 years ago)

44 Versions

  • 2.0.0-rc.2                                ...           2 years ago
  • 2.0.0-rc.1                                ...           2 years ago
  • 2.0.0-beta.2                                ...           2 years ago
  • 2.0.0-beta.1                                ...           3 years ago
  • 1.8.1                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 2.0.0-beta.0                                ...           3 years ago
  • 1.7.1                                ...           4 years ago
  • 1.7.0                                ...           4 years ago
  • 1.6.9                                ...           4 years ago
  • 1.6.8                                ...           5 years ago
  • 1.6.7                                ...           5 years ago
  • 1.6.6                                ...           5 years ago
  • 1.6.5                                ...           5 years ago
  • 1.6.4                                ...           5 years ago
  • 1.6.3                                ...           5 years ago
  • 1.6.1                                ...           5 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.3                                ...           5 years ago
  • 1.5.2                                ...           5 years ago
  • 1.5.1                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.2                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.10.0                                ...           6 years ago
  • 0.9.3                                ...           6 years ago
  • 0.9.2                                ...           6 years ago
  • 0.9.1                                ...           6 years ago
  • 0.9.0                                ...           6 years ago
  • 0.8.0                                ...           6 years ago
  • 0.7.0                                ...           6 years ago
  • 0.6.4                                ...           7 years ago
  • 0.6.3                                ...           7 years ago
  • 0.6.2                                ...           7 years ago
  • 0.6.1                                ...           7 years ago
  • 0.6.0                                ...           7 years ago
  • 0.5.1                                ...           7 years ago
  • 0.5.0                                ...           7 years ago

Copyright 2014 - 2016 © taobao.org |