title: Passing custom value to payPal/Cordova plugin through Angularjs
body: <p>I am trying to add payPal plugin to my cordova/Angularjs app. Everything works well when i test it with predefined values. However it fails when i try to pass my own custom value to it.</p>
  
  <p>Please how do i pass value/data to the makePayment() or createPayment() Method in Angularjs.
  When i Do <code>Wallet.makePayment($scope.MMParams);</code> in the controller
  I get "cannot get property value of undefined."</p>
  
  <pre><code> .factory('Wallet', function ($q, $ionicPlatform, $window) {
      var service = {
          initPaymentUI: initPaymentUI,
          onSuccesfulPayment: onSuccesfulPayment,
          onFuturePaymentAuthorization: onFuturePaymentAuthorization,
          createPayment: createPayment,
          configuration: configuration,
          onPrepareRender: onPrepareRender,
          onPayPalMobileInit: onPayPalMobileInit,
          onUserCanceled: onUserCanceled,
          makePayment: makePayment
      };
  
  
      function initPaymentUI() {
          var clientIDs = {
              "PayPalEnvironmentProduction": "YOUR_PRODUCTION_CLIENT_ID",
              "PayPalEnvironmentSandbox": "YOUR_SANDBOX_CLIENT_ID"
          };
          PayPalMobile.init(clientIDs, onPayPalMobileInit());
  
      }
  
      function onSuccesfulPayment(payment) {
          console.log("payment success: " + JSON.stringify(payment, null, 4));
      }
  
      function onFuturePaymentAuthorization(authorization) {
          console.log("authorization: " + JSON.stringify(authorization, null, 4));
      }
      function createPayment() {
          // for simplicity use predefined amount
          var paymentDetails = new PayPalPaymentDetails("1.50", "0.40", "0.05");
          var payment = new PayPalPayment("1.95", "USD", "Awesome Sauce", "Sale", paymentDetails);
          return payment;
      }
      function configuration() {
          // for more options see `paypal-mobile-js-helper.js`
          var config = new PayPalConfiguration({merchantName: "My Test Shop", merchantPrivacyPolicyURL: "https://mytestshop.com/policy", merchantUserAgreementURL: "https://mytestshop.com/agreement"});
          return config;
      }
      function onPayPalMobileInit() {
          // must be called
          // use PayPalEnvironmentNoNetwork mode to get look and feel of the flow
          PayPalMobile.prepareToRender("PayPalEnvironmentNoNetwork", configuration(), onPrepareRender());
      }
      function onUserCanceled(result) {
          console.log(result);
      }
      function onPrepareRender() {}
  
      function makePayment() {
          PayPalMobile.renderSinglePaymentUI(createPayment(), onSuccesfulPayment(), onUserCanceled());
      }
  
      return service;
  });
  </code></pre>
  
  <p>I will be glad if someone can help, thank you.</p>