0

I am trying to set up a PayPal Payment Button. But my problem is that I configure the product on my site and want to get this configuration after somebody payed with PayPal. So let's say I've got a product called "Product". And this Product has some configurations like:

Size -> Large

Color -> #000000

Now I want to receive this information when someone bought my product.

I made my payment button like this:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="business" value="MYEMAIL">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="item_name" value="PRODUCTTITLE">
    <input type="hidden" name="amount" value="SUM">
    <input type="hidden" name="currency_code" value="EUR">
    <input type="hidden" name="shipping" value="3.50">
    <input type="hidden" name="tax" value="19">
    <input id="ppSBtn" type="image" name="submit" border="0"
          src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/gold-pill-paypalcheckout-26px.png"
          alt="Buy Now">
    <img alt="" border="0" width="1" height="1"
          src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >

</form>

I tried to achieve this with:

<input type="hidden" name="on0" value="Size Large" />

The problem here is that the "on" parameter is limited to 7 options. But my options vary from 6 to 13.

So I am looking for a way so that my customers can pay their configuration with PayPal but I still get an E-Mail for example with their configuration so I know what they actually bought.

I appreciate any help an thanks in advance!

EDIT: It works with

<textarea name="os0" cols=40 rows=6 style="display: none;">Size: Large, Color: #000</textarea>

But is there a smarter solution?

kingardox
  • 127
  • 11
  • you would best check this I guess: http://stackoverflow.com/questions/11631926/paypal-ipn-process-more-than-one-custom-variable – Alex Odenthal Mar 01 '17 at 15:01
  • Thanks for your replay. I tried the method mentioned in https://www.paypal-community.com/t5/How-to-use-PayPal-Archive/how-to-send-mulitple-custom-parameters/m-p/45712#M28932 already. He claims that you could use on and os up to on99, os99. But PayPay states: You can specify a maximum of 7 option field names (6 with Subscribe buttons) by incrementing the option name index (on0 through on6). – kingardox Mar 01 '17 at 15:11
  • I was more after that one: _The most commonly accepted solution (which I also favor) is to add all of your data to a DB record, then use the custom var to store your record ID, which can obviously be used later (e.g. via IPN) to retrieve your data._ – Alex Odenthal Mar 01 '17 at 15:32
  • I saw that too. Then my question would how do I store only the entries which really paid? Or is the idea to store every configuration with an id and then check for it when someone pays? – kingardox Mar 01 '17 at 16:13
  • Once the user clicks the "pay with pay pal" button you put the record into the database, get an last_insert_id from that table and pass that id as a parameter to your paypal process. I expect, that there is a "hook/event" called something like "payment successful" and exactly there you should be able to get the passed parameter from before and do an update in your database and set "payed=1" e.g. – Alex Odenthal Mar 01 '17 at 19:54

0 Answers0