Test your payment buttons

To ensure that your PayPal Payments Standard payment buttons work correctly, PayPal recommends that you test them using the PayPal Sandbox before you place them on your live website.

Test procedure

1. Create sandbox accounts.
2. Create test buttons in the sandbox.
3. Test buttons on your website.

Create sandbox accounts

To create sandbox accounts:

  1. Navigate to the PayPal Developer Dashboard and log in. If you do not have a Dashboard account, create one.

  2. Under Sandbox, click Accounts.

  3. Create two test accounts:

    • A Business account for a test seller
    • A Personal account for a test buyer

    For detailed instructions, see Creating a new sandbox account.

Create test buttons in the sandbox

To create test payments buttons in the PayPal Sandbox:

  1. Use your new test seller credentials to log in to the PayPal Sandbox.

  2. Create your payment buttons using the Create a PayPal payment button page in the sandbox:

    • Click Tools at the top of the page, then click PayPal buttons on the Tools page. Note that if you do not see Tools at the top of the page, then select Merchant Services > Create payment buttons for your website.

    • Under Related Items on the right, click Create new button.

    • Choose a button type and fill out the form to create your test button.

    • Click Create Button to generate the HTML for your test button. For detailed instructions, see Create a payment button.

    This example shows the HTML for a simple Buy Now test button:

    <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
      <input type="hidden" name="cmd" value="_s-xclick">
      <input type="hidden" name="hosted_button_id" value="6RNT8A4HBBJRE">
      <input type="image"
        src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_buynow_107x26.png" alt="Buy Now">
      <img alt="" src="https://paypalobjects.com/en_US/i/scr/pixel.gif"
        width="1" height="1">
    </form>
    
  3. Copy the button code and paste it into the appropriate location on your website. For detailed instructions, see Copy and paste button code.

    This HTML page shows how it might look on your web page:

    <!DOCTYPE html>
    <html lang=en>
    <head>
      <meta charset=utf-8>
      <title>Testing a PayPal Payments Standard Button</title>
    </head>
    <body>
    <h2>Buy Strings!</h2>
    <table>
    <tr>
      <td>Bass Guitar Strings</td>
      <td>
        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
          <input type="hidden" name="cmd" value="_s-xclick">
          <input type="hidden" name="hosted_button_id" value="6RNT8A4HBBJRE">
          <input type="image"
    src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"
    border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
          <img alt="" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif"
    width="1" height="1">
        </form>
      </td>
    </tr>
    </table>
    </body>
    </html>
    

Test buttons on your website

  1. To test the button, open your web page in a browser and click on the PayPal payment button.

  2. When prompted to log in on the PayPal payment page, log in with your test buyer account credentials for the sandbox.

  3. In the PayPal Developer Dashboard, under Sandbox, click Notifications.

  4. Verify that you have received email notifications for your transactions.

When your tests are complete, log in to your PayPal Business account and create the buttons for your website. For detailed instructions, see Create a payment button.

Next

Learn how to receive payment notifications or manage transactions.

Additional information