@@ -8,7 +8,7 @@ class TestCharge extends PHPUnit_Framework_TestCase
88 public function testChargeForm ()
99 {
1010 $ params = array (
11- 'sid ' => '1817037 ' ,
11+ 'sid ' => 'your seller id ' ,
1212 'mode ' => '2CO ' ,
1313 'li_0_name ' => 'Test Product ' ,
1414 'li_0_price ' => '0.01 '
@@ -19,7 +19,7 @@ public function testChargeForm()
1919 public function testChargeFormAuto ()
2020 {
2121 $ params = array (
22- 'sid ' => '1817037 ' ,
22+ 'sid ' => 'your seller id ' ,
2323 'mode ' => '2CO ' ,
2424 'li_0_name ' => 'Test Product ' ,
2525 'li_0_price ' => '0.01 '
@@ -30,11 +30,11 @@ public function testChargeFormAuto()
3030 public function testDirect ()
3131 {
3232 $ params = array (
33- 'sid ' => '1817037 ' ,
33+ 'sid ' => 'your seller id ' ,
3434 'mode ' => '2CO ' ,
3535 'li_0_name ' => 'Test Product ' ,
3636 'li_0_price ' => '0.01 ' ,
37- 'card_holder_name ' => 'Testing Tester ' ,
37+ 'card_holder_name ' => 'John Doe ' ,
38383939 'street_address ' => '123 test st ' ,
4040 'city ' => 'Columbus ' ,
@@ -47,13 +47,12 @@ public function testDirect()
4747
4848 public function testDirectAuto ()
4949 {
50- Twocheckout::sandbox (true );
5150 $ params = array (
52- 'sid ' => '1817037 ' ,
51+ 'sid ' => 'your seller id ' ,
5352 'mode ' => '2CO ' ,
5453 'li_0_name ' => 'Test Product ' ,
5554 'li_0_price ' => '0.01 ' ,
56- 'card_holder_name ' => 'Testing Tester ' ,
55+ 'card_holder_name ' => 'John Doe ' ,
57565857 'street_address ' => '123 test st ' ,
5958 'city ' => 'Columbus ' ,
@@ -66,9 +65,8 @@ public function testDirectAuto()
6665
6766 public function testChargeLink ()
6867 {
69- Twocheckout::sandbox (true );
7068 $ params = array (
71- 'sid ' => '1817037 ' ,
69+ 'sid ' => 'your seller id ' ,
7270 'mode ' => '2CO ' ,
7371 'li_0_name ' => 'Test Product ' ,
7472 'li_0_price ' => '0.01 '
@@ -78,19 +76,19 @@ public function testChargeLink()
7876
7977 public function testChargeAuth ()
8078 {
81- Twocheckout::privateKey ('BE632CB0-BB29-11E3-AFB6-D99C28100996 ' );
82- Twocheckout::sellerId ('901248204 ' );
83- Twocheckout::sandbox (true );
79+ Twocheckout::privateKey ('your private key ' );
80+ Twocheckout::sellerId ('your seller id ' );
8481
8582 try {
8683 $ charge = Twocheckout_Charge::auth (array (
87- "sellerId " => "901248204 " ,
84+ "sellerId " => "your seller id " ,
85+ "demo " =>true ,
8886 "merchantOrderId " => "123 " ,
89- "token " => 'MjFiYzIzYjAtYjE4YS00ZmI0LTg4YzYtNDIzMTBlMjc0MDlk ' ,
87+ "token " => 'MDY3OTMwMWUtODg5NS00NmFmLWJhNjgtYjMxYTI1ZjhkOWU3 ' ,
9088 "currency " => 'USD ' ,
9189 "total " => '10.00 ' ,
9290 "billingAddr " => array (
93- "name " => 'Testing Tester ' ,
91+ "name " => 'John Doe ' ,
9492 "addrLine1 " => '123 Test St ' ,
9593 "city " => 'Columbus ' ,
9694 "state " => 'OH ' ,
@@ -100,7 +98,7 @@ public function testChargeAuth()
10098 "phoneNumber " => '555-555-5555 '
10199 ),
102100 "shippingAddr " => array (
103- "name " => 'Testing Tester ' ,
101+ "name " => 'John Doe ' ,
104102 "addrLine1 " => '123 Test St ' ,
105103 "city " => 'Columbus ' ,
106104 "state " => 'OH ' ,
@@ -110,9 +108,9 @@ public function testChargeAuth()
110108 "phoneNumber " => '555-555-5555 '
111109 )
112110 ));
113- $ this ->assertEquals ('APPROVED ' , $ charge ['response ' ]['responseCode ' ]);
111+ $ this ->assertSame ('APPROVED ' , $ charge ['response ' ]['responseCode ' ]);
114112 } catch (Twocheckout_Error $ e ) {
115- $ this ->assertEquals ('Bad request - parameter error ' , $ e ->getMessage ());
113+ $ this ->assertSame ('Bad request - parameter error ' , $ e ->getMessage ());
116114 }
117115 }
118116}
0 commit comments