|
1 | | -using System.Collections.Generic; |
2 | | -using System.Linq; |
3 | | -using eWAY.Rapid.Enums; |
4 | | -using eWAY.Rapid.Internals.Models; |
| 1 | +using eWAY.Rapid.Enums; |
5 | 2 | using eWAY.Rapid.Internals.Response; |
6 | 3 | using eWAY.Rapid.Models; |
7 | 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.Linq; |
8 | 7 | using CardDetails = eWAY.Rapid.Models.CardDetails; |
9 | 8 | using Customer = eWAY.Rapid.Models.Customer; |
| 9 | +using DirectTokenCustomer = eWAY.Rapid.Internals.Models.DirectTokenCustomer; |
10 | 10 | using LineItem = eWAY.Rapid.Models.LineItem; |
11 | 11 | using Payment = eWAY.Rapid.Internals.Models.Payment; |
12 | 12 | using Refund = eWAY.Rapid.Models.Refund; |
| 13 | +using ShippingAddress = eWAY.Rapid.Models.ShippingAddress; |
13 | 14 | using VerificationResult = eWAY.Rapid.Internals.Models.VerificationResult; |
14 | 15 |
|
15 | 16 | namespace eWAY.Rapid.Tests |
@@ -123,7 +124,7 @@ internal static Customer CreateCustomer() |
123 | 124 | { |
124 | 125 | Country = "au", |
125 | 126 | City = "Sydney", |
126 | | - PostalCode = "", |
| 127 | + PostalCode = "2000", |
127 | 128 | State = "NSW", |
128 | 129 | Street1 = "Level 5", |
129 | 130 | Street2 = "369 Queen Street" |
@@ -280,6 +281,54 @@ internal static DirectPaymentResponse CreateDirectPaymentResponse() |
280 | 281 | }; |
281 | 282 | } |
282 | 283 |
|
| 284 | + internal static Direct3DSEnrollRequest CreateEnrollRequest() |
| 285 | + { |
| 286 | + return new Direct3DSEnrollRequest |
| 287 | + { |
| 288 | + Customer = CreateCustomer(), |
| 289 | + ShippingAddress = new ShippingAddress { |
| 290 | + ShippingMethod = "NextDay", |
| 291 | + FirstName = "John", |
| 292 | + LastName = "Smith", |
| 293 | + Street1 = "Level 5", |
| 294 | + Street2 = "369 Queen Street", |
| 295 | + City = "Sydney", |
| 296 | + State = "NSW", |
| 297 | + Country = "au", |
| 298 | + PostalCode = "2000", |
| 299 | + Phone = "09 889 0986" |
| 300 | + }, |
| 301 | + Items = new List<LineItem>() |
| 302 | + { |
| 303 | + new LineItem() |
| 304 | + { |
| 305 | + SKU = "12345678901234567890", |
| 306 | + Description = "Item Description 1", |
| 307 | + Quantity = 1, |
| 308 | + UnitCost = 400, |
| 309 | + Tax = 100, |
| 310 | + Total = 500 |
| 311 | + }, |
| 312 | + new LineItem() |
| 313 | + { |
| 314 | + SKU = "123456789012", |
| 315 | + Description = "Item Description 2", |
| 316 | + Quantity = 1, |
| 317 | + UnitCost = 400, |
| 318 | + Tax = 100, |
| 319 | + Total = 500 |
| 320 | + } |
| 321 | + }, |
| 322 | + Payment = new PaymentDetails() |
| 323 | + { |
| 324 | + TotalAmount = 1000, |
| 325 | + CurrencyCode = "AUD" |
| 326 | + }, |
| 327 | + RedirectUrl = "http://www.ewaypayments.com", |
| 328 | + SecuredCardData = "" |
| 329 | + }; |
| 330 | + } |
| 331 | + |
283 | 332 | //Assertion helpers |
284 | 333 | internal static void AssertReturnedCustomerData_VerifyAddressAreEqual(Customer responseCustomer, Customer requestCustomer) |
285 | 334 | { |
|
0 commit comments