Page 1 of 1
launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 6:08 am
by cusingerBUSCw5N
I am trying to put a PayPal button on my app. The button uses form variables.
<form action="
https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="QB26J94CGNJAJ">
</form>
I found information from BYU's Livecode samples:
put fullname=" & tName & "&gender=" & tGndr & "&color=" & tColor into tArgList
post tArgList to URL "
http://my.web.site/sampleform.html"
put it into tFormResults
...but I don't want results back - I want it to launch a URL and have it process the form.
So I tried this:
Code: Select all
on mouseUp
put "cmd=_s-xclick&hosted_button_id=QB26J94CGNJAJ" into tArgList
post tArgList to URL "https://www.paypal.com/cgi-bin/webscr"
put it into tFormResults
answer tformresults
end mouseUp
but that failed - because I don't want tformResults ...and Paypal is looking for posted form variables, not url.variables.
Is this possible?
Thank you
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 6:16 am
by cusingerBUSCw5N
I think the solution is with RevBrowser. I never looked at it before...
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 6:41 am
by cusingerBUSCw5N
as usual, I am confused. I think that revbrowser is only for desktop...so that really isn't going to do me any good. I'm wondering what it's benefit is - since launch url seems to be the same thing and you can do it from all the devices ...but I am probably missing something.
I want a mobile device to be able to open up a url, but I want the form data to go with the url request.
Any help?
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 7:52 am
by Simon
Use mobileControlCreate "browser"
Look up "browser" in the dictionary.
Also there is this:
http://www.discamus.com/nunc/how/
Lots to see there.
Simon
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 4:10 pm
by FourthWorld
Good find - thanks for that.
Is that site yours? If not, how did you stumble across it?
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 7:42 pm
by Simon
Hi Richard,
No, it's not my site.
In researching Paypal, I kept coming across references to Scott Rossi's "Paypal Button". Never found it but stumbled across that site.
Simon
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 9:31 pm
by jacque
Is this app headed for the Apple app store? If so, they will reject it for having a non-approved payment method. Android is probably okay.
You can use the "launch" command to open the paypal url in the device's browser if you don't want to use the internal app browser. The easiest way to get the URL is to click on the button in a web browser, see where it takes you, and copy that URL into your script. Then the script would do this to open the device's browser app:
put "
https://www.paypal.com/cgi-bin/webscr?<whatever>" into tURLvar
launch tURLvar
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 9:47 pm
by cusingerBUSCw5N
Two questions
1) I wanted to send it via a form, not url parameters - so put
"
https://www.paypal.com/cgi-bin/webscr?<whatever>" into tURLvar
launch tURLvar
doesn't work.
It's not a big deal - I can take them to a website first and then have that website submit a form - but I was just wondering if Livecode could do it
2) RE the Apple payment issue. I want people to use the demo for free, but then if they want to sign up, they have to pay. Can that be handled through Apple?
Thanks
Re: launching url with form variables for PayPal button
Posted: Sat Dec 29, 2012 10:14 pm
by Simon
Don't follow what you mean by "doesn't work", here that exact url launches the browser. Now it doesn't take you to where I think you want to go.
Try:
Code: Select all
launch url "https://www.paypal.com/cgi-bin/webscr?business=home@somewhere.com&cmd=_xclick¤cy_code=USD&amount=12.34&item_name=Really%20cool%20app"
That will take you to the payment page.
But that is just the start of the process, have you figured out how to tell your app it's been upgraded?
Simon
EDIT: wait... this is not what you want

DOH
Re: launching url with form variables for PayPal button
Posted: Sun Dec 30, 2012 12:50 am
by jacque
cusingerBUSCw5N wrote:Two questions
2) RE the Apple payment issue. I want people to use the demo for free, but then if they want to sign up, they have to pay. Can that be handled through Apple?
Apple wants 30% of everything. Your app cannot take users to a web site that allows them to purchase, nor can you sell separate extras (like data, memberships, etc.) on a web site even if they aren't the actual app itself. Everything related to the app must be sold through the app store. If I remember right, Apple also will not allow timed apps that run for a while and then stop working. One approach is to release two versions, the demo version and the full paid version. There may be other ways I'm not thinking of.
The definitive answer would be over at the developer portal at Apple. Their rules are pretty strict.