uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Tech Support
       Support Policy
       Knowledge Base
       Reference Sites
       Software Piracy
       Legal Notices
       Privacy Policy
       Reseller Info
       Contact Us
       Site Map
Payment Methods

Knowledge Base Lobby : uShop Support Conference : General Questions
Jul-21-18 03:44 AM EST
Original Message
Payment Methods
Author Jeremy on 12-17-2000 at 17:08 (EST)
Is there anyway I can set up my Ushop to work with Paypal? I want my costomers who have a paypal account to be able to pay by PayPal



Table Of Contents
  RE: Payment Methods Bill Weiner, 2000-12-18 06:43:04 (1)
            Pay Pal Jeremy, 2000-12-18 16:35:58 (2)
                 RE: Pay Pal Bill Weiner, 2000-12-19 06:30:12 (3)
  Pay Pal Jeremy, 2000-12-19 17:06:14 (4)
            RE: Pay Pal Bill Weiner, 2000-12-20 06:18:41 (5)
                 Pay Pal Jeremy, 2000-12-21 00:21:12 (6)
                      RE: Pay Pal Bill Weiner, 2000-12-21 06:44:56 (7)
                           paypal Jeremy, 2000-12-21 19:13:18 (8)
                                RE: paypal Bill Weiner, 2000-12-22 06:54:15 (9)
                                     Paypal Java scripting Jeremy, 2000-12-22 12:49:51 (10)
                                          RE: Paypal Java scripting Bill Weiner, 2000-12-22 13:08:21 (11)
                                               Java Script Jeremy, 2000-12-22 21:34:22 (12)
                                                    Pay Pal JWarren, 2000-12-23 02:59:27 (13)
                                                    Javascript ronharter, 2000-12-24 10:05:11 (14)
                                                         JSI JWarren, 2000-12-24 19:58:38 (15)
                                                              RE: JSI Bill Weiner, 2000-12-27 06:09:33 (16)

Messages In This Discussion
         1. RE: Payment Methods
        Author Bill Weiner on 12-18-2000 at 06:43 (EST)
As noted at:, it may be possible by implementing the "get_custom_payment_button_html" subroutine in the script in order to add the PayPal "Web Accept" button. A difficulty may arise, however, when it comes to receiving the success/fail response from PayPal. We did submit a request to PayPal to get additional information on the interface specs, but haven't heard back yet.

On a side note, if you are willing to by-pass the standard uShop Order Forms... and just use the PayPal order button.....then you may be able to put the standard PayPal "Web Accept" button on one of your regular store pages (such as the same Place Order page where you put the uShopOrderButton applet)... and then use the uShop JavaScript API to pass the subtotal to PayPal. The current shopping cart subtotal, can be read with JavaScript via the function:

                 2. Pay Pal
                Author Jeremy on 12-18-2000 at 16:35 (EST)
Well is there any way I can extract the information from the java applett. If I could do that than I could write a cgi program that would send the info to pay pal correctly, but how would i get the info from the appletts?
                         3. RE: Pay Pal
                        Author Bill Weiner on 12-19-2000 at 06:30 (EST)
As noted in my previous post, you can use JavaScript to get the subtotal from the uShop applets. To do this, you would need to:

