Question

How do I integrate a one time fee into paypal?

The user clicks SignUp then is taken to a page to confirm t&c's and where they pay £50, they are then - if successful, taken to a page where they can enter details and create an account... but I only want this page to be visible to users coming from paypal.

I thought about using tokens, but I do not know how to use them.

Was it helpful?

Solution

You can use the paypal IPN which they are plenty of code samples and the paypal sandbox has some great tools to get you started.

The flow would work like this.

  1. User selects that they want to sign up on your site and they fill out a form (contact info, accept terms and conditions, etc).
  2. They then click purchase registrations, etc.
  3. Your site posts all the details of the contact form along with the cost of registration to Paypal for the user to pay.
  4. The user completes payment on the paypal site and is taken to a success page which informs them they will shortly receive an email regarding their registration.

Your back end... 1. After the user pays, paypal will post the details of the transaction to a URL you provide. 2. Your system completes a handshake over a connection to paypal. 3. Paypal sends the details of the transaction back to your server and you validate the total and any other necessary validations. 4. After validation, you system generates an email to the new user with their account details.

Let me know if that does not make sense or what additional elaborations are needed. Also if you let me know what language your coding in, I can pull up some sample code for you.

[EDIT] Here is a URL to the paypal IPN --> https://www.paypal.com/ipn

--Dan

[edit]

Here is an example form. This form posts a single item for payment to paypal.

    <form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2" id="PayPalRm" />
<input type="hidden" name="cmd" value="_xclick" id="PayPalCmd" />
<input type="hidden" name="business" value="seller@paypal.account" id="PayPalBusiness" /> 
<input type="hidden" name="return" value="http://localhost/inventories/success" id="PayPalReturn" />
<input type="hidden" name="cancel_return" value="http://localhost/inventories/cancel" id="PayPalCancelReturn" />
<input type="hidden" name="notify_url" value="http://localhost/Paypal_orders/process" id="PayPalNotifyUrl" />
<input type="hidden" name="item_name" value="product name" id="PayPalItemName" />
<input type="hidden" name="quantity" value="1" id="PayPalQuantity" />
<input type="hidden" name="no_shipping" value="2" id="PayPalNoShipping" />
<input type="hidden" name="shipping" value="2.5" id="PayPalShipping" />
<input type="hidden" name="shipping2" value="2.5" id="PayPalShipping2" />
<input type="hidden" name="no_note" value="1" id="PayPalNoNote" />
<input type="hidden" name="lc" value="US" id="PayPalLc" />
<input type="hidden" name="country" value="US" id="PayPalCountry" />
<input type="hidden" name="bn" value="PP-BuyNowBF" id="PayPalBn" />
<input type="hidden" name="amount" value="12" id="PayPalAmount" />
<div class="submit"><input type="submit" value="Click Here" /></div></form>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top