public static CreatePaymentForSale ( APIContext apiContext ) : |
||
apiContext | APIContext | |
return |
public void SaleRefundTest() { try { // Create a credit card sale payment var payment = PaymentTest.CreatePaymentForSale(); // Get the sale resource var sale = payment.transactions[0].related_resources[0].sale; var refund = new Refund { amount = new Amount { currency = "USD", total = "0.01" } }; var response = sale.Refund(TestingUtil.GetApiContext(), refund); Assert.IsNotNull(response); Assert.AreEqual("completed", response.state); } finally { TestingUtil.RecordConnectionDetails(); } }
public static PaymentHistory GetPaymentHistory() { List <Payment> paymentList = new List <Payment>(); paymentList.Add(PaymentTest.CreatePaymentForSale()); PaymentHistory history = new PaymentHistory(); history.count = 1; history.payments = paymentList; history.next_id = "1"; return(history); }
public void SaleRefundTest() { try { var apiContext = TestingUtil.GetApiContext(); this.RecordConnectionDetails(); // Create a credit card sale payment var payment = PaymentTest.CreatePaymentForSale(apiContext); this.RecordConnectionDetails(); // Get the sale resource var sale = payment.transactions[0].related_resources[0].sale; var refund = new Refund { amount = new Amount { currency = "USD", total = "0.01" } }; apiContext.ResetRequestId(); var response = sale.Refund(apiContext, refund); this.RecordConnectionDetails(); Assert.IsNotNull(response); Assert.AreEqual("completed", response.state); } catch (ConnectionException) { this.RecordConnectionDetails(false); throw; } }