pixelearth
pixelearth

Reputation: 14630

What data is posted back to the Paypal 'return' url, and how do I send my own data to this url?

Implementing a standard Paypal "Buy Now" button. The docs here are unclear as to what data is passed to the 'return' url. The docs also do not mention how to send your own custom data through the form.

Can anyone supply the appropriate documentation for this?

Relevant Code:

<form accept-charset="UTF-8" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="mYAT+aR+YhVyBrulWoYoMjzY00DQggAXUVGI12TA6zk="></div>
      <input id="cmd" name="cmd" type="hidden" value="_xclick">
      <input id="currency_code" name="currency_code" type="hidden" value="USD">
      <input id="notify_url" name="notify_url" type="hidden" value="http://localhost:3000/en/paypal_ipns/cart_purchase_ipn">
      <input id="item_name" name="item_name" type="hidden" value="Cart id 5398">
      <input id="quantity" name="quantity" type="hidden" value="1">
      <input id="business" name="business" type="hidden" value="[email protected]">
      <input id="return" name="return" type="hidden" value="http://localhost:3000/en/checkout/process_paypal_return">
      <input id="amount" name="amount" type="hidden" value="1.99">
      <input id="rm" name="rm" type="hidden" value="2">
      <p>
        <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
        <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
      </p>
</form>

Upvotes: 3

Views: 2120

Answers (1)

PP_MTS_Chad
PP_MTS_Chad

Reputation: 7319

You can have the transaction information returned to your page using PDT (Payment Data Transfer). You can find more on it here. You can also find a list of PDT variables that can get returned here. If you are wanting to pass over custom information, you can populate this into the variable "custom", and then parse that variable out once you are back on your return page. I usually separate my different variables and values that I populate into the "custom" variable with a "|" but you can use whatever works for you.

Upvotes: 2

Related Questions