Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

PayPal Plugin for PhoneGap iPhone

with 34 comments

First release of the PayPal Plugin for PhoneGap iPhone. Right now it handles static payments only (no dynamic changes to include shipping etc). Thanks to Chris Booth of Signature Digital in the UK for sponsoring development and also allowing it to be released to the PhoneGap community.

Nothing much to look at in the first screenshot, but with CSS styling and using PayPal’s official web button images it can look better. View the README and check out the sample app’s index.html for usage. Triggering the “Pay” button will launch the native workflow in the second screenshot.

NewImage.jpg

paypal_phonegap_plugin_2.jpg

 

Written by shazron

October 8, 2010 at 7:01 pm

Posted in phonegap

34 Responses

Subscribe to comments with RSS.

  1. When I build paypal plugin on phonegap to run on device, I get 4 errors and 4 warning.
    The first error,

    can’t find protocal declaration for PayPalMEPDelegate
    @interface SAiOSPaypalPlugin : PhoneGapCommand

    Expect ( and ) failure at
    – (void) paymentFailed:(PAYPAL_FAILURE)errorType

    can you tell me how to fix this isssue?

    sam

    November 11, 2010 at 10:39 am

    • Should be in one of the steps of the README, did you include the Paypal code?

      shazron

      November 26, 2010 at 3:36 am

  2. Now I got the code running but when I login to pay pay and make payment through sandbox, I got this error.

    I am using paypal phonegap pluging. When I make payment through paypal sandbox, I get error. “Payment is not complete. Add valid payment method for this amount on your computer”.

    What is the valid paypal payment method?
    Where do I add this valid payment method in the code of paypal phonegap plugin.

    sam

    November 26, 2010 at 11:06 am

  3. What does your .prepare(…) code look like? Take a look at the SAiOSPaypalPlugin.js file for the doc.

    shazron

    December 4, 2010 at 1:35 am

  4. My prepare code is similar to your example. Accept, I changed the env to sandbox. I run your sample code that come wtih the doc. I got the same error. I forward to PayPal and they don’t know what is wrong with it.

    Did you ever get it run with the paypal sandbox?

    sam

    December 4, 2010 at 1:46 am

  5. For sandbox to work you need to have sandbox test accounts, and change the code in my sample for the test accounts. Make sure you read everything here: https://www.x.com/docs/DOC-1379

    shazron

    December 4, 2010 at 1:58 am

  6. Yes, I do have sandbox test account. I did read your document. I try out your sample app by changing app_id from paypal. I also use my test account that I created from the sandbox.

    That is the reason I found out that your sample does not work. It does not the send the transaction to sandbox.

    sam

    December 4, 2010 at 11:55 am

    • if you send me your sandbox test account credentials privately, I can debug this when I have some free time later today (hopefully), send to shazron at nitobi.com

      shazron

      December 6, 2010 at 8:14 am

  7. Hey, that’s great. I was desperately looking for a phonegap paypal plugin. Are there any plans to develope a phonegap paypal plugin for other platforms than iOS? (e.g.: Android and Blackberry)

    christian

    February 21, 2011 at 4:29 pm

  8. It is interesting. Is there any detail implementation docs?
    I have tried integration but seems that it is only dummy account. How can I change it into live? In the SAiOSPaypalPlugin.m, by default, it is set to ENV_NONE. I can’t try it with ENV_SANDBOX or ENV_LIVE.

    Any hints?

    Howard

    March 20, 2011 at 9:22 am

  9. I get this …
    ERROR: Plugin ‘SAiOSPaypalPlugin’ not found, or is not a PGPlugin. Check your plugin mapping in PhoneGap.plist.

    How to solve this..I am new to PhoneGap..guide me..

    Dinesh

    October 21, 2011 at 1:26 pm

  10. It is good. Now paypal give more tools and flexibility to build it in many type of phones.

    Tim-on Web

    November 17, 2011 at 2:17 am

  11. HI, does this allow CC payments through paypal? might be what im looking for if it does. If not, how much work you think it would be to use this as a base?

    james

    January 23, 2012 at 9:08 pm

  12. I get the following error
    ERROR: Plugin ‘SAiOSPaypalPlugin’ not found, or is not a PGPlugin. Check your plugin mapping in PhoneGap.plist.

    How to solve this..I am new to PhoneGap..guide me..

    Sumon

    February 20, 2012 at 12:51 pm

    • I have fixed it. Just add the plugin name in the phonegap.plist file

      Sumon

      February 22, 2012 at 8:20 am

  13. I am working with Cordova 1.5 ,i am not able to install the plugin ,when i click on the pay button nothing happens ,suggest me some thing ,i am new to cordova .Reply soon

    opentechjitu

    March 29, 2012 at 10:51 am

    • The plugin does not work with Cordova 1.5 currently.

      shazron

      March 29, 2012 at 3:47 pm

  14. when i click on the pay button nothing is happens so please suggest me some thing about this .I am new to phone gap /cordova .

    opentechjitu

    March 29, 2012 at 10:53 am

  15. There are any quick way to port this plugin to the new version, Córdova 1.6.1?

    el Tariro

    April 19, 2012 at 9:47 am

    • There should be an updated plugin in the phonegap-plugins repo, under the iOS (not iPhone) folder.

      shazron

      May 11, 2012 at 6:26 pm

  16. I get this message everytime:

    PGPlugin.h doesnt exist. I have cordova 2.0.0

    any help with this?

    RAV

    August 3, 2012 at 10:35 pm

    • Use the brackets based import.
      #import

      Are you using the updated plugin in phonegap-plugins/iOS? (not iPhone)

      shazron

      August 7, 2012 at 1:37 am

  17. I get this Error in Paypal send box ERROR: Plugin ‘SAiOSPaypalPlugin’ not found, or is not a PGPlugin. Check your plugin mapping in PhoneGap.plist.

    Nikunj Akbari

    September 27, 2012 at 1:54 pm

  18. Hi, Paypal plugin is working in iphone simulator (X-code 4.3) but it’s not working on iphone. what to do?

    Gajanan

    October 8, 2012 at 5:51 am

    • What’s the error?

      shazron

      October 17, 2012 at 11:25 pm

      • I think I have the same issue (I am using Cordova 2.1). Searching I see problem was described here
        https://github.com/phonegap/phonegap-plugins/issues/514

        I tried to upgrade the MPL library and had to tweak the SAiOSPaypalPlugin files to match the new APIs, however when i start up in the simulator I am getting a whitelist error
        ERROR whitelist rejection: url=’https:/mobileclient.sandbox.paypal.com/GMAdapter/DeviceInterrogation’

        I do have the entries in Cordova.plist externalHost already.

        Any help would be appreciate.
        Thanks

        Matt

        October 22, 2012 at 12:42 am

  19. Thank you for creating this plugin for PayPal. I am currently using cordova 2.1 and running into some issues. The plugin builds just fine for me. I am able to launch the simulator and see the Pay button like you have on the screen shot above. However when I click on Pay button nothing happens. The underlying SAiOSPaypalPlugin.install never seems to get invoked.

    Not sure what I am missing in my setup. I would really appreciate any help on this matter. I am willing to email you my test sandbox. I made sure to update my cordova.plist by adding SAiOSPaypalPlugin to the list of plugins.

    I also made sure I whitelisted all external host urls.

    any help from this experienced community would be appreciated.

    al maz

    October 17, 2012 at 4:09 pm

  20. Can we have updated version of phonegap paypal plugin for iphone and ipad which is compatible with Cordova-2.3.0 latest version?

    Abdulqadir

    January 22, 2013 at 5:49 am

  21. Hi. First let me Thank you for giving a nice plugin. Now my problem is i can’t send multiple products to PayPal plugin. In index.html i gave an array of products to setPaymentInfo() and sent to PayPal where i got error and app got terminated. Could you please tell me how to solve this problem. Your help is appreciated.

    sabarish1274

    April 24, 2013 at 1:51 pm

  22. Does it work only in US region? When I try to test it in other regions I can’t login into sandbox account.

    blind

    August 12, 2013 at 11:20 am

    • No idea – the plugin has been moved to another maintainer actually.

      shazron

      October 15, 2013 at 10:13 pm


Leave a reply to shazron Cancel reply