STEP 1: Add the JavaScript interface applet "uShopJSI" to the HTML page where you want to put the PayPal Web Accept button. (See the JavaScript Input Examples in the applet reference and/or the JavaScript Section of the uShop 3.x Programmer's Guide - for more information about using the uShopJSI applet).

STEP 2: Once the uShopJSI applet is added to the HTML page where you will be adding the PayPal Web Accept button, then you can use the following function call in a JavaScript to get the current subtotal of the uShop shopping cart:

var subtotal = document.uShopJSI.getSubtotal();

You would probably need to call that function from a JavaScript that handles outputting the PayPal Web Accept button HTML (via a JavaScript write()).
         4. Pay Pal
        Author Jeremy on 12-19-2000 at 17:06 (EST)
i am using v2.0. I dont have the java script appletts.
                 5. RE: Pay Pal
                Author Bill Weiner on 12-20-2000 at 06:18 (EST)
Actually, you could use the uShop 3.x trial version to that.

But as for accessing the subtotal with uShop 2.x, then there is no way to access the subtotal via the uShop 2.x Java Applets. What you would need to do is use one of the uShop 2.x Order Applets... perhaps the "uShopOrderContactCGI" applet in order to just tranfer the customer to the You could then modify the ushop_cgiscript to output your PayPal button by accessing the total amount of the order via the "$uShop_total" variable that you will see near the top of the script.
                         6. Pay Pal
                        Author Jeremy on 12-21-2000 at 00:21 (EST)

Im sorry I keep bugging you with the same questions.

Ok, I foudn the $uShop_total variable in the script. it says "$form_text{'amt'}". If I wanted to make that an output to paypal, what path would i put in there?

Thanks A LOT!

                                 7. RE: Pay Pal
                                Author Bill Weiner on 12-21-2000 at 06:44 (EST)
No problem! Here is what I would suggest:

STEP 1. Make a backup of your current "" file.... just in case.

STEP 2. Open the "" with any text editor such as WordPad.

STEP 3. Do a search on "sub show_receipt" in order to find the subroutine that normally handles displaying the "Thank You" page. You should be able to recognize the "print" statements used to output the HTML.

STEP 4. Add some additional "print" lines to that show_receipt() subroutine in order to output the HTML for the PayPal Web Accept button.... And when doing so, you can use the global variable "$uShop_total" to output the necessary subtotal, such as:

print "subtotal=$uShop_total";

(I forget the actual HTML syntax for the PayPal Web Accept button....but if you need any assistance implementing it in the script, send the HTML that you want inserted to us at and I will assist.)

STEP 5. After adding the necessary HTML for the PayPal button, save the file (as TEXT if your editor asks)... and try it out!

NOTE: Again, since PayPal will have it's own forms for collecting the billing/payment information... it is kind of redundant that the uShopOrderCGI applets ask for that information too. So that is why I would suggest trying the uShopOrderContactCGI applet as the order applet used to initiate the ushop_cgiscript. That uShopOrderContactCGI applet only has a couple fields...and they are customizable... so you may be able to think of some field names that make sense there.
                                         8. paypal
                                        Author Jeremy on 12-21-2000 at 19:13 (EST)
I like that idea!
Here is some of the syntax of the paypal web accept button. I took out the inputs of the personal info. This is a sample button for a shirt that is $15 with $3 S/H.

INPUT TYPE="hidden" NAME="item_name" VALUE="Shirt"

INPUT TYPE="hidden" NAME="amount" VALUE="15"

INPUT TYPE="hidden" NAME="shipping" VALUE="3"

A few questions for this...

1) is there a variable for the shipping cost like the subtotal has the $uShop_total?

2) Is there anyway I can make the UshopOrderImgage Button go directly to the HTML page instead of the ordering page? I can put the paypal image as the image and it will go directly to the HTML page where I will have the web accept button?

I want to do this so they don't have to fill out any forms on my site, and the HTML page will have nothing accept the Paypal button.
                                                 9. RE: paypal
                                                Author Bill Weiner on 12-22-2000 at 06:54 (EST)
In regard to your questions:

1) With uShop 2.x, there really isn't any easy way to access the shipping cost (without doing some serious parsing of $uShop_data variable).

2) Unfortunately the uShop 2.x order button does not pass the $uShop_total variable to the that is why you would have to use one of the order form applets. Again, maybe you can rename the fields of the uShopOrderContactCGI applet to just collect some general or survey information... to avoid entering any redundant information).

Anyway, when it comes to adding that button to the show_receipt() subroutine, I think rather than treat the products individually, you would need to add a button for the entire order, such as:

print "< FORM method="POST" action="https://paypal/instpurchase.asp" > ";
print "< INPUT TYPE="hidden" NAME="item_name" VALUE="$uShop_orderid" > ";
print "< INPUT TYPE="hidden" NAME="amount" VALUE="$uShop_total" > ";
print "< INPUT TYPE="IMAGE" src="https://secure/images/x-click-but3.gif" > ";
print "< /FORM > ";

