Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Adds preauth test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 20, 2016
1 parent fa0a1c8 commit eeb2df9
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tests/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ public function setUp()
{
parent::setUp();

$this->params = ['environment' => $this->environment];
$this->gateway = Moneris::create($this->id, $this->token, $this->params)->connect();
$params = ['environment' => $this->environment];
$this->gateway = Moneris::create($this->id, $this->token, $params)->connect();
$this->params = [
'order_id' => uniqid('1234-56789', true),
'amount' => '1.00',
'credit_card' => $this->visa,
'expdate' => '2012',
];
}

/** @test */
Expand All @@ -55,14 +61,16 @@ public function it_can_access_properties_of_the_class()
/** @test */
public function it_can_make_a_purchase_and_receive_a_response()
{
$params = [
'order_id' => uniqid('1234-56789', true),
'amount' => '1.00',
'credit_card' => $this->visa,
'expdate' => '2012',
];
$response = $this->gateway->purchase($this->params);

$this->assertEquals(Response::class, get_class($response));
$this->assertTrue($response->successful);
}

$response = $this->gateway->purchase($params);
/** @test */
public function it_can_pre_authorize_a_purchase_and_receive_a_response()
{
$response = $this->gateway->preauth($this->params);

$this->assertEquals(Response::class, get_class($response));
$this->assertTrue($response->successful);
Expand Down

0 comments on commit eeb2df9

Please sign in to comment.