public static Payment CreateFuturePayment() { FuturePayment pay = new FuturePayment(); pay.intent = "sale"; CreditCard card = CreditCardTest.GetCreditCard(); List <FundingInstrument> fundingInstruments = new List <FundingInstrument>(); FundingInstrument fundingInstrument = new FundingInstrument(); fundingInstrument.credit_card = card; fundingInstruments.Add(fundingInstrument); Payer payer = new Payer(); payer.payment_method = "credit_card"; payer.funding_instruments = fundingInstruments; List <Transaction> transactionList = new List <Transaction>(); Transaction trans = new Transaction(); trans.amount = AmountTest.GetAmount(); transactionList.Add(trans); pay.transactions = transactionList; pay.payer = payer; Payment paymnt = pay.Create(TestingUtil.GetApiContext()); return(paymnt); }
public static Order GetOrder() { var order = new Order(); order.amount = AmountTest.GetAmount(); return(order); }
public static Transaction GetTransaction() { var transaction = new Transaction(); transaction.description = "Test Description"; transaction.note_to_payee = "Test note to payee"; transaction.amount = AmountTest.GetAmount(); transaction.payee = PayeeTest.GetPayee(); transaction.item_list = ItemListTest.GetItemList(); transaction.related_resources = new List <RelatedResources>(); transaction.related_resources.Add(RelatedResourcesTest.GetRelatedResources()); return(transaction); }
public static Refund GetRefund() { var refund = new Refund(); refund.capture_id = "101"; refund.id = "102"; refund.parent_payment = "103"; refund.sale_id = "104"; refund.state = "Approved"; refund.amount = AmountTest.GetAmount(); refund.create_time = "2013-01-17T18:12:02.347Z"; refund.links = LinksTest.GetLinksList(); return(refund); }
public static Refund GetRefund() { var refund = new Refund(); refund.capture_id = "101"; refund.id = "102"; refund.parent_payment = "103"; refund.sale_id = "104"; refund.state = "COMPLETED"; refund.amount = AmountTest.GetAmount(); refund.create_time = TestingUtil.GetCurrentDateISO(-1); refund.links = LinksTest.GetLinksList(); return(refund); }
public void CaptureObjectTest() { var cap = GetCapture(); var expected = AmountTest.GetAmount(); var actual = cap.amount; Assert.Equal(expected.currency, actual.currency); Assert.Equal(expected.details.fee, actual.details.fee); Assert.Equal(expected.details.shipping, actual.details.shipping); Assert.Equal(expected.details.subtotal, actual.details.subtotal); Assert.Equal(expected.details.tax, actual.details.tax); Assert.Equal(expected.total, actual.total); Assert.NotNull(cap.create_time); Assert.Equal("001", cap.id); Assert.Equal("1000", cap.parent_payment); Assert.Equal("COMPLETED", cap.state); }
public void CaptureObjectTest() { var cap = GetCapture(); var expected = AmountTest.GetAmount(); var actual = cap.amount; Assert.AreEqual(expected.currency, actual.currency); Assert.AreEqual(expected.details.fee, actual.details.fee); Assert.AreEqual(expected.details.shipping, actual.details.shipping); Assert.AreEqual(expected.details.subtotal, actual.details.subtotal); Assert.AreEqual(expected.details.tax, actual.details.tax); Assert.AreEqual(expected.total, actual.total); Assert.AreEqual(cap.create_time, "2013-01-15T15:10:05.123Z"); Assert.AreEqual("001", cap.id); Assert.AreEqual("1000", cap.parent_payment); Assert.AreEqual("Authorized", cap.state); }