public Response <PayPal.Api.Payment> GetPayment(String codePayment) { Response <PayPal.Api.Payment> response = null; PaymentBusiness paymentBusiness = null; try { paymentBusiness = new PaymentBusiness(); PayPal <PayPal.Api.Payment> paypal = paymentBusiness.Get(codePayment); if (paypal.IsValid) { response = new Response <PayPal.Api.Payment>(paypal.Object, ResponseStatus.Success, "Success"); } else { response = new Response <PayPal.Api.Payment>(paypal.Object, ResponseStatus.ErrorValidation, "Success"); response.Validations = paypal.Validations; } } catch (Exception ex) { response = new Response <PayPal.Api.Payment>(null, ResponseStatus.Error, ex.Message); } return(response); }