in reply to Re^7: Coding and Design Advice
in thread Coding and Design Advice

Hi,

I believe I found one loophole with the redirect solution. PayPal provides a button which contains all the parameters which are needed to charge the persons credit card and place the money into the account of whom is receiving the payment.

The way the current redirect statement is written it will take me to PayPal, but it won't pass any of the parameters for the event which need to be charged to the persons credit card.

The PayPal button must be clicked first in order to be directed to PayPal. As I can tell, I don't think I'll be accomplishing this with the current code.

Replies are listed 'Best First'.
Re^9: Coding and Design Advice
by g0n (Priest) on Apr 01, 2005 at 18:28 UTC
    It might be possible to twiddle the URL called by the redirect header. Can you post the code that constructs the paypal button on your page? - the original page was offline last time I tried.

    I also am offline for a while, but I'll take a look at this again tomorrow GMT.

    Update: The original page is back online, and there's a possible solution. Its a bit krufty - someone might be able to come up with a cleaner approach, perhaps using javascript to change the form action from the client side, but this seems to work OK. Change your redirect URL to:

    https://www.paypal.com/cgi-bin/webscr?add=1&cmd=_cart&business=MAILADDRESS&item_name=BridgeMill%20Power%20Tennis%20Camp&name=item_number=Camp05&amount=198.00&no_note=1&currency_code=USD&lc=US

    This is the URL taken from the form action, with all the fields that were supplied as hidden form parameters in the html source supplied as URL parameters.

    (You'll need to change the mail address to the correct one - I chopped it to combat spambots). You might also need to check your agreement with paypal to make sure you aren't obliged to display their button.

    Hope this helps.

    g0n, backpropagated monk
      Hi,

      I think I was able to figure out my problem. Here's the flow of my script, person views static web HTML page with form -> they complete the form -> select their payment option -> click Submit. The submit action calls in my script camp.cgi.

      In this script, I did the following conditional:

      If payment option is equal to a or b -> generate confirmation page to print for records, send confirmation email, and a third email to the person hosting the event.

      If payment option is equal to c (credit card) -> send confirmation email to person, send email to person hosting event, and finally generate a paypal page which contains the HTML code and PayPal button which I got directly from PayPal.

      I ran the script with option c and when I clicked the Add to Cart button which directs you to PayPal, I was actually directed to PayPal. I was able to view my cart and go to checkout. So I think I'm ok. I'm not quite sure how I came up with this. It dawned on me during the middle of the night.