refactor: cleanup
This commit is contained in:
parent
6056be8cff
commit
446f102455
@ -38,7 +38,7 @@ class BTCPayServer extends AbstractProvider
|
||||
|
||||
$purchaseRequest->fastUpdate('provider_metadata', $invoice->getId());
|
||||
|
||||
$scriptUrl = $purchaseRequest->PaymentProfile->options['host'] . '/modal/btcpay.js';
|
||||
$scriptUrl = $this->modalJsUrl($purchaseRequest->PaymentProfile);
|
||||
|
||||
if ($purchaseRequest->PaymentProfile->options['invoice_alert'] ?? false) {
|
||||
$this->sendAlertWithInvoice($purchase, $invoice, $scriptUrl);
|
||||
@ -63,7 +63,7 @@ class BTCPayServer extends AbstractProvider
|
||||
throw $controller->exception($controller->noPermission());
|
||||
}
|
||||
|
||||
$scriptUrl = $purchaseRequest->PaymentProfile->options['host'] . '/modal/btcpay.js';
|
||||
$scriptUrl = $this->modalJsUrl($paymentProfile);
|
||||
|
||||
return $controller->view(
|
||||
'BS\BtcPayServer:Initiate\BTCPayServer',
|
||||
@ -72,6 +72,11 @@ class BTCPayServer extends AbstractProvider
|
||||
);
|
||||
}
|
||||
|
||||
protected function modalJsUrl(PaymentProfile $paymentProfile): string
|
||||
{
|
||||
return $paymentProfile->options['host'].'/modal/btcpay.js';
|
||||
}
|
||||
|
||||
protected function sendAlertWithInvoice(
|
||||
Purchase $purchase,
|
||||
InvoiceResult $invoice,
|
||||
@ -249,7 +254,6 @@ class BTCPayServer extends AbstractProvider
|
||||
$apiKey = $options['api_key'] ?? '';
|
||||
$storeId = $options['store_id'] ?? '';
|
||||
$secret = $options['secret'] ?? '';
|
||||
$invoiceAlert = (bool) ($options['invoice_alert'] ?? false);
|
||||
|
||||
$host = $options['host'] = rtrim($host, '/');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user