Sandbox, where to start...

tylerbud
Contributor
Contributor

Hello,

 

I've developed a sites written in PHP that use paypal successfully before. The last time in 2014.

 

I want to reuse the code that POSTs a single form of fields to the www.paypal.com/cgi-bin/webscr URL to have the customer go through login, and payment eventually resulting in a Paypal IPN pulse back to the site to do the work, and them returning the (sandbox) customer a cancel or a thank you page.

 

I have no idea what API to use (if any), what credentials to use in the 'business' field (in the call to the paypal url), and how to use the Sandbox seller and facilitator values to get started.  Simple web instructions... this business ID, these fields can be posted, these will be received, etc. I can't imagine that Paypal has changed that much that I have to re-invent the wheel for a single POST to Paypal to effect a transaction as I did a few years ago.

 

It seems like anytime I look up information on Paypal, I get lost in the verbosity of the documents and the many tabs opened up, the browser tab session expires and I have to re-login to start it all over again. 

 

I want to be able to use the sandbox buyer/seller credentials for this POST to the Paypal URL using PHP on a page to get all of the work done.  I know my Paypal IPN has a sandbox on/off flag that I can toggle for testing.  What exactly it does, I am not sure.

 

Eventually, after the code works with the sandbox, then it will be changed to the real paypal business account to have it's 'business' code changed to the real values for them to benefit from the work and business transacted through Paypal.

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

You have a few options you can use the Form Post Method for PayPal Standard Cart or the new Rest API Express Checkout JSv4.

Here is the information on basic PayPal Standard:

HTML Basics

Complete Variable Reference

Shopping Cart Variable Reference

Sample Shopping Cart Code

Basic steps to securing your code

Please note that the Business Value is supposed to be the active and confirmed email address or the merchant id. We advise securing the code and not displaying the code on a website, once you are ready to go live.

Below is a basic code example for an Add to Cart Button.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

  <!-- Identify your business so that you can collect the payments. -->
  <input type="hidden" name="business" value="emailormerchantid">

  <!-- Specify a PayPal Shopping Cart Add to Cart button. -->
  <input type="hidden" name="cmd" value="_cart">
  <input type="hidden" name="add" value="1">

  <!-- Specify details about the item that buyers will purchase. -->
  <input type="hidden" name="item_name" value="Birthday - Cake and Candle">
  <input type="hidden" name="amount" value="3.95">
  <input type="hidden" name="currency_code" value="USD">

  <!-- Display the payment button. -->
  <input type="image" name="submit"
    src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif"
    alt="Add to Cart">
  <img alt="" width="1" height="1"
    src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>

If you would like an SDK and information on the new Express Checkout JSv4 checkout below is the information:

The Rest API Application once created will have Sandbox and Live credentials.

Here is the information on creating a Rest API Application.

Here is the information on the JSV4 Express Checkout.

Here is the Interactive Demo JSV4 Express Checkout.

Here is the complete SDK for PHP and Rest API.

 

Thank you,

Jennifer

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.