Page 1 of 1

Getting paypal error code

Posted: Fri Nov 07, 2008 4:45 am
by frosty
on

Transaction authTx = GetLastAuthorization(lastPayment);
authTx.ResponseMessage

I get something like this,
This transaction cannot be processed. (10747)

Is there a way to just get the code "10747"

I've tried every property on Transaction. Of course i could use regEx to extract it, but it's not most elegant way to do this. Surely there is property somewhere that i am missing.

Thanks.

Re: Getting paypal error code

Posted: Fri Nov 07, 2008 7:09 am
by mazhar
Try the following property

Code: Select all

authTx.ResponseCode

Re: Getting paypal error code

Posted: Fri Nov 07, 2008 9:14 am
by frosty
afraid not. that was the first thing i tried. That returns a string like "failure".

I've done something like this

String regex = @"\d{5}";
foreach (Match m in Regex.Matches(responseMessage, regex))
{
return (m.Value);
}