KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > store > gateway > AuthorizeNetOrderArchiveTest


1 /*
2  * Created on Oct 12, 2004
3  */

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 /**
13  * @author Matthew Avery, mavery@einnovation.com
14  * @author Dennis Brown
15  */

16 public class AuthorizeNetOrderArchiveTest extends StoreTestCase
17 {
18
19     public AuthorizeNetOrderArchiveTest( String JavaDoc name )
20     {
21         super( name );
22     }
23
24     public void testOrderArchive() throws Exception JavaDoc
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 JavaDoc
33     {
34         String JavaDoc 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 JavaDoc(order.getOrderState().getDescription());
52         }
53
54         
55     }
56 }
57
Popular Tags