Ppmpl is a project mainly written in Java, based on the View license.
JavaScript native apps with PayPal MPL
JavaScript PayPal MPL is a JavaScript-Java bridge to the PayPal Mobile Payment Library (MPL) for Android.
It allows JavaScript native apps to use the PayPal MPL for Android (just like Java native apps) without adding any payment code (to send credentials securely) to a back-end web server.
To install:
Use the following JavaScript library calls in JavaScript code:
Check initialization status (recheck until status == "1")
status = mpl.getStatus();
Set payment information
obj = {};
obj.paymentAmount = '29.99';
obj.paymentCurrency = 'USD';
obj.recipient = '[email protected]';
obj.itemDesc = 'some description';
obj.merchantName = 'some merchant';
obj.customID = 'some identifier';
obj.ipnUrl = 'some URL';
obj.tax = '';
obj.shipping = '';
str = JSON.stringify(obj);
mpl.setPaymentInfo(str);
Make payment
mpl.pay(0);
Get payment results
str = mpl.getPaymentResults();
obj = JSON.parse(str);
See obj['resultTitle'], obj['resultInfo'], obj['resultExtra']
See assets/www/index.html for example code.
Button images may be found at https://www.paypal.com/newlogobuttons
The library can be tested against a standalone server (PayPal.ENV_NONE), a PayPal sandbox server (PayPal.ENV_SANDBOX), or on a live PayPal server (PayPal.ENV_LIVE).
The server type is configured during library initialization (see src/com/ppmpl/ppmpl.java).
The standalone system is self-contained in the PayPal MPL. To setup a sandbox or a live account, see https://developer.paypal.com
Please post questions or comments on Github