(Note how you have to escape double quotes with backslashes.)

Again, this is really not the best solution ... but it should get you pretty close.

And of course, as mentioned before, it may be cleaner to try something similar to the above...except by using JavaScript and the uShop 3.x trial version.

And seeing that PayPal updated their documentation a little... I notice they now have a "return" parameter... so that may make it possible to integrate even more cleanly with the full version of uShop 3.x.... But we'll have to look into that some more here. TBD.
                                                         10. Paypal Java scripting
                                                        Author Jeremy on 12-22-2000 at 12:49 (EST)

I understand all of that know.

In regaurds to the method of putting the javascript on there. I want to try that method and see how it works.

I downloaded the trail version and got the java classes out of it.

I tried using it to see if it worked, I used the sytax:

script language="JavaScript"



(note: left out the so it would show)

and when i went to the page all it did was print "document.uShopJSI.getSubtotal()" it didn't print the total. The uShopJSI applet is on the page to.

Did I do something wrong with the JavaScript?
                                                                 11. RE: Paypal Java scripting
                                                                Author Bill Weiner on 12-22-2000 at 13:08 (EST)
Actually, try something like this:

< script language="JavaScript" >

var subtotal = document.uShopJSI.getSubtotal();

document.write("< FORM method="POST" action="https://paypal/instpurchase.asp" > ");
document.write("< INPUT TYPE="hidden" NAME="item_name" VALUE="Online Order" > ");
document.write("< INPUT TYPE="hidden" NAME="amount" VALUE="" + subtotal + "" > ");
document.write("< INPUT TYPE="IMAGE" src="https://secure/images/x-click-but3.gif" > ");
document.write("< /FORM > ");

< /script >

Of course, the above document.uShopJSI.getSubtotal() call requires that the "uShopJSI" applet be somewhere on the page... so if you just want to test it out real quick... just modify one of the "JavaScript Input Example" pages.

Disclaimer: I haven't tried this out myself - so I may have one or more typos in there :^o
                                                                         12. Java Script
                                                                        Author Jeremy on 12-22-2000 at 21:34 (EST)
When I say:

var subtotal = document.uShopJSI.getSubtotal();

I get an error message saying that:

document.uShopJSI is null or not an object.

I dont get it.... it is an object because the applet on the page has the name "uShopJSI".

But when I took the getSubtotal() part out and it was just document.uShopJSI it did not give me an error, but I am also not getting the subtotal out so it does not work. Is that the correct way to call the subtotal?
                                                                                 13. Pay Pal
                                                                                Author JWarren on 12-23-2000 at 02:59 (EST)
Hi Bill -

It is about 3:00 a.m. I have been up all night trying to figure this out! Everytime I try something new I get some kind of error, or is just doesn't work. I am not very good with JavaScript, I know the basics buts thats abou it. Is there anyway you could just E-mail the correct syntax for calling the subtotal to paypal. Then when I get it, I could edit the "document.write" with my personal information for PayPal?

Thanks I am sorry to keep bothering you with this.

                                                                                 14. Javascript
                                                                                Author ronharter on 12-24-2000 at 10:05 (EST)
I imagine Bill and the gang are out enjoying their well deserved holiday.

It looks to me like you don't have the uShopJSI applet somewhere on the page:

Hope that helps you out.
Happy Holidays
Ron Harter
                                                                                         15. JSI
                                                                                        Author JWarren on 12-24-2000 at 19:58 (EST)
Hi Ron -

I wish that was the problem. The applet is on the page, and it does load properly.

Thanks for the suggestion.

Merry Christmas.

                                                                                                 16. RE: JSI
                                                                                                Author Bill Weiner on 12-27-2000 at 06:09 (EST)
Perhaps the codebase of your uShopJSI applet is not correct for your directory structure.... so the uShopJSI applet isn't loading?

In any case, a little later today I'll email you some HTML to try.

© 2003 Microburst Technologies, Inc.