diff --git a/src/Messages/NetopiaPaymentRequest.php b/src/Messages/NetopiaPaymentRequest.php index 21a7398..7b7079a 100644 --- a/src/Messages/NetopiaPaymentRequest.php +++ b/src/Messages/NetopiaPaymentRequest.php @@ -48,7 +48,7 @@ public function getHtmlSnippet(array $options = []): ?string 'url' => $this->getUrl(), 'autoRedirect' => $options['autoRedirect'] ?? false, 'buttonText' => $options['buttonText'] ?? null, - 'buttonClass' => $options['buttonClass'] ?? false, + 'buttonClass' => $options['buttonClass'] ?? null, ] ) )->render(); diff --git a/src/resources/views/_request.blade.php b/src/resources/views/_request.blade.php index 1ec554b..801292c 100644 --- a/src/resources/views/_request.blade.php +++ b/src/resources/views/_request.blade.php @@ -9,7 +9,7 @@ onload="javascript:document.netopia.submit()">

@endif - diff --git a/tests/RequestFactoryTest.php b/tests/RequestFactoryTest.php index 0f38af2..e43357c 100644 --- a/tests/RequestFactoryTest.php +++ b/tests/RequestFactoryTest.php @@ -75,6 +75,19 @@ public function a_custom_view_can_be_passed_as_an_option() $this->assertStringContainsString(' 'EUR', 'amount' => 37.50]); + $payment = PaymentFactory::createFromPayable($order, $this->method); + $html = $this->createTestFactory() + ->create($payment) + ->getHtmlSnippet(['buttonText' => 'Giovanni Macaroni', 'buttonClass' => 'ilButton ilButtonAzzuro']); + + $this->assertMatchesRegularExpression('/]*>\s*Giovanni Macaroni\s*<\/button>/i', $html); + $this->assertStringContainsString('class="ilButton ilButtonAzzuro"', $html); + } + /** @test */ public function it_converts_return_and_confirm_urls_to_full_urls_if_only_paths_are_specified() {