diff --git a/src/library/Payment/Adapter/Stripe.php b/src/library/Payment/Adapter/Stripe.php index 50067c4e1..f3d4ef44a 100644 --- a/src/library/Payment/Adapter/Stripe.php +++ b/src/library/Payment/Adapter/Stripe.php @@ -91,7 +91,7 @@ class Payment_Adapter_Stripe implements FOSSBilling\InjectionAwareInterface ]; } - public function getHtml($api_admin, $invoice_id, $subscription): string + public function getHtml(FOSSBilling\Api\Proxy $api_admin, int $invoice_id, bool $subscription): string { $invoiceModel = $this->di['db']->load('Invoice', $invoice_id); @@ -161,7 +161,7 @@ class Payment_Adapter_Stripe implements FOSSBilling\InjectionAwareInterface throw new Exception($tx->error); } - public function processTransaction($api_admin, $id, $data, $gateway_id): void + public function processTransaction(FOSSBilling\Api\Proxy $api_admin, int $id, array $data, int $gateway_id): void { $tx = $this->di['db']->getExistingModelById('Transaction', $id); $invoiceService = $this->di['mod_service']('Invoice'); diff --git a/src/modules/Invoice/tests/Unit/ServiceTransactionTest.php b/src/modules/Invoice/tests/Unit/ServiceTransactionTest.php index 533ceb5d8..ca3c08030 100644 --- a/src/modules/Invoice/tests/Unit/ServiceTransactionTest.php +++ b/src/modules/Invoice/tests/Unit/ServiceTransactionTest.php @@ -200,10 +200,10 @@ test('gets search query with various parameters', function (array $data, array $ ['txn_id' => 'longTxn_id'], ['txn_id' => 'longTxn_id'], 'AND m.txn_id = :txn_id', ], [ - ['date_from' => '2012-12-12'], ['date_from' => 1_355_270_400], 'AND UNIX_TIMESTAMP(m.created_at) >= :date_from', + ['date_from' => '2012-12-12'], ['date_from' => strtotime('2012-12-12 00:00:00 UTC')], 'AND UNIX_TIMESTAMP(m.created_at) >= :date_from', ], [ - ['date_to' => '2012-12-12'], ['date_to' => 1_355_270_400], 'AND UNIX_TIMESTAMP(m.created_at) <= :date_to', + ['date_to' => '2012-12-12'], ['date_to' => strtotime('2012-12-12 00:00:00 UTC')], 'AND UNIX_TIMESTAMP(m.created_at) <= :date_to', ], ]); @@ -249,7 +249,7 @@ test('createAndProcess marks transaction as error when processing throws', funct $service->shouldReceive('processTransaction') ->with(1) ->once() - ->andThrow(new RuntimeException('Processing failed')); + ->andThrow(new RuntimeException('Processing failed', 1234)); $service->setDi($di); $thrown = null; @@ -263,7 +263,8 @@ test('createAndProcess marks transaction as error when processing throws', funct expect($thrown)->toBeInstanceOf(RuntimeException::class) ->and($thrown->getMessage())->toBe('Processing failed') ->and($transactionModel->status)->toBe(Model_Transaction::STATUS_ERROR) - ->and($transactionModel->error)->toBe('Processing failed'); + ->and($transactionModel->error)->toBe('Processing failed') + ->and($transactionModel->error_code)->toBe(1234); }); test('createAndProcess skips processing when transaction is already processed', function (): void { diff --git a/src/themes/huraga/html/layout_public.html.twig b/src/themes/huraga/html/layout_public.html.twig index 80fa70e66..2b3dfd43e 100644 --- a/src/themes/huraga/html/layout_public.html.twig +++ b/src/themes/huraga/html/layout_public.html.twig @@ -3,10 +3,11 @@ {% set canonical_url = guest.system_current_url|url %} {% set company = guest.system_company %} {% set public_logo_url = settings.theme == 'dark' ? company.logo_url_dark : company.logo_url %} +{% set page_title = (settings.meta_title_prefix ~ ' ' ~ block('meta_title') ~ ' ' ~ settings.meta_title_suffix)|trim %}
-