Skip to content

Commit 55a5a94

Browse files
Added support for ZAR currency, and changed the ID of the plugin for the plugin tracker
1 parent 990b292 commit 55a5a94

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

class-gf-paystack-api.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ public function __construct($config)
2727
public function log_transaction_success($reference)
2828
{
2929
// Send reference to logger along with plugin name and public key
30+
// $params = [
31+
// 'plugin_name' => $this->plugin_name,
32+
// 'public_key' => $this->public_key,
33+
// 'transaction_reference' => $reference
34+
// ];
35+
3036
$params = [
31-
'plugin_name' => $this->plugin_name,
37+
'plugin_name' => 'pstk-gravityforms',
3238
'public_key' => $this->public_key,
3339
'transaction_reference' => $reference
3440
];

class-gf-paystack.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,10 +928,16 @@ public function redirect_url($feed, $submission_data, $form, $entry)
928928
// Get feed custom metadata
929929
$custom_data = $this->get_paystack_meta_data($feed, $entry, $form);
930930

931+
// $custom_data[] = [
932+
// 'display_name' => 'Plugin Name',
933+
// 'variable_name' => 'plugin_name',
934+
// 'value' => $this->paystack_api->plugin_name
935+
// ];
936+
931937
$custom_data[] = [
932938
'display_name' => 'Plugin Name',
933939
'variable_name' => 'plugin_name',
934-
'value' => $this->paystack_api->plugin_name
940+
'value' => 'pstk-gravityforms'
935941
];
936942

937943
// Generate transaction reference
@@ -1938,6 +1944,34 @@ public function add_paystack_currencies($currencies)
19381944
);
19391945
}
19401946

1947+
// Check if the currency is already registered.
1948+
if (!array_key_exists('ZAR', $currencies)) {
1949+
// Add GHS to the list of supported currencies.
1950+
$currencies['ZAR'] = array(
1951+
'name' => 'South Africa Rand',
1952+
'symbol_left' => 'R',
1953+
'symbol_right' => '',
1954+
'symbol_padding' => ' ',
1955+
'thousand_separator' => ',',
1956+
'decimal_separator' => '.',
1957+
'decimals' => 2
1958+
);
1959+
}
1960+
1961+
// Check if the currency is already registered.
1962+
if (!array_key_exists('USD', $currencies)) {
1963+
// Add GHS to the list of supported currencies.
1964+
$currencies['USD'] = array(
1965+
'name' => 'United States Dollar',
1966+
'symbol_left' => '$',
1967+
'symbol_right' => '',
1968+
'symbol_padding' => ' ',
1969+
'thousand_separator' => ',',
1970+
'decimal_separator' => '.',
1971+
'decimals' => 2
1972+
);
1973+
}
1974+
19411975
return $currencies;
19421976
}
19431977

paystack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Paystack Add-On for Gravity Forms
44
Plugin URI: https://paystack.com/docs/libraries-and-plugins/plugins#wordpress
55
Description: Integrates Gravity Forms with Paystack, enabling end users to purchase goods and services through Gravity Forms.
6-
Version: 1.0.0
6+
Version: 1.0.1
77
Author: Paystack
88
Author URI: https://developers.paystack.com
99
License: GPL-2.0+

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: payments, subscriptions, gravityforms
55
Requires at least: 5.1
66
Tested up to: 5.6
77
Requires PHP: 7.2
8-
Stable tag: 1.0.0
8+
Stable tag: 1.0.1
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

0 commit comments

Comments
 (0)