public void SavePayPalTransactionStartTest() { string customerId = "someCustomerId"; string prodId = "someProdId"; var response = new SetExpressCheckoutResponseType() { Ack = AckCodeType.CustomCode, Any = new XmlDocument().CreateElement("someXmlElement"), Build = "someBuild", CorrelationID = "someCorrelationId", Errors = new []{ new ErrorType { ErrorCode = "someErrorCode", ErrorParameters = new []{ new ErrorParameterType { ParamID = "someParamId", Value = "someValue" }}, LongMessage = "someLongMsg", SeverityCode = SeverityCodeType.CustomCode, ShortMessage = "someShortMsg" }}, Timestamp = new DateTime(), TimestampSpecified = true, Token = "someToken", Version = "someVersion" }; var ppProcessor = new PayPalProcessorAccessor(); ppProcessor.SavePayPalTransactionStart(customerId, prodId, response); //verify saved var ds = GetTable("PayPalBeginExpressCheckout"); Assert.IsTrue(isObjectSaved(customerId, prodId, response, ds)); }
public void ECSetExpressCheckoutCodeTest() { string paymentAmount = new Decimal(1.0).ToString(); string returnUrl = "http://vergencemedia.com/"; string cancelUrl = "http://vergencemedia.com/"; PaymentActionCodeType paymentAction = PaymentActionCodeType.Sale; CurrencyCodeType currencyCode = CurrencyCodeType.USD; var ppProcessor = new PayPalProcessorAccessor(); var result = ppProcessor.ECSetExpressCheckoutCode(paymentAmount, returnUrl, cancelUrl, paymentAction, currencyCode); Assert.AreEqual(AckCodeType.Success, result.Ack, "The ack was {0}. Error: {1}", result.Ack, (result.Errors != null && result.Errors.Length > 0) ? result.Errors[0].ErrorCode + " " + result.Errors[0].LongMessage : ""); Assert.IsNotNullOrEmpty(result.Token); }