M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Installing 3rd Party Plugin

Well, I am not too sure about the Paypal Buy now button but I think after a successful transaction it would call your page. I think you may need to verify the referrer just to be safe. You should be able to read the post variables and do what's necessary thereon. Here is some information that may help: https://developer.paypal.com/webapps/...

Btw I feel that using the Paypal API will give you much better control and I also think it could be easier to deal with. Cheers

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Installing 3rd Party Plugin

So this is how it would work:

  1. User pays

  2. Paypal transaction succeeds

  3. Your page gets called ( I am sure there must be plenty of templates or even complete code available. You may just need to change a few values)

  4. Verify the http referrer

  5. Read all the data passed to your page by post variables

  6. Call your own API to update your table (rather 'collection' if you are using Appery's Db which I think is MongoDB

    The link here will give you a very good 'idea' as to how this is done in php: http://www.sanwebe.com/2012/07/paypal.... The implementation will not differ much if using another language

    Cheers,
    M.M

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Installing 3rd Party Plugin

Hi M&M,

I can't thank you enough for all your help with this!! I will take a look at all of this great information and will get back to you.

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Installing 3rd Party Plugin

Hi M&M,

In reference the link that you provided for the php script, I assume that would only work for HTML5 apps and not IOS/Android unless the Appery builder works with php?

In the past, I had found a possible solution with using a PayPal IPN Listener script. However, the recommended scripts are only available in PHP, PERL, ASP.NET, Classic ASP, and Cold Fusion (not in Javascript which is required with the Appery builder): https://developer.paypal.com/docs/cla...

Also available on GitHub: https://github.com/paypal/ipn-code-sa...

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Installing 3rd Party Plugin

hi,

When the payment processing is done, it will be done on a server and rarely on a mobile device. I assume you are hosting a site on a server somewhere? Upon successful payment you can have that page to be called, validate / process the values passed to you by paypal and then use Appery API (from within your php page) to update your table / collection. There are plenty of examples on Appery API.

Cheers,
M&M

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Installing 3rd Party Plugin

Hi M&M,

That makes a lot of sense. I will follow the above and let you know my results. Thanks again for all your help!! I really appreciate it.

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Installing 3rd Party Plugin

Hi M&M,

The approach I took to test things is:

  • User registers through App and his/her info is saved onto Appery database

  • I setup a PayPal Subscription Button which takes the user to PayPal to pay for the subscription. Once payment is made, user is redirected back to the App Premium section login page.

  • I installed ANGELLEYE's PayPal IPN PHP Script Template (https://www.angelleye.com/product/pay...) which communicates with PayPal, posts the data to a mysql database, and shows the paid subscriptions through admin panel and sends me email confirmations.

    In your previous post you had mentioned:

    "Upon successful payment you can have that page to be called, validate / process the values passed to you by paypal and then use Appery API (from within your php page) to update your table / collection."

    I believe I still need two scripts:

  • one script to update the Appery user collection to show that user had paid

  • one script to check Appery database if user has paid at time of login

    I am not sure where to find the above two scripts to accomplish this.

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Installing 3rd Party Plugin

hi,

Basically you'll just need to use Appery Database REST API. It can be called using
cURL. cURL is a library that lets you make HTTP requests in PHP.

The Appery Database REST API is well documented here
https://devcenter.appery.io/documenta...

And some basic cURL php examples are here
http://codular.com/curl-with-php

Generally you will have to only deal with GET and POST methods. Hope that helps.

Cheers

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Installing 3rd Party Plugin

Hello M&M,

Thank you for taking the time to help with this! I really appreciate it. I will take a look at it.

Appery has put together so many great tutorials and I wish they had one for this (how to setup PayPal Subscription-based recurring payments). I discovered I am not the only one who has run into this.

Thanks again!

Return to “Issues”