コード例 #1
0
		public override RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context)
		{
			throw new NotImplementedException();
		}
コード例 #2
0
 public abstract RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context);
コード例 #3
0
		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;
		}
コード例 #4
0
		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" };
		}
コード例 #5
0
		public abstract RefundProcessPaymentResult RefundProcessPayment(RefundProcessPaymentEvaluationContext context);