Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just completed this process in my current website: bpremium.com, basically I built a webservice api for the payment process where it can send commands over javascript until it gets to the last stage, which is where you build the form you send to paypal.</p> <p>in order to record the payment, you setup another webservice for the notify url and this will catch all the $_POST data and process it into your database.</p> <pre><code>&lt;form id="form-payment-paypal" action="https://www.paypal.com/cgi-bin/webscr"&gt; &lt;input type="hidden" name="cmd" value="_xclick" /&gt; &lt;input type="hidden" name="bn" value="PP-BuyNowBF" /&gt; &lt;input type="hidden" name="charset" value="utf-8" /&gt; &lt;input type="hidden" name="business" value="YOUR_ACCOUNT_EMAIL_ADDRESS" /&gt; &lt;input type="hidden" name="item_name" value="THE PRODUCT NAME" /&gt; &lt;input type="hidden" name="item_number" value="YOUR_RECOGNISABLE_SALE_ID?&gt;" /&gt; &lt;input type="hidden" name="currency_code" value="EUR" /&gt; &lt;input type="hidden" name="lc" value="THE LANGUAGE CODE: es_ES, en_GB, etc" /&gt; &lt;input type="hidden" name="amount" value="&lt;?=$amount+($amount*0.04)?&gt;" /&gt; &lt;input type="hidden" name="return" value="/payment/complete/" /&gt; &lt;input type="hidden" name="notify_url" value="/webservice/payment/notify/paypal/" /&gt; &lt;p class="ac span300"&gt; &lt;input type="submit" class="form-style-bt" value="PAY" /&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>that is basically what we use, you can see we put the $amount + $amount*0.04 because you needed to add a 4% surcharge in spain, where I am. perhaps thats different in your code.</p> <p>I think the rest of it is pretty self explanatory.</p> <p>on the /webservice/ url, you need to record everything into your database, it sends you the information whether it succeeded or failed, but it's not a call to your website, you won't see this page, it's a "back channel" call to your website, so it's not your landing page, it's simple the url paypal sends all the raw data to, you're supposed to record it, process it and perhaps send out emails, etc.</p> <p>then if the user returns to your website, you land on the /payment/complete page, so this page could show the result, whether everything is ok, or something failed.</p> <p>hope it helps.</p>
    singulars
    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.
    3. VO
      singulars
      1. This table or related slice is empty.
    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