Skip to content

Commit

Permalink
fixed bug when init , then try to pay dose not work
Browse files Browse the repository at this point in the history
  • Loading branch information
alifaraun committed Apr 23, 2024
1 parent 5a6b41d commit 19fd1d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/views/pay.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class MoamalataPay {
}
const _moamalatPay = new MoamalataPay(
var _moamalatPay = new MoamalataPay(
"{{ config('moamalat-pay.merchant_id') }}",
"{{ config('moamalat-pay.terminal_id') }}",
0,
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/PayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function test_render()
{
$blade = app('moamalat-pay')->init();
$this->assertStringContainsString('class MoamalataPay', $blade);
$this->assertStringContainsString('const _moamalatPay = new MoamalataPay(', $blade);
$this->assertStringContainsString('var _moamalatPay = new MoamalataPay(', $blade);
$this->assertStringNotContainsString('_moamalatPay.pay(', $blade);
$this->assertStringContainsString("_moamalatPay.pay(1000, '');", app('moamalat-pay')->pay(1000));
$this->assertStringContainsString("_moamalatPay.pay(1000, 'test-ref');", app('moamalat-pay')->pay(1000, 'test-ref'));
Expand All @@ -38,7 +38,7 @@ public function test_component()
{
$view = $this->blade('<x-moamalat-pay amount="1000" />');
$view->assertSeeText('class MoamalataPay');
$view->assertSeeText('const _moamalatPay = new MoamalataPay(');
$view->assertSeeText('var _moamalatPay = new MoamalataPay(');
$view->assertSeeText('_moamalatPay.pay(1000, "");', false);
}
}

0 comments on commit 19fd1d5

Please sign in to comment.