Search code examples
javascriptandroidpaypalin-app-purchasetitanium

PayPal Button in android not working


I am trying this code for android to add a pay-pal button but it is giving errors.I think the error is because this code was for Iphone and i am using it for android.Does any one have code for android paypal button.The code is as follows

 var PayPal = require('ti.paypal');
     var paypalButton = Titanium.Paypal.createPaypalButton({
     appId:"APP-XXXXXXXXXXX",
     width:100,
  height:30,
  buttonStyle:Titanium.Paypal.BUTTON_68x24,
  paypalEnvironment:Titanium.Paypal.PAYPAL_ENV_SANDBOX,
  feePaidByReceiver:false,
  transactionType:Titanium.Paypal.PAYMENT_TYPE_SERVICE,
  enableShipping:true,
    payment: 
  {
    amount: 15.00,
    tax: 0.00,
    shipping: 5.00,
    currency: "GBP",
    recipient: "[email protected]",
    itemDescription: "Test",
    senderEmailOrPhone:'test@mail'
    //merchantName: Titanium.App.Properties.getString('storeName')
    }
  });

and i am adding this in tiapp.xml

  <module platform="android" version="2.2.1">ti.paypal</module>

Solution

  • There is an publicly open module for PayPal for both android and iOS. Just download this version:

    https://marketplace.appcelerator.com/apps/780?1115227925
    

    Not sure where you got your version 2.2.1 from. Either from the future, or some other place.