Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
446f102455 | ||
|
|
6056be8cff |
@ -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,
|
||||
@ -120,6 +125,7 @@ class BTCPayServer extends AbstractProvider
|
||||
[
|
||||
'request_key' => $purchaseRequest->request_key,
|
||||
'purchase_request_id' => $purchaseRequest->purchase_request_id,
|
||||
'itemDesc' => $purchase->title,
|
||||
],
|
||||
$checkoutOptions
|
||||
);
|
||||
@ -248,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