Jump to content

Recommended Posts

Hi,

 

I'm building a site that a user can upload his/her documents, tell me what type of document it is (student / academic, business, personal doc, etc) and a specific % is multiplied by the # of words of that document. All said and done, I show the user a Quote for how much it will cost and they can click "Buy now" or "Checkout" and pay for it right then.

 

The only way I've ever used paypal is when I have a specific Item, with a Specific Price involved by using the "Buy Now" buttons single item purchase.

 

The problem is that I don't know how to post the new price value to the https://www.paypal.com/cgi-bin/webscr since all the prices will vary from the number of words with the different types of documents, I called paypal and the rep told me that he didn't think it could be done. But that's ridiculous, can anyone shed some light? Thanks

 

 

Wherever your code is on the page that should look something like this:

<form action="https://www.paypal.com/cgi-bin/youbscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="email@whatever.com">
<input type="hidden" name="item_name" value="Widget One">
<input type="hidden" name="item_number" value="Wid-001">
<input type="hidden" name="amount" value="1.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src=
                "https://www.paypal.com/en_US/i/btn/x-click-but23.gif" 
                border="0" name="submit>
</form>

 

You need to add the "amount" input type...which is in the above code.

 

<input type="hidden" name="amount" value="1.00">

 

Just change the value up to fit what you need. I was dealing with this issue a while back, but I can't remember exactly how I handled it. I know I found a website that had all the paypal codes to do everything...so if this doesn't help, then I will search for it for you.

Hey poco,

 

Thanks a bunch, that's what I assumed would be how to do it but I wanted to double check. The only thing I have a question about is this...

 

Say i run my php like so..

 

<input type="hidden" name="amount" value="<?php

    $docz = $_POST['document'];

    $wordsz = $_POST['num-words'];

      if($docz == "book")

      $calcz = $wordsz * .005;

      if($docz == "student")

      $calcz = $wordsz * .01;

      if($docz =="biz")

$calcz = $wordsz * .025;

      if($docz == "personal")

        $calcz = $wordsz * .03;

    echo $calcz;

?>

">

 

How do i set the $calcz = to limit it to only 2 decimal spaces X.XX - Because it works, except when the amount is 3 decimal spaces or more. Thanks again!

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.