Skip to content

Commit

Permalink
Added support for ZAR currency, and changed the ID of the plugin for …
Browse files Browse the repository at this point in the history
…the plugin tracker
  • Loading branch information
whales-paystack committed Jan 22, 2021
1 parent 990b292 commit 55a5a94
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
8 changes: 7 additions & 1 deletion class-gf-paystack-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ public function __construct($config)
public function log_transaction_success($reference)
{
// Send reference to logger along with plugin name and public key
// $params = [
// 'plugin_name' => $this->plugin_name,
// 'public_key' => $this->public_key,
// 'transaction_reference' => $reference
// ];

$params = [
'plugin_name' => $this->plugin_name,
'plugin_name' => 'pstk-gravityforms',
'public_key' => $this->public_key,
'transaction_reference' => $reference
];
Expand Down
36 changes: 35 additions & 1 deletion class-gf-paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,16 @@ public function redirect_url($feed, $submission_data, $form, $entry)
// Get feed custom metadata
$custom_data = $this->get_paystack_meta_data($feed, $entry, $form);

// $custom_data[] = [
// 'display_name' => 'Plugin Name',
// 'variable_name' => 'plugin_name',
// 'value' => $this->paystack_api->plugin_name
// ];

$custom_data[] = [
'display_name' => 'Plugin Name',
'variable_name' => 'plugin_name',
'value' => $this->paystack_api->plugin_name
'value' => 'pstk-gravityforms'
];

// Generate transaction reference
Expand Down Expand Up @@ -1938,6 +1944,34 @@ public function add_paystack_currencies($currencies)
);
}

// Check if the currency is already registered.
if (!array_key_exists('ZAR', $currencies)) {
// Add GHS to the list of supported currencies.
$currencies['ZAR'] = array(
'name' => 'South Africa Rand',
'symbol_left' => 'R',
'symbol_right' => '',
'symbol_padding' => ' ',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 2
);
}

// Check if the currency is already registered.
if (!array_key_exists('USD', $currencies)) {
// Add GHS 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
);
}

return $currencies;
}

Expand Down
2 changes: 1 addition & 1 deletion paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Paystack Add-On for Gravity Forms
Plugin URI: https://paystack.com/docs/libraries-and-plugins/plugins#wordpress
Description: Integrates Gravity Forms with Paystack, enabling end users to purchase goods and services through Gravity Forms.
Version: 1.0.0
Version: 1.0.1
Author: Paystack
Author URI: https://developers.paystack.com
License: GPL-2.0+
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: payments, subscriptions, gravityforms
Requires at least: 5.1
Tested up to: 5.6
Requires PHP: 7.2
Stable tag: 1.0.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

0 comments on commit 55a5a94

Please sign in to comment.