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

paypal-pay

v0.1.1

Published

Minimalist 'send money to email' - using the Paypal API

Downloads

18

Readme

Minimalist 'send money to email' - using the Paypal API

The module is a simple wrapper on top of the paypal-adaptive-sdk-nodejs module. By default sender pays all fees.

Installation

Installing the module

npm install paypal-pay

How to use

var pay = require('paypal-pay')({
{
      //required parameters
      'userId': '',
      'password': '',
      'signature' : '',

      //make sure that senderEmail and above credentials are from the same paypal account
      //otherwise paypal won't compete payment automatically
      'senderEmail' : '',

      //optional parameters and their defaults
      'sandbox': true,
      'feesPayer': 'SENDER',
      'currencyCode': 'USD',
});

pay('[email protected]', 18.00, "This is an example memo', function(err, response){
    if(err){
        //response.error -- will contains errors if something went wrong
        //see response examples below for more details

        return;
    }
});

Useful information:

Paypal adaptive payments api documentation.

How to get started?

  1. Check your account status. Login to PayPal. Go to your PayPal Profile and click My settings. Confirm that your Account type is either Premier or Business, or upgrade your account.
  2. Check your API settings. Click My selling tools. Expand Selling online if needed and check API access. Click Update and Add or edit API permission or View API signature.
  3. Test your integration using the PayPal Sandbox, as described in Testing Classic API Calls. All Adaptive API calls in the Sandbox must have the following standard value as the App ID: APP-80W284485P519543T
  4. To go live with your application, follow the submission steps outlined in Going Live with Your Application. When you submit your application to PayPal for review, the application is quickly scanned for the requests to PayPal operations. If no "advanced" operations are found, PayPal issues an App ID for the production servers at the time you submit the application. If your application uses "advanced" PayPal operations, or if your application implements a complex business model, you can expect the review to take approximately 10 – 15 days.

More information can be found in Paypal adaptive payments documentation

Response examples:

Success:

{
   "responseEnvelope":{
      "timestamp":"2014-03-25T00:03:02.486-07:00",
      "ack":"Success",
      "correlationId":"30eb8c99e2200",
      "build":"10175386"
   },
   "payKey":"AP-5RW588649M220974T",
   "paymentExecStatus":"COMPLETED",
   "paymentInfoList":{
      "paymentInfo":[
         {
            "transactionId":"4DB51146SF913544T",
            "transactionStatus":"COMPLETED",
            "receiver":{
               "amount":"10.00",
               "email":"[email protected]",
               "primary":"false",
               "accountId":"MY2AP9Y85VAD6"
            },
            "pendingRefund":"false",
            "senderTransactionId":"9TA40881PA968474G",
            "senderTransactionStatus":"COMPLETED"
         }
      ]
   },
   "sender":{
      "accountId":"S46RUQD499YWJ"
   },
   "httpStatusCode":200
}

Error:

{
   "responseEnvelope":{
      "timestamp":"2014-03-24T23:49:22.419-07:00",
      "ack":"Failure",
      "correlationId":"6db128a52e68c",
      "build":"10175386"
   },
   "error":[
      {
         "errorId":"589039",
         "domain":"PLATFORM",
         "subdomain":"Application",
         "severity":"Error",
         "category":"Application",
         "message":"The email address [email protected] is invalid. It may not be registered in PayPal's system yet",
         "parameter":[
            "[email protected]",
            "Sender Account not found"
         ]
      }
   ],
   "httpStatusCode":200
}

Contribution

We are happy to accept pull requests. Before issue pull request please make sure that tests are passing and code formatting is okay via grunt command.