Skip to content

Commit

Permalink
Revert "Merge pull request #421 from Billmate/WPM-126"
Browse files Browse the repository at this point in the history
This reverts commit 82cd5ef, reversing
changes made to ec592ea.
  • Loading branch information
Mattias Nilsson committed Mar 30, 2020
1 parent 5b9594d commit 81d452f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
24 changes: 1 addition & 23 deletions src/class-billmate-common.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ public function page_init() {
'billmate_common_activateonstatus',
array($this, 'sanitize')
);
register_setting(
'billmate_common',
'billmate_common_cancelonstatus',
array($this, 'sanitize')
);
register_setting(
'billmate_common',
'billmate_common_enable_overlay',
Expand Down Expand Up @@ -240,13 +235,6 @@ public function page_init() {
'billmate-settings',
'setting_credentials'
);
add_settings_field(
'billmate_common_cancelonstatus',
__('Enable crediting/cancelling of payments in Billmate Online', 'billmate'),
array($this, 'cancelonstatus_callback'),
'billmate-settings',
'setting_credentials'
);
add_settings_field(
'billmate_common_logo',
__('Logo to be displayed in the invoice', 'billmate'),
Expand Down Expand Up @@ -286,16 +274,6 @@ public function activateonstatus_callback() {
echo '</select>';
}

public function cancelonstatus_callback() {
$value = get_option('billmate_common_cancelonstatus', '');
$inactive = ($value == 'inactive') ? 'selected="selected"' : '';
$active = ($value == 'active') ? 'selected="selected"' : '';
echo '<select name="billmate_common_cancelonstatus" id="billmate_common_cancelonstatus">';
echo '<option value="inactive"' . $inactive . '>' . __('Inactive', 'billmate') . '</option>';
echo '<option value="active"' . $active . '>' . __('Active', 'billmate') . '</option>';
echo '</select>';
}

public function getaddress_callback()
{
$value = get_option('billmate_common_getaddress','');
Expand Down Expand Up @@ -449,4 +427,4 @@ public function verify_credentials() {
echo json_encode($response);
wp_die();
}
}
}
4 changes: 2 additions & 2 deletions src/commonfunctions.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function cancel_billmate_order($order_id, $action = false){
$order = wc_get_order($order_id);
$method = $order->get_payment_method();
if (strpos(strtolower($method), 'billmate') !== false) {
if (get_option('billmate_common_cancelonstatus') == 'active') {
if (get_option('billmate_common_activateonstatus') == 'active') {
$number = get_post_meta($order_id, 'billmate_invoice_id', true);
$hasBeenActivated = get_post_meta($order_id, 'order_has_been_activated', true);
if ($hasBeenActivated == "") {
Expand Down Expand Up @@ -165,7 +165,7 @@ function credit_billmate_order($order_id, $action = false, $isCancel = false){
}
}
if (!$isPartial) {
if (get_option('billmate_common_cancelonstatus') == 'active') {
if (get_option('billmate_common_activateonstatus') == 'active') {
if ($number !== null) {
$paymentMethod = get_post_meta($order_id, '_payment_method');
$methodClass = false;
Expand Down
Binary file modified src/languages/billmate-sv_SE.mo
Binary file not shown.
3 changes: 0 additions & 3 deletions src/languages/billmate-sv_SE.po
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

msgid "Enable crediting/cancelling of payments in Billmate Online"
msgstr "Aktivera kreditering/markulering av betalningar i Billmate Online"

msgid "Error: Can't cancel Billmate invoice %s, Unknown Method."
msgstr "Fel: Kan inte avbryta beställningen Billmate faktura %s, okänd metod."

Expand Down

0 comments on commit 81d452f

Please sign in to comment.