1

Has anybody had any success in setting up Paypal payments that will run within a Phonegap IOS app?

Our brief is to allow a client to setup payments within the app via the CMS.

My method currently is to populate a standard buy button form which is loaded into the app via json - This is triggered when user makes a booking - they would be sent outside the app to a Paypal page running in Safari - when the payment is completed Paypal will re-direct to a secure server page - which will receive the transaction ID from paypal - de-crypt this (via paypal supplied code) to receive payment info - store relevant transaction data in the DB and then trigger the app to re-open and ideally trigger a function inside the app which will refresh the order based on data received from the CMS.

Sounds very convoluted - but due to the restrictions of opening the paypal form within the app - and the fact that we need to make buy buttons on the fly for a wide range of users - this is the best I can come up with.

Does anyone have any better suggestions / tried and tests solutions!?

Dancer
  • 17,035
  • 38
  • 129
  • 206

2 Answers2

1

Right now I'm trying to figure out what provides best experience in terms of payments in PhoneGap on iOS...

enter image description here

Speaking of PayPal: Just tried their workflow and I must admit it works out of the box really well with one BUT: return URL brought me to an external site, all withing context of Cordova app. (it can be probably fixed by overriding default url, to native app, which is detected here, or maybe using InAppBrowser)

when the payment is completed Paypal will re-direct to a secure server page - which will receive the transaction ID from paypal

Please see the difference:

  • https://www.paypal.com/pdt - Payment Data Transfer - cannot rely, user can just close the browser (close the app in this particular case)
  • https://www.paypal.com/ipn - Instant Payment Notification - automated post to your backend, much better indication if the payment was completed

(I'll fiddle more in this area and share findings if they are relevant)

Community
  • 1
  • 1
Mars Robertson
  • 12,673
  • 11
  • 68
  • 89
  • Cool cheers Michal, are you using the buy button method here then? I guess that takes you outside the app to complete any payments? Cheers – Dancer Apr 15 '13 at 08:39
  • Ask computer, give it a try :) Actually PayPal login is displayed within the app. It was the **return url** that caused issues - it uses absolute URL and rather than see 3 buttons upon successful payments I was redirected to some other site, all within Cordova app (edited answer for clarity). It was getting late last night, Today will try similar trick with InAppBrowser... – Mars Robertson Apr 15 '13 at 09:31
0

If you're comfortable with a bit of Objective-C, you could take a crack at a PhoneGap plugin for the new PayPal iOS SDK. You could look at the card.io PhoneGap plugin as a model.

Josh Bleecher Snyder
  • 8,262
  • 3
  • 35
  • 37