launching url with form variables for PayPal button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

launching url with form variables for PayPal button

Post by cusingerBUSCw5N » Sat Dec 29, 2012 6:08 am

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

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: launching url with form variables for PayPal button

Post by cusingerBUSCw5N » Sat Dec 29, 2012 6:16 am

I think the solution is with RevBrowser. I never looked at it before...

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: launching url with form variables for PayPal button

Post by cusingerBUSCw5N » Sat Dec 29, 2012 6:41 am

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: launching url with form variables for PayPal button

Post by Simon » Sat Dec 29, 2012 7:52 am

Use mobileControlCreate "browser"
Look up "browser" in the dictionary.

Also there is this:
http://www.discamus.com/nunc/how/
Lots to see there.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: launching url with form variables for PayPal button

Post by FourthWorld » Sat Dec 29, 2012 4:10 pm

Simon wrote:Also there is this:
http://www.discamus.com/nunc/how/
Lots to see there.
Good find - thanks for that.

Is that site yours? If not, how did you stumble across it?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: launching url with form variables for PayPal button

Post by Simon » Sat Dec 29, 2012 7:42 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: launching url with form variables for PayPal button

Post by jacque » Sat Dec 29, 2012 9:31 pm

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
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: launching url with form variables for PayPal button

Post by cusingerBUSCw5N » Sat Dec 29, 2012 9:47 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: launching url with form variables for PayPal button

Post by Simon » Sat Dec 29, 2012 10:14 pm

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.
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&currency_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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: launching url with form variables for PayPal button

Post by jacque » Sun Dec 30, 2012 12:50 am

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”