Integrate PayPal with Cordova

Paypal is an international payment gateway provider where you can send and receive your money with multiple currencies.commission rates will be different based on their countries


Paypal Integration requires an account with can create new PayPal account for free

Initialising PayPal

document.addEventListener("deviceready", onDeviceReady);

function onDeviceReady() {
    var clientIDs = {
        "PayPalEnvironmentProduction": "YOUR_PRODUCTION_KEY", // not needed while testing
        "PayPalEnvironmentSandbox": "YOUR_SANDBOX_KEY"

    function onPayPalMobileInit() {
            "PayPalEnvironmentSandbox", // or "PayPalEnvironmentProduction" 
            new PayPalConfiguration({
                merchantName: "Shop Name",
                acceptCreditCards: true,
                merchantPrivacyPolicyURL: "",
                merchantUserAgreementURL: ""
            function() {
                console.log("OK, ready to accept payments!")
    PayPalMobile.init(clientIDs, onPayPalMobileInit);

Receiving Payment

function payNow() {
    var paymentDetails = new PayPalPaymentDetails("15.00", "3.00", "2.00");
    //new PayPalPayment Details("subtotal","shipping","tax");
    //PayPalPalment("total","currency in ISO 4217 format","Description","Sale",object);
    var payment = new PayPalPayment("20.00", "USD", "PhoneGapPro T-Shirt", "Sale", paymentDetails);

        function(payment) {
            alert("payment success: " + JSON.stringify(payment));
        function(error) {

PayPalMobile.renderSinglePaymentUI() will invoke payment UI for receiving money.