Skip to content

apelade/payper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

payper

======

Node Examples for the PayPal REST API with AJAX

Featuring SuperAgent for this festival of AJAX.

  • It's a powerful ajax cleanser, and works on windows no problem.

There is a jquery version of these examples: payjaq

  • It's a longer install for the deps on windows, but that's where the jquery is at.

See the PayPal API

Install:

  • Run the nodejs.org installer.
  • Download the zip file.
  • Extract it and open a shell there.
  • npm install superagent
  • npm install -g coffee-script if desired?

Run:

  • node payper_test.js or coffee payper_test.coffee
  • coffee -cb payper_test.coffee compiles to javascript

Notes:

  • To create live test objects, get a dev client id and secret from PayPal.
  • Immutable PayPal-hosted objects may have outages, like on 4/4/2013 2:15 PM Pacific, or go away.
  • The error output was on res.body.payments[0]
  • TypeError cannot read property [0] of undefined
  • The tests that try to execute a payment Correctly Fail with PAYMENT_STATE_INVALID when running static PayPal test objects.
  • Note the payment approval step must have been taken by the user for completePayment to succeed.
  • Don't forget to redirect to approval_url listed in response links if using the paypal payment method. See a simple example.
  • Since this is an example, uses a single-arg callback.
  • Otherwise, it may be a callback per result state, using a common err handler.

License:

MIT

About

Node + SuperAgent PayPal REST API examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published