Skip to content

Commit

Permalink
Merge pull request #5 from petzsch/fix-payment-methods
Browse files Browse the repository at this point in the history
add lightning and all options to payment-methods
  • Loading branch information
ChristianGabs authored Jul 29, 2024
2 parents c074e78 + c71504a commit 4de8ca5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/BTCPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ public static function getConfig(): array
'select',
[
'multiOptions' => [
"BTC" => "BTC",
"LTC" => "LTC",
"DASH" => "DASH",
"BTC,LTC" => "BTC-LTC",
"BTC,DASH" => "BTC-DASH",
"LTC,DASH" => "LTC-DASH",
"BTC,LTC,DASH" => "BTC-LTC-DASH",
"ALL" => "ALL",
"BTC_LightningLike" => "BTC (Lightning)",
"BTC" => "BTC",
"LTC" => "LTC",
"DASH" => "DASH",
"BTC,LTC" => "BTC-LTC",
"BTC,DASH" => "BTC-DASH",
"LTC,DASH" => "LTC-DASH",
"BTC,LTC,DASH" => "BTC-LTC-DASH",
],
'label' => 'Payment method :',
],
Expand Down Expand Up @@ -285,7 +287,7 @@ protected function _generateForm(Model_Invoice $invoice): string
$checkoutOptions = new InvoiceCheckoutOptions();
$checkoutOptions
->setSpeedPolicy(constant(get_class($checkoutOptions).'::'.$this->config['policy_speed'] ?? "SPEED_HIGH"))
->setPaymentMethods(explode(",", $this->config['payment_method']))
->setPaymentMethods(($this->config['payment_method'] == 'ALL') ? null : explode(",", $this->config['payment_method']))
->setRedirectURL($this->di['tools']->url('invoice/'.$invoice->hash));
$request = $this->btcpay->createInvoice(
$this->config['store_id'],
Expand Down

0 comments on commit 4de8ca5

Please sign in to comment.