I'm trying to use AdaptivePayments to send funds from one user to another user via my site, so I can check whether or not they've actually gone through with the payment. The payment goes through, but they're not returned to my site so I can't track the payment.
I'm redirecting to `https://www.sandbox.paypal.com/webscr&cmd=_ap-payment&paykey=MYKEY But I jsut get takn to 'My Account' and see the payment is successful, but not redirected.
I've also tried redirecting to https://sandbox.paypal.com/webapps/adaptivepayment/flow/pay?&paykey=MYKEY but I get:
This transaction has already been approved. Please visit your PayPal Account Overview to see the details.
I'm redirecting by setting is NVPRequest["returnUrl"] = "http://mysite.com/APReturn.aspx but this is seemingly ignored. Is there a way to do this or a better method of achieving what I need?
Late, but for those who come across this on Google:
You should redirect to https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=MYKEY (note the addition of cgi-bin and change of & to ?). In addition, I would strongly discourage you of using the return page as a means to track a buyer. Buyers can (and will) close their browser as soon as a payment has been completed.
Instead, I'd highly suggest looking into using PayPal Instant Payment Notifications (IPN). PayPal IPN allows you to (asynchronously) process order information while not having to depend on the buyer to return to your website to complete the order.
You can use IPN by setting up a script which receives this (POST) data from PayPal. In addition, you must include the following code in your button and/or API call(s):
For Website Payments Standard (where "xxxxxxxx" is the full URL to your IPN script):
For Express Checkout: Include NOTIFYURL=xxxxxxxx in your SetExpressCheckout and DoExpressCheckoutPayment API call
For Website Payments Pro Include NOTIFYURL=xxxxxxxx in your DoDirectPayment API call
For Adaptive Payments Include ipnNotificationUrl in your Pay request.
You can find sample code, documentation and further information on PayPal IPN at https://www.paypal.com/ipn
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With