summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}