summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-13 00:13:41 +0200
committerChristian Grothoff <christian@grothoff.org>2020-10-13 00:13:41 +0200
commit9be6e8e5440b95f3ba46a5b7b2635ac71321611a (patch)
tree65b65f848c621a38aaad391bc9a00ba4080b6616
parentcc3d34d9b3aa04a01d8cda6452626920533e8c19 (diff)
downloadwoocommerce-taler-9be6e8e5440b95f3ba46a5b7b2635ac71321611a.tar.gz
woocommerce-taler-9be6e8e5440b95f3ba46a5b7b2635ac71321611a.tar.bz2
woocommerce-taler-9be6e8e5440b95f3ba46a5b7b2635ac71321611a.zip
add refund_delay option
-rw-r--r--plugin/GNU-Taler-Payment-Gateway/class-wc-gnutaler-gateway.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugin/GNU-Taler-Payment-Gateway/class-wc-gnutaler-gateway.php b/plugin/GNU-Taler-Payment-Gateway/class-wc-gnutaler-gateway.php
index 8454636..74cde71 100644
--- a/plugin/GNU-Taler-Payment-Gateway/class-wc-gnutaler-gateway.php
+++ b/plugin/GNU-Taler-Payment-Gateway/class-wc-gnutaler-gateway.php
@@ -171,6 +171,12 @@ function gnutaler_init_gateway_class()
'description' => __( 'Set the text the customer will see when confirming payment. %s will be substituted with the order number. (Example: MyShop #%s)', 'gnutaler' ),
'default' => 'WooTalerShop #%s',
),
+ 'GNU_Taler_refund_delay' => array(
+ 'title' => __( 'How long should refunds be possible', 'gnutaler' ),
+ 'type' => 'number',
+ 'description' => __( 'Set the number of days a customer has to request a refund', 'gnutaler' ),
+ 'default' => '14',
+ ),
'debug' => array(
'title' => __( 'Debug Log', 'woocommerce' ),
'label' => __( 'Enable logging', 'woocommerce' ),
@@ -601,6 +607,7 @@ function gnutaler_init_gateway_class()
$wc_cart = WC()->cart->get_cart();
$wc_order_id = $wc_order->get_order_key() . '-' . $wc_order->get_order_number();
$wc_order_products_array = $this->mutate_products_to_json_format( $wc_cart, $wc_order_currency, $wc_order );
+ $refund_delay = $this->get_option( 'GNU_Taler_refund_delay' );
$order_json = array(
'order' => array(
'amount' => $wc_order_currency . ':' . $wc_order_total_amount,
@@ -619,6 +626,12 @@ function gnutaler_init_gateway_class()
'delivery_location' => $this->mutate_shipping_information_to_json_format( $wc_order ),
),
);
+ if (isset ($refund_delay))
+ {
+ $order_json['refund_delay'] = array (
+ 'd_ms' => $refund_delay)
+ );
+ }
return $order_json;
}