paypal-rest-sdk.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright 2015-2016 PayPal, Inc. */
  2. "use strict";
  3. var configuration = require('./configure');
  4. var api = require('./api');
  5. module.exports = function () {
  6. function configure(options) {
  7. api.configure(options);
  8. }
  9. function generateToken(config, cb) {
  10. api.generateToken(config, cb);
  11. }
  12. return {
  13. version: configuration.sdkVersion,
  14. configure: configure,
  15. configuration: configuration.default_options,
  16. generateToken: generateToken,
  17. payment: require('./resources/Payment')(),
  18. sale: require('./resources/Sale')(),
  19. refund: require('./resources/Refund')(),
  20. authorization: require('./resources/Authorization')(),
  21. capture: require('./resources/Capture')(),
  22. order: require('./resources/Order')(),
  23. payout: require('./resources/Payout')(),
  24. payoutItem: require('./resources/PayoutItem')(),
  25. billingPlan: require('./resources/BillingPlan')(),
  26. billingAgreement: require('./resources/BillingAgreement')(),
  27. creditCard: require('./resources/CreditCard')(),
  28. invoice: require('./resources/Invoice')(),
  29. invoiceTemplate: require('./resources/InvoiceTemplate')(),
  30. openIdConnect: require('./resources/OpenIdConnect')(),
  31. webProfile: require('./resources/WebProfile')(),
  32. notification: require('./resources/Notification')(),
  33. //entries below are deprecated but provided for compatibility with 0.* versions
  34. generate_token: generateToken,
  35. billing_plan: require('./resources/BillingPlan')(),
  36. billing_agreement: require('./resources/BillingAgreement')(),
  37. credit_card: require('./resources/CreditCard')(),
  38. openid_connect: require('./resources/OpenIdConnect')()
  39. };
  40. };