public TwoCheckoutResponse Refund(SaleRefundServiceOptions options) { String Result = null; if (options.lineitem_id != null) { Result = TwoCheckoutUtil.Request("api/sales/refund_lineitem", "POST", "admin", options); } else { Result = TwoCheckoutUtil.Request("api/sales/refund_invoice", "POST", "admin", options); } return TwoCheckoutUtil.MapToObject<TwoCheckoutResponse>(Result); }
public void _008_TestLineitemRefund() { try { var ServiceObject = new SaleService(); var ArgsObject = new SaleRefundServiceOptions(); ArgsObject.lineitem_id = lineitem_id; ArgsObject.comment = "test refund"; ArgsObject.category = 5; var result = ServiceObject.Refund(ArgsObject); Assert.IsInstanceOf<TwoCheckoutResponse>(result); } catch (TwoCheckoutException e) { Assert.IsInstanceOf<TwoCheckoutException>(e); } }