Skip to content

Commit 2ca24ae

Browse files
committed
Block form without public key modifications
1 parent 58a8f30 commit 2ca24ae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

admin/class-paystack-forms-admin.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ function kkd_pff_paystack_txncheck($name,$txncharge){
3131
}
3232
function kkd_pff_paystack_setting_page() {
3333
?>
34-
<h1>Paystack Forms API KEYS Settings!</h1>
34+
<h1>Paystack Forms API keys settings</h1>
3535

36-
<h4>Optional: To avoid situations where bad network makes it impossible to verify transactions, set your webhook URL <a href="https://dashboard.paystack.co/#/settings/developer">here</a> to the URL below<strong style="color: red"><pre><code><?php echo admin_url("admin-ajax.php") . "?action=kkd_paystack_pff";?></code></pre></strong></h4>
36+
<!-- <h4>Optional: To avoid situations where bad network makes it impossible to verify transactions, set your webhook URL <a href="https://dashboard.paystack.co/#/settings/developer">here</a> to the URL below<strong style="color: red"><pre><code><?php echo admin_url("admin-ajax.php") . "?action=kkd_paystack_pff";?></code></pre></strong></h4> -->
37+
<h3>Get your api keys <a href="https://dashboard.paystack.co/#/settings/developer" target="_blank">here</a> </h4>
3738
<form method="post" action="options.php">
3839
<?php settings_fields( 'kkd-pff-paystack-settings-group' ); do_settings_sections( 'kkd-pff-paystack-settings-group' ); ?>
3940
<table class="form-table paystack_setting_page">
@@ -42,8 +43,8 @@ function kkd_pff_paystack_setting_page() {
4243

4344
<td>
4445
<select class="form-control" name="mode" id="parent_id">
45-
<option value="live" <?php echo kkd_pff_paystack_txncheck('live',esc_attr( get_option('mode') )) ?>>Live Mode</option>
4646
<option value="test" <?php echo kkd_pff_paystack_txncheck('test',esc_attr( get_option('mode') )) ?>>Test Mode</option>
47+
<option value="live" <?php echo kkd_pff_paystack_txncheck('live',esc_attr( get_option('mode') )) ?>>Live Mode</option>
4748
</select>
4849
</tr>
4950
<tr valign="top">

public/class-paystack-forms-public.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ function kkd_pff_paystack_form_shortcode($atts) {
696696
), $atts));
697697
$pk = Kkd_Pff_Paystack_Public::fetchPublicKey();
698698
if(!$pk){
699-
echo "<h5>You must set your Paystack API keys to receive payments</h5>";
699+
$settingslink = get_admin_url().'edit.php?post_type=paystack_form&page=class-paystack-forms-admin.php';
700+
echo "<h5>You must set your Paystack API keys first <a href='".$settingslink."'>settings</a></h5>";
700701
}
701702
else if ($id != 0) {
702703
$obj = get_post($id);

0 commit comments

Comments
 (0)