Вопрос

I'm trying to set up a paypal solution but i'm having some trouble with the RETURNURL.

My form looks like this.

<form method="post" action="https://api-3t.paypal.com/nvp"> 
<input type="hidden" name="USER" value="<%=PayPal_API_Username%>"> 
<input type="hidden" name="PWD" value="<%=PayPal_API_Password%>"> 
<input type="hidden" name="SIGNATURE" value="<%=PayPal_API_Signature%>">
<input type="hidden" name="VERSION" value="65.0">
<input type="hidden" name="PAYMENTREQUEST_0_PAYMENTACTION" value="Sale"> 
<input type="hidden" name="PAYMENTREQUEST_0_CURRENCYCODE" value="DKK"> 
<input type="text" name="PAYMENTREQUEST_0_AMT" value="<%=Amount%>.00"> 
<input type="hidden" name="CUSTOM" value="<%=GUID%>"> 
<input type="hidden" name="RETURNURL" value="http://<%=c_mainDomain%>/return.html"> 
<input type="hidden" name="CANCELURL" value="http://<%=c_mainDomain%>/cancel.html">
<input type="hidden" name="METHOD" value="SetExpressCheckout">
<input type="submit" name="submit" value="Videre til betaling med Paypal"> 
</form>

When i submit the form it goes to "https://api-3t.paypal.com/nvp" and shows the message below.

TOKEN=EC%2d2XR31554RN094031R&TIMESTAMP=2012%2d01%2d03T10%3a23%3a11Z&CORRELATIONID=a0c80a35bfde2&ACK=Success&VERSION=65%2e0&BUILD=2271164

Shouldn't it send me back to my own page, to the "RETURNURL"? or is there something i'm missing

Это было полезно?

Решение

Yeah, I'm pretty sure, that my comment was right. This POST should be done by your web app server - transient to the client. Just before the user clicks the 'pay' button (when you render the site) on your web app - you call the setExpressCheckout, then you read the token from the answer and apply it to the button. Then after the user clicks he is redirected to paypal site and returns to your page by returnURL.

Please make sure you exactly understand the whole process. Giving too much information to your users may be a potential vulnerability to your payments module.

EDIT: I guess that the form you've created is from PayPal's tutorial. Please notice that it is for testing and understanding the whole process only.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top