• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 12 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node.js PayPal Express Checkout for Single Payment

NPM version NPM quality NPM downloads MIT License

Node.js PayPal Express Checkout

PayPal account

Read here: https://developer.paypal.com/docs/classic/api/apiCredentials/#creating-an-api-signature

  • Log in to your PayPal business account at www.paypal.com. Click the profile icon ( Profile menu ) on the top right side of the page. From the Business Profile menu, select Profile and Settings.
  • From the left menu, click My selling tools.
  • In the Selling online section, click the Update link for the API access item.
  • To generate the API signature, click Request API Credentials on the API Access page. Request API credentials
  • Select Request API signature and click Agree and Submit to generate the API signature. Signature

$ npm install paypal-express-checkout

var Paypal = require('paypal-express-checkout');
// debug = optional, defaults to false, if true then paypal's sandbox url is used
// paypal.init('some username', 'some password', 'signature', 'return url', 'cancel url', debug);
var paypal = Paypal.init('username', 'password', 'signature', 'http://www.example.com/return', 'http://www.example.com/cancel', true);

// Localization (OPTIONAL): https://developer.paypal.com/docs/classic/api/locale_codes/
// paypal.locale = 'SK';
// or
// paypal.locale = 'en_US';

// checkout
// requireAddress = optional, defaults to false
// paypal.pay('Invoice number', amount, 'description', 'currency', requireAddress, customData, callback);
// paypal.pay('20130001', 123.23, 'iPad', 'EUR', function(err, url) {
// or with "requireAddress": true
paypal.pay('20130001', 123.23, 'iPad', 'EUR', true, ['custom', 'data'], function(err, url) {
	if (err) {
		console.log(err);
		return;
	}

	// redirect to paypal webpage
	response.redirect(url);
});

// result in GET method
// paypal.detail('token', 'PayerID', callback);
// or
// paypal.detail(totaljs.controller, callback);

paypal.detail('EC-788441863R616634K', '9TM892TKTDWCE', function(err, data, invoiceNumber, price, custom_data_array) {

	// custom_data_array {String Array} - supported in +v1.6.3

	if (err) {
		console.log(err);
		return;
	}

	// data.success == {Boolean}

	if (data.success)
		console.log('DONE, PAYMENT IS COMPLETED.');
	else
		console.log('SOME PROBLEM:', data);

	/*
	data (object) =
	{ TOKEN: 'EC-35S39602J3144082X',
	  TIMESTAMP: '2013-01-27T08:47:50Z',
	  CORRELATIONID: 'e51b76c4b3dc1',
	  ACK: 'Success',
	  VERSION: '52.0',
	  BUILD: '4181146',
	  TRANSACTIONID: '87S10228Y4778651P',
	  TRANSACTIONTYPE: 'expresscheckout',
	  PAYMENTTYPE: 'instant',
	  ORDERTIME: '2013-01-27T08:47:49Z',
	  AMT: '10.00',
	  TAXAMT: '0.00',
	  CURRENCYCODE: 'EUR',
	  PAYMENTSTATUS: 'Pending',
	  PENDINGREASON: 'multicurrency',
	  REASONCODE: 'None' };
	*/

});

##Β PayPal PAYMENTSTATUS

Canceled_Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you.
Completed: The payment has been completed, and the funds have been added successfully to your account balance.
Created: A German ELV payment is made using Express Checkout.
Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the pending_reason variable or the Fraud_Management_Filters_x variable.
Expired: This authorization has expired and cannot be captured.
Failed: The payment has failed. This happens only if the payment was made from your customer’s bank account.
Pending: The payment is pending. See pending_reason for more information.
Refunded: You refunded the payment.
Reversed: A payment was reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element.
Processed: A payment has been accepted.
Voided: This authorization has been voided.

How to prevent of pending paymentstatus?

Login into your bussiness account and click here: https://www.sandbox.paypal.com/ca/cgi-bin/?cmd=_profile-pref&source=acct_setup&fli=true

