Skip to content

Commit

Permalink
Payu Laravel
Browse files Browse the repository at this point in the history
  • Loading branch information
atomjoy committed Nov 19, 2022
1 parent e786692 commit 5d52f77
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/Payu/PayuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
class PayuTest extends TestCase
{
// use RefreshDatabase;
use RefreshDatabase;

/** @test */
public function sandbox_config()
Expand Down Expand Up @@ -78,24 +78,6 @@ public function sandbox_payment_url()
$this->assertTrue(true);
}

/** @test */
public function notify_success_pages()
{
if (config('payu.env') == 'sandbox') {
// Create demo orders
$this->seed(PayuDatabaseSeeder::class);

$res = $this->postJson('/web/payment/notify/payu', ['status' => 'SUCCESS']);
$res->assertStatus(422);

$o = Order::first();
$this->assertNotEmpty($o->id);

$res = $this->get('/web/payment/success/payu/' . $o->id);
$res->assertStatus(200);
}
}

/** @test */
public function convert_to_cents()
{
Expand Down Expand Up @@ -171,4 +153,22 @@ public function convert_to_cents()
$this->assertTrue($g->toCents(123.46) == 12346);
$this->assertTrue($g->toCents(123.56) == 12356);
}

/** @test */
public function notify_success_pages()
{
if (config('payu.env', 'sandbox') == 'sandbox') {
// Create demo orders
$this->seed(PayuDatabaseSeeder::class);

$res = $this->postJson('/web/payment/notify/payu', ['status' => 'SUCCESS']);
$res->assertStatus(422);

$o = Order::first();
$this->assertNotEmpty($o->id);

$res = $this->get('/web/payment/success/payu/' . $o->id);
$res->assertStatus(200);
}
}
}

0 comments on commit 5d52f77

Please sign in to comment.