uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Proposed Paypal Solution - Working!!!

Knowledge Base Lobby : uShop Support Conference : Programmer Tips
Oct-21-17 09:50 AM EST
Original Message
Proposed Paypal Solution - Working!!!
Author Brian Levine on 04-05-2002 at 10:34 (EST)
Okay, with a little effort, I managed to get this working, using the Custom Payment option. In order to get this working, I had to modify the following:

order_template.html
ushop.pl

(Note that for this example, I have to strip out brackets so that HTML tags show up.)

order_template.html changes:

For some reason, I cannot embed by paypal button inside the FORM block on the page (and I still don't understand why), so I had to create a new replacement string just above the FORM tag:

!-- The following tag will be replaced at runtime. --
PAYPAL BUTTON

FORM

(of course, remember those brackets in your code)

ushop.pl changes:

Just past the upshop instructions replacement section, I added the following:

# Replace the PAYPAL BUTTON.
if (($payment_method eq "custom_payment") && ($settings[52] =~ /yes/i))
{
$order_total = sprintf("%.2f", $totals_total);
$paypal_site = "https://www.paypal.com/cgi-bin/webscr";
$paypal_button = "FORM ACTION="" . $paypal_site . "" METHOD="POST"";
$paypal_button .= "INPUT TYPE="hidden" NAME="cmd" VALUE="_xclick"";
$paypal_button .= "INPUT TYPE="hidden" NAME="business" VALUE="paypal@mystore.com"";
$paypal_button .= "INPUT TYPE="hidden" NAME="item_name" VALUE="My Store Order Total"";
$paypal_button .= "INPUT TYPE="hidden" NAME="item_number" VALUE="$order_number"";
$paypal_button .= "INPUT TYPE="hidden" NAME="amount" VALUE="$order_total"";
$paypal_button .= "INPUT TYPE="image" src="http://images.paypal.com/images/x-click-but01.gif" border="0" NAME="submit" ALT="Click to Pay using Paypal"";
$paypal_button .= "/FORM";
}
$order_form_html =~ s/PAYPAL BUTTON/$paypal_button/g;

Again, remember that I had to remove all of the brackets in order for this to display.

The end result of all of this is that this method displays a button at the top of the Receipts page that links to the Paypal payment login page, passing my paypal id, the order number and the order total. The customer need only log in and accept the sending of the payment.

I will make the actual code available (with brackets) to anyone that wants it.
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: Proposed Paypal Solution - Working!!! Bill Weiner, 2002-04-06 13:01:03 (1)
  paypal solution rich, 2002-10-02 14:46:43 (2)
            RE: paypal solution Bill Weiner, 2002-10-03 04:23:35 (3)

Messages In This Discussion
         1. RE: Proposed Paypal Solution - Working!!!
        Author Bill Weiner on 04-06-2002 at 13:01 (EST)
Great! Glad you go it working.
TABLE OF CONTENTS
         2. paypal solution
        Author rich on 10-02-2002 at 14:46 (EST)
would you please send me a copy of the actual code (with brackets)?

i'm working on a major update to my company's website, and this may be the key i need to convince him to purchase ushop.

thanks,
rich
TABLE OF CONTENTS
                 3. RE: paypal solution
                Author Bill Weiner on 10-03-2002 at 04:23 (EST)
We listed Brian's solution in our 3rd Party Developer's Corner:

http://www.uburst.com/uShop/developers.html

(See the 8/20/2002 Posting)
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.