Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

Also - some of you are interested in being able to add item detail to the Payment request - in order to add 1 or more items to the PayPalPayment manifest - and - it does look cleaner and more professional to the buyer.

Here's a quick tutorial to add items to your payPal Manifest:(be SURE TO BACKUP your project before you make significant changes like this - just in case):

  1. First - Change your PayPalPayment Service (that's what I called it in the original tutorial above). Here's how you adapt what you already have - into what's required....Remember - you are changing the "REQUEST" tab (not the response please).

    Image

    2.Next - Map data into the new fields on the request. In this example - I'm adding only 1 item to the Payment Request (you can obviously have multiple items - but you would ADD those to an array of items - prior to execution of this mapping - and do that in Javascript - examples, sample code, etc. - upon request .... again that's a bit more significant piece of work - and it requires some coaching from me that I cannot deliver here in this post. You're up to it though I know it!!!)

    Here's an example mapping for a single item (to the new fields in the request):

    Image

  2. And Viola!!! PayPal responds by showing you the list of items on the left side of their Payment UI :

    Image

    Questions - comments - contact me at the email address found on my profile.

    Best,

    Bruce

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

oh - and remember - none of this is rocket science.... I'm just developing the request by following along the documentation found on the PayPal developer - API Reference.

You can find that reference here - and make changes to any of your request - responses - by following the reference guide..... easy peasy....!!!

https://developer.paypal.com/webapps/...

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Paypal issues

Hello,

We have published Using PayPal API plugin tutorial, you can find it here https://devcenter.appery.io/documenta...

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

for anyone that continues to follow this thread - and has created a service as I chose to above - with the name "PayPalGetToken" - please change the name of this service to Pay_Pal_Make_Key - GetToken appears to be a reserved word somewhere (Chrome for Windows for sure) and on other platforms.

It caused me a few headaches (errors I could not make sense of or debug) when I was publishing my site where I used this service with this name.

Best,

Bruce

Kat Gutierrez
Posts: 0
Joined: Sun Apr 19, 2015 1:10 am

Paypal issues

Hello Bruce, if you get a chance, I sent you an e-mail this morning. I of course have run into some problems.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

Glad they are fixed now!

BRENT JOYCE
Posts: 0
Joined: Tue May 19, 2015 9:08 am

Paypal issues

Hi Bruce, the PayPal integration works fine for me in the Appery test environment. However it fails on the phone at the approvement stage; i.e. when the return url is called from PayPal. I don't receive details of the payment. Any ideas what the issue could be?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

Yes .... On browsers other than the desktop ... PayPal wipes out local storage so you can't execute your saved transaction information.

Save it to a collection data store prior to calling paypal and then know I the way back you've got to start all over again with your local storage. ( read it from the collection ... Log in again etc.)

BRENT JOYCE
Posts: 0
Joined: Tue May 19, 2015 9:08 am

Paypal issues

Hi Bruce, on the phone its alll of a sudden going back to the appery page when the payment is approved this doesn't happen in the browser. Any idea why this is happening?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Paypal issues

Yes - exactly what I stated - when you go to the PayPal website from your inApp browser - PayPal does you the 'favor' of clearing all of your localStorage.

When you come back from PayPal then - you will find that your event to 'process the payment' fails - and unless you have error handling in the event to display the error - it will take you back to the Appery page.

I can help with the issue (i've written code around it) . Bottom line there are two solutions:

  1. Implement the solution I refer to above - save all of your important memvars before calling payPal website and then upcoming coming back from PayPal - you need to login again, and read back restore the memvars - all before processing the paypal payment. This can be a real pain in the keester ... however, I have it working in an instance that I have and one for a client (a member of the forum here). unfortunately at this time - I don't have the cycles to post it here as I'm working another project for another member as well as a full time gig.

  2. You can collect credit card details on your side --- and then call the PayPal API using the credit card details already collected. I have not done that yet - but that's the path I recommend going down long term. It's better for the users (you don't leave your app which users hate) - and you get a response without having to leave the app. However, this is undocumented ground here on this forum - and will take some technical chops to pull off and there is a separate payPal approval process for this ---- its reasonably light weight - and you generally get approved in a couple of days.

    You might want to look at the other plugin - Stripe - I believe appery just did a tutorial on it...

    Best,
    Bruce

Return to “Issues”