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 PayPal. you 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.

Sundaravel M

About the author: Hi! I'm Sundaravel (codesundar), Founder of I have been a Web, Mobile App developer, Author, and Teacher since 2014. I also worked as a software consultant for fortune 500 companies. I created to share my real-time knowledge in various technologies such as PhoneGap, Ionic, Flutter and more.