How to convert html code into runrev script

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
LESTROSO
Posts: 85
Joined: Wed Apr 04, 2007 6:14 pm
Contact:

How to convert html code into runrev script

Post by LESTROSO »

Hy to everybody,

i try to integrate a pay pal button on my stack, can anyone help me please??? thanks a lot.......

here below my code, and i would like if possible to move/arrange where i want on the window stack....

Code: Select all

<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="xxxxxxxxxxxxxx">
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
i thank you so much in advance...... :oops:

Lestroso
http://fasasoftware.cwahi.net/
http://www.myspace.com/lestroso
Last edited by LESTROSO on Sun Jun 26, 2011 3:15 pm, edited 1 time in total.
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to convert html code into runrev script

Post by Mark »

Hi Lestroso,

Go back to your PayPal account. Find the e-mail link for your button. PayPal clearly states to provide this link to allow you to send this link by e-mail. You can use this link in your scripts. Just use the launch URL command to open the PayPal link in your browser.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
LESTROSO
Posts: 85
Joined: Wed Apr 04, 2007 6:14 pm
Contact:

Re: How to convert html code into runrev script

Post by LESTROSO »

MARK I thank you so much!!!!!! You are the best runrev Programmer i ever knew!!!!!

You always helped me so much in these years and other people!!!! :)

Thank again !!

Cheers,

Lestroso :D
jedthefed
Posts: 8
Joined: Sun Jun 26, 2011 1:07 am

Re: How to convert html code into runrev script

Post by jedthefed »

Can anyone be more clear on this as I am a newbie. I have a simular form to bring up in paypal but I am unclear how to do it. It is mentioned use launch URl command. Do i insert my entire form html code into one launchurl command?

Actually after reading this a few more times this person is calling upo a predefined button. I need to create the button on the fly. I have a form where you can pick up to 22 different items and any combination of items changes the subtotal, shipping cost and total to be passed to the cart.

Jed
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to convert html code into runrev script

Post by Mark »

Hi Jed,

You need to get yourself familiar with PayPal's syntax for link buttons. Here's an actual example:

Code: Select all

https://www.paypal.com/xclick/business=support%40economy-x-talk.com&item_name=Custom+Software+Solutions&no_shipping=1&cn=Additional+comments&&amount=84.03&tax=15.96&currency_code=EUR
You can easily change business, item_name, amount, tax and currency_code as needed. Create your URL by script and then use the launch URL command.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
jedthefed
Posts: 8
Joined: Sun Jun 26, 2011 1:07 am

Re: How to convert html code into runrev script

Post by jedthefed »

Thank you for your response. I have figured out how use a preconfigured PayPal button. The issue is that I have a form and people can select any combination of 22 different items. Combining items changes the total as well as the shipping there is a standard shipping fee for each item. But when you add items the shipping for each additional is reduced. So a predefined button would not work for me. I would need hundreds of them to calculate any possible combination of items.

Jed
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to convert html code into runrev script

Post by Mark »

Jed,

See my previous answer.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
jedthefed
Posts: 8
Joined: Sun Jun 26, 2011 1:07 am

Re: How to convert html code into runrev script

Post by jedthefed »

Mark wrote:Jed,

See my previous answer.

Kind regards,

Mark
I appreciate your efforts, but pointing me back to an answer a second time that I already don't understand doesn't help much. I see what your getting at and I understand what i need to do. But how to do it, i do not understand. Building a url and launching it with launch url sounds good, but I am still at a loss even where to start. Without a coding example to refference I am still not able to figure it out.

Thanks anyway, I'll keep trying. Eventually i'll figure it out.
Jed
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to convert html code into runrev script

Post by Mark »

Jed,

Code: Select all

put "http://www.domain.com/" into myMain
put "bla=foo&blub=bar" into myVar
put myMain & myVar into myUrl
launch url myUrl
Make sure to read the docs, both LiveCode's and PayPal's.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
jedthefed
Posts: 8
Joined: Sun Jun 26, 2011 1:07 am

Re: How to convert html code into runrev script

Post by jedthefed »

Thanks Mark,

That does makes sence now. Is there a limitation on how long the url can be? Say someone bought 15 items. In php I had a nice list of all 15 items in the cart. Is this possible using this method or should I just use "your Order" or something like that as the item decription. Then the price, tax, total.

Thanks again
Jed
Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to convert html code into runrev script

Post by Mark »

Hi Jed,

The length of the URL depends on the server configuration, usually it is 1024 bytes, sometimes it is 256 bytes, sometimes there is no limit. I don't think that PayPal has a limit. If there is one, you will probably see an error message.

You can also use PHP to make a dynamic form, which lists only one item and the total sum to pay.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
LESTROSO
Posts: 85
Joined: Wed Apr 04, 2007 6:14 pm
Contact:

Re: How to convert html code into runrev script

Post by LESTROSO »

Thanks a lot again Mark....and many thanks to everybody.....

Bye Lestroso.... :D
jedthefed
Posts: 8
Joined: Sun Jun 26, 2011 1:07 am

Re: How to convert html code into runrev script

Post by jedthefed »

Mark wrote:Hi Jed,

The length of the URL depends on the server configuration, usually it is 1024 bytes, sometimes it is 256 bytes, sometimes there is no limit. I don't think that PayPal has a limit. If there is one, you will probably see an error message.

You can also use PHP to make a dynamic form, which lists only one item and the total sum to pay.

Best,

Mark
Thanks Mark,

The length of the string in paypal is 256 bytes. I have it working perfectly now :)

Gary
Post Reply