diff --git a/woocommerce-gateway-lightning.php b/woocommerce-gateway-lightning.php index 3833cb0..3b97f3a 100755 --- a/woocommerce-gateway-lightning.php +++ b/woocommerce-gateway-lightning.php @@ -99,6 +99,13 @@ public function init_form_fields() { 'default' => 'You will pay using the Lightning Network.', 'desc_tip' => true, ), + 'invoice_expiry' => array( + 'title' => __('Invoice Expiry', 'lightning'), + 'type' => 'text', + 'description' => __('Time til an invoice expires. Examples: 2w (2 weeks), 1m (1 month), 3h (3 hours), 3600s (3600 seconds). Defaults to 2h.', 'lightning'), + 'default' => '2h', + 'desc_tip' => true, + ), ); } @@ -116,6 +123,7 @@ public function process_payment( $order_id ) { 'currency' => $order->get_currency(), 'amount' => $order->get_total(), 'description' => self::make_desc($order), + 'expiry' => $this->get_option('invoice_expiry', '2h'), 'metadata' => [ 'source' => 'woocommerce-gateway', 'order_id' => $order->get_id(), 'url' => get_home_url() ], 'webhook' => self::get_webhook_url($order->get_id()) ]);