Page 2 of 2
Installing 3rd Party Plugin
Posted: Sun Apr 03, 2016 6:03 am
by M&M
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
Installing 3rd Party Plugin
Posted: Sun Apr 03, 2016 6:13 am
by M&M
So this is how it would work:
User pays
Paypal transaction succeeds
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)
Verify the http referrer
Read all the data passed to your page by post variables
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
Installing 3rd Party Plugin
Posted: Sun Apr 03, 2016 8:16 pm
by Ed
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.
Installing 3rd Party Plugin
Posted: Sun Apr 03, 2016 9:58 pm
by Ed
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...
Installing 3rd Party Plugin
Posted: Sun Apr 03, 2016 10:20 pm
by M&M
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
Installing 3rd Party Plugin
Posted: Tue Apr 05, 2016 6:47 pm
by Ed
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.
Installing 3rd Party Plugin
Posted: Tue Apr 12, 2016 7:43 pm
by Ed
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.
Installing 3rd Party Plugin
Posted: Wed Apr 13, 2016 4:33 am
by M&M
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
Installing 3rd Party Plugin
Posted: Wed Apr 13, 2016 6:23 pm
by Ed
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!