Compare commits

..

No commits in common. "main" and "v2.0.3" have entirely different histories.
main ... v2.0.3

View File

@ -38,7 +38,7 @@ class BTCPayServer extends AbstractProvider
$purchaseRequest->fastUpdate('provider_metadata', $invoice->getId());
$scriptUrl = $this->modalJsUrl($purchaseRequest->PaymentProfile);
$scriptUrl = $purchaseRequest->PaymentProfile->options['host'] . '/modal/btcpay.js';
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 = $this->modalJsUrl($paymentProfile);
$scriptUrl = $purchaseRequest->PaymentProfile->options['host'] . '/modal/btcpay.js';
return $controller->view(
'BS\BtcPayServer:Initiate\BTCPayServer',
@ -72,11 +72,6 @@ class BTCPayServer extends AbstractProvider
);
}
protected function modalJsUrl(PaymentProfile $paymentProfile): string
{
return $paymentProfile->options['host'].'/modal/btcpay.js';
}
protected function sendAlertWithInvoice(
Purchase $purchase,
InvoiceResult $invoice,
@ -125,7 +120,6 @@ class BTCPayServer extends AbstractProvider
[
'request_key' => $purchaseRequest->request_key,
'purchase_request_id' => $purchaseRequest->purchase_request_id,
'itemDesc' => $purchase->title,
],
$checkoutOptions
);
@ -254,6 +248,7 @@ 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, '/');