Test your payment buttons

DOCS

Last updated: Sept 19th, 1:47am

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 test your web and mobile apps with mock transactions, create a personal account to represent a buyer and a business account to represent a merchant.

  1. Log into Dashboard and type your PayPal personal or business account email and password.

  2. Under Sandbox, click Accounts, and then click Create Account.

  3. Choose the type of account and country that you want to test, and click Create. PayPal generates an account for you with test values for bank account, credit card, and balance. To edit account features, after the account has been created click on the edit button for that account.

Create test buttons in the sandbox

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

  2. To create your payment buttons in the sandbox:

    1. Click Profile > Profile and Settings. Then, click My Selling Tools.
    2. Click Paypal Buttons.
    3. Under Related Items on the right, click Create new button.
    4. Choose a button type and fill out the form to create your test button.
    5. 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:

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

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

        1<!DOCTYPE html>
        2<html lang=en>
        3
        4<head>
        5 <meta charset=utf-8>
        6 <title>Testing a PayPal Payments Standard Button</title>
        7</head>
        8
        9<body>
        10 <h2>Buy Strings!</h2>
        11 <table>
        12 <tr>
        13 <td>Bass Guitar Strings</td>
        14 <td>
        15 <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
        16 <input type="hidden" name="cmd" value="_s-xclick">
        17 <input type="hidden" name="hosted_button_id" value="6RNT8A4HBBJRE">
        18 <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!">
        19 <img alt="" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
        20 </form>
        21 </td>
        22 </tr>
        23 </table>
        24</body>
        25
        26</html>

      Test buttons on your website

      1. 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. Under Sandbox in the PayPal Developer Dashboard, 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

      If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more