Skip to content

Commit

Permalink
Fixed warnings
Browse files Browse the repository at this point in the history
* BUG FIX: Removed warnings of missing 'code' for currency code when adding currency to Gravity Form options.

* ENHANCEMENT: Removed USD as this is redundant and exists by Gravity Forms default.
  • Loading branch information
andrewlimaza committed Apr 5, 2023
1 parent 694c8f2 commit 8079ea3
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions class-gf-paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,8 @@ public function add_paystack_currencies($currencies)
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
'decimals' => 2,
'code' => 'NGN'
);
}

Expand All @@ -1940,7 +1941,8 @@ public function add_paystack_currencies($currencies)
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
'decimals' => 2,
'code' => 'GHS'
);
}

Expand All @@ -1954,24 +1956,12 @@ public function add_paystack_currencies($currencies)
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
);
}

// Check if the currency is already registered.
if (!array_key_exists('USD', $currencies)) {
// Add USD to the list of supported currencies.
$currencies['USD'] = array(
'name' => 'United States Dollar',
'symbol_left' => '$',
'symbol_right' => '',
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
'decimals' => 2,
'code' => 'ZAR'
);
}


// Check if the currency is already registered.
if (!array_key_exists('KES', $currencies)) {
// Add KES to the list of supported currencies.
Expand All @@ -1982,7 +1972,8 @@ public function add_paystack_currencies($currencies)
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
'decimals' => 2,
'code' => 'KES'
);
}

Expand Down

0 comments on commit 8079ea3

Please sign in to comment.