Php – Step-By-Step To Create A Checkout Form (PHP) Using Paypal Sandbox

paypalpaypal-sandboxPHPweb services

Good day, everyone!

Currently I'm working with my school project. I need to create a checkout form using Paypal and the website is written in php/apache/localhost. After a little research I know that we can use Paypal Sandbox (not the real paypal) to simulate payment. But I've no clue how to do it. I've read some tutorial, but just make me become more confuse. I know a little about web service (soap) with php-curl. So if anyone has ever create paypal checkout using paypal sandbox, could you share what step-by-step you've done using easiest term and language?

This are the best resource I can get (yet can't understand):

Thank you so much and God bless.


Note that I'm maybe the laziest dumb (joke)

Best Answer

Try this code.

  <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" style="padding: 0; margin: 0;">
    <input type="hidden" name="cmd" value="_xclick/" />
    <input type="hidden" name="business" value="your bussiness id" />
    <input type="hidden" name="quantity" value="1" />
    <input type="hidden" name="item_name" value="your item" />
    <input type="hidden" name="item_number" value="1" />
    <input type="hidden" name="amount" value="item price" />
    <input type="hidden" name="shipping" value="0" />
    <input type="hidden" name="no_note" value="1" />
    <input type="hidden" name="notify_url" value="Your notify url">
    <input type="hidden" name="currency_code" value="GBP" />
    <input type="hidden" name="rm" value="2" >
    <input type="hidden" name="return" value="your return url">
    <input type="image" border="0" name="paypal" src="images/btn_paypal_nl.gif" onClick="" />
    </form>

Thanks,

Kanji

Related Topic