##Β Contributors

Contributor Type E-mail
Peter Ε irka author + support [email protected]
Martin Smola support + contributor [email protected]
Johann Botha contributor [email protected]

Images

Payment Card Types

PayPal Express Checkout Button

More Repositories

1

framework

Node.js framework
JavaScript
4,363
star
2

flow

Flow
HTML
540
star
3

examples

Total.js examples
JavaScript
455
star
4

eshop

Eshop + Content Management System (CMS) written in Node.js / Total.js.
HTML
267
star
5

cms

Node.js Content Management System
HTML
226
star
6

framework4

Total.js framework v4
JavaScript
98
star
7

openplatform

OpenPlatform v5 is a beautiful and simple portal for running, integrating and managing multiple 3rd party web applications.
HTML
98
star
8

helpdesk

HelpDesk open-source web applications for free for everyone. Download and use it!
JavaScript
97
star
9

superadmin

Manage your Linux servers and Total.js applications easily. Free and open-source.
JavaScript
97
star
10

flowcomponents

Open repository for Flow components
JavaScript
88
star
11

components

Components for Componentator
HTML
87
star
12

emptyproject-flow

Empty project: Flow
JavaScript
80
star
13

modules

Modules for Total.js web applications
JavaScript
77
star
14

messenger

Node.js Open-Source Slack alternative
JavaScript
67
star
15

jComponent

UI library for creating reusable UI components and SPA
JavaScript
63
star
16

Tangular

A simple JavaScript template engine like Angular.js for websites or node.js
JavaScript
61
star
17

node-sqlagent

SQL Agent is a missing ORM for Node.js + Total.js
JavaScript
50
star
18

code

Online collaboration app for everyone.
JavaScript
27
star
19

dashboard

A customizable dashboard application, compose your dashboard from widgets for free for everyone.
CSS
27
star
20

flowstream

A custom version of Flow
JavaScript
26
star
21

cmsbundle

Bundled Node.js CMS
JavaScript
23
star
22

blogengine

BlogEngine template for Bufferwall
JavaScript
23
star
23

documentation

Total.js documentation
HTML
22
star
24

iam

Total.js Identity and Access Management
JavaScript
21
star
25

jRouting

Great routing mechanism for client-side web applications
JavaScript
18
star
26

code-electron

Electron version of Total.js Code
HTML
17
star
27

spa

Single Page Application template
HTML
17
star
28

openplatform-application

A simple example of application for OpenPlatform.
HTML
16
star
29

wiki

Open-source Wiki documentation app.
JavaScript
16
star
30

dbms

Database Management System
JavaScript
15
star
31

flowstreamcomponents

FlowStream open-source components
HTML
15
star
32

flowboard

Flowboard
JavaScript
13
star
33

emptyproject-restservice

Empty project: REST service
JavaScript
13
star
34

flowstreamdesigner

FlowStream Designer
JavaScript
12
star
35

flowapp

Electron + Total.js + Flow
JavaScript
11
star
36

emptyproject-website

Empty project: Website
HTML
11
star
37

hello

A simple Trello alternative written in Node.js
JavaScript
10
star
38

emptyproject-postgresql

Total.js + PostgreSQL empty project
JavaScript
10
star
39

code-bundle

Bundle version of Code
JavaScript
10
star
40

emptyproject-flowboard

Empty project: Flow + Flowboard
JavaScript
10
star
41

tracker

Free and simple open-source issue tracker.
JavaScript
9
star
42

openplatform-electron

Electron wrapper
JavaScript
9
star
43

emptyproject-dashboard

Empty project: Flow + Dashboard
JavaScript
9
star
44

emptyproject-pwa

Empty project: PWA + jComponent + Total.js
JavaScript
8
star
45

dashboardcomponents

Dashboard components
JavaScript
8
star
46

openplatform-embedded

Embedded version of the OpenPlatform
JavaScript
8
star
47

flowboardcomponents

