Last post Jan 04, 2015 04:35 AM by Harrison.Scott
Jan 04, 2015 04:05 AM|Harrison.Scott|LINK
I've integrated paypal in to my web site, all is working as expected, when I get to the page where it says payment successful transaction ID is "Number here" I need to return this transaction Id back to my website when the user presses "Return to SiteName"
as I need to store it in my database for our records, I have spent the vast majority of today googling/trying solutions but with no avail does anyone know how to return this?
From what I have read inside my developer sandbox account I need to turn on Auto return and PDT, but with this approach I specify my return URL within my web site as I append a few extra values to it which I need when I return back from paypal i.e my url
to post to paypal would look something like this at the end
"Paypal-Url-Will-Be-Here/1232 (1232 being the particular item id.)
All I need is the transaction can any one shed any light on how I do this
This is my config
<add key="business" value="XXXXXX@XXXXXXXXX.co.uk" />
<add key="IsSandbox" value="true" />
<add key="currency_code" value="GBP" />
<add key="return" value="http://localhost:1470/paypal/redirectfrompaypal/" />
<add key="cancel_return" value="http://localhost:1470/paypal/cancelfrompaypal/" />
<add key="notify_url" value="http://localhost:1470/paypal/notifyfrompaypal/" />
<add key="test_url" value="https://www.sandbox.paypal.com/cgi-bin/webscr" />
and this is my controller which makes the call
model.cmd = "_cart";
model.business = ConfigurationManager.AppSettings["business"];
model.cancel_return = ConfigurationManager.AppSettings["cancel_return"] + orderId;
model.@return = ConfigurationManager.AppSettings["return"] + orderId;
model.upload = "1";
model.actionURL = useSandbox ? ConfigurationManager.AppSettings["test_url"] : ConfigurationManager.AppSettings["Prod_url"];
model.notify_url = ConfigurationManager.AppSettings["notify_url"] + orderId;
model.currency_code = ConfigurationManager.AppSettings["currency_code"];
model.amount = "9.99";
model.item_name = "Test Order";
and my controller where its postback after the payment is completed.
public ActionResult RedirectFromPaypal(Int64 orderId)
// Get transaction Id here?!?!?! how!!
Jan 04, 2015 04:35 AM|Harrison.Scott|LINK
I've also tried
var txToken = Request.QueryString.Get("tx");
within then controller which paypal posts back to, txToken is null.