-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CC-212 Update php library for new test method
- Loading branch information
adrian.dica
committed
Apr 21, 2020
1 parent
cbac8da
commit f1f4436
Showing
12 changed files
with
57 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ class TestCharge extends PHPUnit_Framework_TestCase | |
public function testChargeForm() | ||
{ | ||
$params = array( | ||
'sid' => '1817037', | ||
'sid' => 'your seller id', | ||
'mode' => '2CO', | ||
'li_0_name' => 'Test Product', | ||
'li_0_price' => '0.01' | ||
|
@@ -19,7 +19,7 @@ public function testChargeForm() | |
public function testChargeFormAuto() | ||
{ | ||
$params = array( | ||
'sid' => '1817037', | ||
'sid' => 'your seller id', | ||
'mode' => '2CO', | ||
'li_0_name' => 'Test Product', | ||
'li_0_price' => '0.01' | ||
|
@@ -30,11 +30,11 @@ public function testChargeFormAuto() | |
public function testDirect() | ||
{ | ||
$params = array( | ||
'sid' => '1817037', | ||
'sid' => 'your seller id', | ||
'mode' => '2CO', | ||
'li_0_name' => 'Test Product', | ||
'li_0_price' => '0.01', | ||
'card_holder_name' => 'Testing Tester', | ||
'card_holder_name' => 'John Doe', | ||
'email' => '[email protected]', | ||
'street_address' => '123 test st', | ||
'city' => 'Columbus', | ||
|
@@ -47,13 +47,12 @@ public function testDirect() | |
|
||
public function testDirectAuto() | ||
{ | ||
Twocheckout::sandbox(true); | ||
$params = array( | ||
'sid' => '1817037', | ||
'sid' => 'your seller id', | ||
'mode' => '2CO', | ||
'li_0_name' => 'Test Product', | ||
'li_0_price' => '0.01', | ||
'card_holder_name' => 'Testing Tester', | ||
'card_holder_name' => 'John Doe', | ||
'email' => '[email protected]', | ||
'street_address' => '123 test st', | ||
'city' => 'Columbus', | ||
|
@@ -66,9 +65,8 @@ public function testDirectAuto() | |
|
||
public function testChargeLink() | ||
{ | ||
Twocheckout::sandbox(true); | ||
$params = array( | ||
'sid' => '1817037', | ||
'sid' => 'your seller id', | ||
'mode' => '2CO', | ||
'li_0_name' => 'Test Product', | ||
'li_0_price' => '0.01' | ||
|
@@ -78,19 +76,19 @@ public function testChargeLink() | |
|
||
public function testChargeAuth() | ||
{ | ||
Twocheckout::privateKey('BE632CB0-BB29-11E3-AFB6-D99C28100996'); | ||
Twocheckout::sellerId('901248204'); | ||
Twocheckout::sandbox(true); | ||
Twocheckout::privateKey('your private key'); | ||
Twocheckout::sellerId('your seller id'); | ||
|
||
try { | ||
$charge = Twocheckout_Charge::auth(array( | ||
"sellerId" => "901248204", | ||
"sellerId" => "your seller id", | ||
"demo" =>true, | ||
"merchantOrderId" => "123", | ||
"token" => 'MjFiYzIzYjAtYjE4YS00ZmI0LTg4YzYtNDIzMTBlMjc0MDlk', | ||
"token" => 'MDY3OTMwMWUtODg5NS00NmFmLWJhNjgtYjMxYTI1ZjhkOWU3', | ||
"currency" => 'USD', | ||
"total" => '10.00', | ||
"billingAddr" => array( | ||
"name" => 'Testing Tester', | ||
"name" => 'John Doe', | ||
"addrLine1" => '123 Test St', | ||
"city" => 'Columbus', | ||
"state" => 'OH', | ||
|
@@ -100,7 +98,7 @@ public function testChargeAuth() | |
"phoneNumber" => '555-555-5555' | ||
), | ||
"shippingAddr" => array( | ||
"name" => 'Testing Tester', | ||
"name" => 'John Doe', | ||
"addrLine1" => '123 Test St', | ||
"city" => 'Columbus', | ||
"state" => 'OH', | ||
|
@@ -110,9 +108,9 @@ public function testChargeAuth() | |
"phoneNumber" => '555-555-5555' | ||
) | ||
)); | ||
$this->assertEquals('APPROVED', $charge['response']['responseCode']); | ||
$this->assertSame('APPROVED', $charge['response']['responseCode']); | ||
} catch (Twocheckout_Error $e) { | ||
$this->assertEquals('Bad request - parameter error', $e->getMessage()); | ||
$this->assertSame('Bad request - parameter error', $e->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.