-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added methods to knowing statuses (success and pending)
- Loading branch information
1 parent
921cab1
commit 1dc29ab
Showing
2 changed files
with
38 additions
and
0 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 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 |
---|---|---|
|
@@ -75,4 +75,27 @@ function it_can_prepare_an_order() { | |
'urlnotify' => route('payku.notify', 'AAA'), | ||
], LaravelPayku::prepareOrder('AAA', 'Test', 1000, '[email protected]')); | ||
} | ||
|
||
/** @test */ | ||
function it_knows_its_details() { | ||
$payment = PaykuTransaction::create(['id' => 'trx...']); | ||
|
||
$this->assertInstanceOf(PaykuTransaction::class, LaravelPayku::findById('trx...')); | ||
} | ||
|
||
/** @test */ | ||
function it_knows_when_it_has_status_success() { | ||
$payment = PaykuTransaction::create(['id' => 'trx...', 'status' => 'success']); | ||
|
||
$this->assertTrue(LaravelPayku::hasStatusSuccess('trx...')); | ||
$this->assertFalse(LaravelPayku::hasStatusPending('trx...')); | ||
} | ||
|
||
/** @test */ | ||
function it_knows_when_it_has_status_pending() { | ||
$payment = PaykuTransaction::create(['id' => 'trx...', 'status' => 'pending']); | ||
|
||
$this->assertTrue(LaravelPayku::hasStatusPending('trx...')); | ||
$this->assertFalse(LaravelPayku::hasStatusSuccess('trx...')); | ||
} | ||
} |