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 { 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 = "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.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.IsNotNull(cap.create_time); Assert.AreEqual("001", cap.id); Assert.AreEqual("1000", cap.parent_payment); Assert.AreEqual("COMPLETED", cap.state); }