Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In our ecommerce configuration, we used a trick to make the real user email ( e.g. the one that he used to register into our clients database ) be sent by the IPN responder.</p> <p>When a user pays with Paypal, a form is sent to the Paypal system with informations about the amount of the payment, url bridges and so on. Here's an example:</p> <pre><code>&lt;form name="autoPayFormSubmit" id="autoPayFormSubmit" method="post" action="https://securepayments.paypal.com/cgi-bin/acquiringweb"&gt; &lt;input type="hidden" name="cmd" value="_hosted-payment" /&gt; &lt;input type="hidden" name="subtotal" value="#SUBTOTAL#" /&gt; &lt;input type="hidden" name="shipping" value="#SHIPCOST#" /&gt; &lt;input type="hidden" name="business" value="#NUMBEROFBUSINESS#" /&gt; &lt;input type="hidden" name="paymentaction" value="sale" /&gt; &lt;input type="hidden" name="custom" value=" ## USE ME TO TRICK THE SYSTEM ##" /&gt; &lt;input type="hidden" name="currency_code" value="EUR" /&gt; &lt;input type="hidden" name="shopping_url" value="http://yourwebsite.domain/##" /&gt; &lt;input type="hidden" name="cbt" value="Go back to the shopping" /&gt; &lt;input type="hidden" name="notify_url" value="http://yourwebsite.domain/##" /&gt; &lt;input type="hidden" name="cancel_return" value="http://yourwebsite.domain/##" /&gt; &lt;input type="hidden" name="return" value="http://yourwebsite.domain/##" /&gt; &lt;input type="submit" value="PAYPAL SAFE PAYMENT" onmouseover="this.style.backgroundColor='#CEE4F2';" onmouseout="this.style.backgroundColor='#EAF2F6';" style="font-weight: bold; font-size: 14px; padding: 10px 5px; border-radius: 10px; background: #EAF2F6 none no-repeat scroll 0 0; box-shadow: 3px 3px 5px #888; cursor:pointer;"&gt; &lt;/form&gt; </code></pre> <p>The "trick" is to send via the "custom" input the email of the user registered into the system, along with other useful data. In our ecommerce, for example, we serialize an array with the user email, the order id, and other "non-compromising" values. After it has been serialized, we encode it with a crypt class we created on our own ( or you can simply use the mcrypt extension of PHP ).</p> <p>Once you get the IPN response, you will also get the</p> <pre><code>$custom_encrypted_serialized_variables = $_POST['custom']; </code></pre> <p>So, you can replace your IPN listener code at step 3 with the following:</p> <pre><code>... ... // STEP 3: Inspect IPN validation result and act accordingly if (strcmp ($res, "VERIFIED") == 0) { // check whether the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $custom_encrypted_serialized_variables = $_POST['custom']; ... ... } </code></pre> <p>And then proceed with variables decrypting and unserializing with common unserialize() and decrypt functions.</p> <p>Along with the other useful data you may send with the "custom" variable in the paypal checkout form, send the client's email and you're done!</p> <p>P.S: I know this solution is not optimal and maybe there are alternative solutions, but I found this one quick and efficient. Hints and corrections are appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload