1 4 package com.openedit.store.gateway; 5 6 import com.openedit.WebPageRequest; 7 import com.openedit.store.CreditCardType; 8 import com.openedit.store.CreditPaymentMethod; 9 import com.openedit.store.Order; 10 import com.openedit.store.StoreTestCase; 11 12 16 public class AuthorizeNetOrderArchiveTest extends StoreTestCase 17 { 18 19 public AuthorizeNetOrderArchiveTest( String name ) 20 { 21 super( name ); 22 } 23 24 public void testOrderArchive() throws Exception 25 { 26 AuthorizeNetOrderArchive archiver = new AuthorizeNetOrderArchive(); 27 WebPageRequest context = getFixture().createPageRequest(); 28 Order order = createOrder(); 29 archiver.exportNewOrder( context, getStore(), order ); 30 assertFalse( order.getOrderState().isOk() ); 31 } 32 public void XtestRealOrder() throws Exception 33 { 34 String cburkeysrealcreditcardnumber = "443220165027XXXX"; 35 36 CreditPaymentMethod paymentMethod = new CreditPaymentMethod(); 37 CreditCardType type = new CreditCardType(); 38 type.setName( "Visa" ); 39 paymentMethod.setCreditCardType( type ); 40 paymentMethod.setCardNumber( cburkeysrealcreditcardnumber ); 41 paymentMethod.setExpirationMonth( 6 ); 42 paymentMethod.setExpirationYear( 2006 ); 43 44 AuthorizeNetOrderArchive archiver = new AuthorizeNetOrderArchive(); 45 WebPageRequest context = getFixture().createPageRequest(); 46 Order order = createOrder(); 47 order.setPaymentMethod(paymentMethod); 48 archiver.exportNewOrder( context, getStore(), order ); 49 if ( ! order.getOrderState().isOk() ) 50 { 51 throw new Exception (order.getOrderState().getDescription()); 52 } 53 54 55 } 56 } 57 | Popular Tags |