Flowboard components for Total.js Flowboard
HTML
7
star
48

performancemeter

A simple JavaScript code performance monitor
JavaScript
7
star
49

files

A simple Files demo
HTML
7
star
50

example

Full website example.
JavaScript
7
star
51

emptyproject

Empty project: Total.js
HTML
7
star
52

uistudio

UI Studio
HTML
6
star
53

emptyproject-designer

UI designer example
JavaScript
6
star
54

openplatform-bundle

OpenPlatform as a bundle
JavaScript
6
star
55

emptyproject-jcomponent

Empty project: jComponent
HTML
6
star
56

admin

Total.js Admin - Web Plugin System
JavaScript
5
star
57

totaldb

Total DB is a PostgreSQL database app for designing data structures.
JavaScript
5
star
58

code-cloud

5
star
59

openauth

OAuth 2.0 integrator
HTML
5
star
60

widgets

Widgets for Total.js CMS + Total.js Eshop
HTML
5
star
61

nosqlviewerapp

NoSQL viewer electron app
JavaScript
5
star
62

flowstreamexec

FlowStream execution for e.g. Serverless architecture
JavaScript
5
star
63

edbms

Elastic DBMS module
JavaScript
5
star
64

tms

Total.js Message Service (TMS) integrator application.
JavaScript
4
star
65

sublime-syntax

total.js view engine - syntax highlighter
4
star
66

flowtemplates

Flow templates
4
star
67

guidelines

Total.js Platform JavaScript style guide
4
star
68

atom-syntax

Atom.io syntax highlighting
4
star
69

nosqlviewer

NoSQL embedded browser application
JavaScript
4
star
70

emptyproject-typescript

Total.js Empty project with the TypeScript
HTML
3
star
71

livereload

Live reloading in debug mode.
JavaScript
3
star
72

uibuildercomponents

UI Builder components
HTML
3
star
73

visitors

Visitors tracker
JavaScript
3
star
74

openfiles

A simple Node.js web application for storing files
HTML
3
star
75

emptyproject-spa

SPA template
HTML
3
star
76

emptyproject-game

Empty project: WebSocket + Total.js
HTML
3
star
77

models

Total.js models
JavaScript
3
star
78

superadmin_templates

SuperAdmin templates
3
star
79

openlogger

OpenLogger
HTML
3
star
80

opentemplates

OpenTemplates
HTML
3
star
81

appbuilder

With the Total.js AppBuilder, you can create Total.js apps in the designer.
JavaScript
3
star
82

emptyproject-builder

Empty project with Total.js AppBuilder implementation
JavaScript
3
star
83

pages

Node.js (CMS) Content Management System
HTML
2
star
84

querybuilderpg

Total.js QueryBuilder PostgreSQL
JavaScript
2
star
85

pluginable

Pluginable App template
HTML
2
star
86

dashboard-widgets

Dashboard widgets
HTML
2
star
87

emptyproject-emptyspa

Empty SPA project
JavaScript
2
star
88

nosqlserver

NoSQL embedded server
JavaScript
2
star
89

opensync

Open synchronizator between multiple apps
HTML
2
star
90

emptyproject-websocket

Total.js with WebSocket empty project
JavaScript
2
star
91

todomator

Todomator bundle
HTML
2
star
92

layouts

Layouts for single page applications.
HTML
2
star
93

flowstreamworker

JavaScript
2
star
94

cmswidgetmaker

Widget Maker for Total.js CMS and Total.js Eshop
JavaScript
2
star
95

emptyproject-ui

Total.js + UI components
JavaScript
2
star
96

emptyproject-sqlagent

Empty project: Working with databases in Total.js
JavaScript
2
star
97

wikibundle

Bundled Node.js CMS
JavaScript
2
star
98

servermonitor

Total.js Server monitoring service
JavaScript
1
star
99

operations

Preddefined Total.js operations for Code editor
JavaScript
1
star
100

flowdesigner

Flow designer
HTML
1
star