Arkarr Arkarr - 1 year ago 83
HTML Question

PHP - Use paypal to do transaction

I'm trying to create a simple buy button using paypal and get the result of the transaction, but I can't seem to find anything related to the subject, also, do we need a business account to do this kind of things ?

I saw some documentation on there website : IPN. But I can't make it work.

Anybody would like to share his work or give me hints ?

Answer Source

First you will work on the sandbox environment of the paypal..

<form method='post' action=''>
  <input type='hidden' name='cmd' value='_xclick'>
  <input type='hidden' value='2' name='rm'>
  <input type='hidden'  id='content' name='item_name' value='aaa'>
  <input type='hidden' id='amount'  name='amount' value='1'>
  <input type="hidden" name="custom" value="bbb">
  <input type='hidden' name='no_note' value=''>
  <input type='hidden' name='notify_url' value=''>
  <input type='hidden' name='currency_code' value=''>
  <input type='hidden'  name='business' value='write buisness url'>
   <input type='hidden'  name='uname' value='username'>
    <input type='hidden'  name='pword' value='password'>

  <input type='hidden' name='return' value="http://localhost/paypal/return.php">
  <input type='hidden' name='cancel_return' value='http://localhost/s/paypal/cancel.php'>
  <div ><input type="image" src="<?php echo SITE; ?>images/btn_buynowCC_LG.gif" title='buy now'></div>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download