public override RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context) { throw new NotImplementedException(); }
public abstract RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context);
public override RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context) { if (context == null) throw new ArgumentNullException("context"); if (context.Payment == null) throw new ArgumentNullException("context.Payment"); var retVal = new RefundProcessPaymentResult(); if (context.Payment.IsApproved && (context.Payment.PaymentStatus == PaymentStatus.Paid || context.Payment.PaymentStatus == PaymentStatus.Cancelled)) { Configuration configuration = new Configuration(Country.Code.SE, Language.Code.SV, Currency.Code.SEK, Encoding.Sweden) { Eid = Convert.ToInt32(AppKey), Secret = AppSecret, IsLiveMode = false }; Api.Api api = new Api.Api(configuration); var result = api.CreditInvoice(context.Payment.OuterId); } return retVal; }
public override RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context) { if (context == null || context.Payment == null) throw new ArgumentNullException("paymentEvaluationContext"); RefundProcessPaymentResult retVal = new RefundProcessPaymentResult(); if (context.Payment.IsApproved && (context.Payment.PaymentStatus == PaymentStatus.Paid || context.Payment.PaymentStatus == PaymentStatus.Cancelled)) { try { var config = GetConfigMap(); var service = new PayPalAPIInterfaceServiceService(config); RefundTransactionReq refundTransctionRequest = GetRefundTransactionRequest(context.Payment); service.RefundTransaction(refundTransctionRequest); } catch(Exception ex) { retVal.ErrorMessage = ex.Message; } } return new RefundProcessPaymentResult { ErrorMessage = "Not implemented yet" }; }