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.
- User selects that they want to sign up on your site and they fill out a form (contact info, accept terms and conditions, etc).
- They then click purchase registrations, etc.
- Your site posts all the details of the contact form along with the cost of registration to Paypal for the user to pay.
- 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="[email protected]" 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>