Skip to content

Commit ce61852

Browse files
committed
v2.0.3
1 parent 51eae9c commit ce61852

11 files changed

Lines changed: 258 additions & 110 deletions

README.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Contributors: kendysond
33
Donate link: https://paystack.com/demo
44
Tags: paystack, recurrent payments, nigeria, mastercard, visa, target,Naira,payments,verve
55
Requires at least: 3.1
6-
Tested up to: 4.6.1
7-
Stable tag: 2.0.2
6+
Tested up to: 4.7
7+
Stable tag: 2.0.3
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -84,6 +84,9 @@ You can also follow us on Twitter! **[@paystack](http://twitter.com/paystack)**
8484

8585

8686
== Changelog ==
87+
= 2.0.3 =
88+
* Send email notification to merchant for every payment.
89+
* Export payment data to CSV.
8790
= 2.0.2 =
8891
* Price calculation and bug fixes.
8992
= 2.0.1 =

banner-772x250.png

-1.71 KB
Loading

icon-256x256.png

-1.1 KB
Loading

icon.png

5.2 KB
Loading

images/logo.png

-1.38 KB
Loading

images/logos@2x.png

24.6 KB
Loading

includes/paystack-invoice.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
2-
require_once('../../../../wp-load.php');
2+
// $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
3+
// require_once( $parse_uri[0] . 'wp-load.php' );
4+
require_once(ABSPATH.'wp-load.php');
35

46
$code = @$_GET['code'];
57
function kkd_format_metadata($data){

includes/paystack-webhook.php

Lines changed: 0 additions & 87 deletions
This file was deleted.

paystack-forms.php

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Payment forms for Paystack
44
Plugin URI: https://github.com/Kendysond/Wordpress-paystack-forms
55
Description: Payment forms for Paystack allows you create forms that will be used to bill clients for goods and services via Paystack.
6-
Version: 2.0.1
6+
Version: 2.0.3
77
Author: Douglas Kendyson
88
Author URI: http://kendyson.com
99
License: GPL-2.0+
@@ -15,7 +15,7 @@
1515
}
1616
define( 'KKD_PFF_PAYSTACK_PLUGIN_PATH', plugins_url( __FILE__ ) );
1717
define( 'KKD_PFF_PAYSTACK_MAIN_FILE', __FILE__ );
18-
define( 'KKD_PFF_PAYSTACK_VERSION', '2.0.0' );
18+
define( 'KKD_PFF_PAYSTACK_VERSION', '2.0.4' );
1919
define( 'KKD_PFF_PAYSTACK_TABLE', 'paystack_forms_payments' );
2020

2121

@@ -149,22 +149,54 @@ function insertSelectCountries(){
149149
<?php
150150
}
151151
}
152-
add_action( 'init', 'kkd_pff_paystack_invoice_url_rewrite' );
153-
function kkd_pff_paystack_invoice_url_rewrite(){
154-
global $wp_rewrite;
155-
$plugin_url = plugins_url( 'includes/paystack-invoice.php', __FILE__ );
156-
$plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 );
157-
$wp_rewrite->non_wp_rules['paystackinvoice$'] = $plugin_url;
158-
$wp_rewrite->non_wp_rules['paystackinvoice/$'] = $plugin_url;
159-
file_put_contents(ABSPATH.'.htaccess', $wp_rewrite->mod_rewrite_rules() );
152+
// add_action( 'init', 'kkd_pff_paystack_invoice_url_rewrite' );
153+
// function kkd_pff_paystack_invoice_url_rewrite(){
154+
// global $wp_rewrite;
155+
// $plugin_url = plugins_url( 'includes/paystack-invoice.php', __FILE__ );
156+
// $plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 );
157+
// $wp_rewrite->non_wp_rules['paystackinvoice$'] = $plugin_url; WP_PLUGIN_URL . '/data-fetcher/list-data.php'
158+
// $wp_rewrite->non_wp_rules['paystackinvoice/$'] = $plugin_url;
159+
// file_put_contents(ABSPATH.'.htaccess', $wp_rewrite->mod_rewrite_rules() );
160+
// }
161+
// add_action( 'init', 'my_rewrite' );
162+
// function my_rewrite() {
163+
// global $wp_rewrite;
164+
// add_rewrite_rule('paystackinvoice$', KKD_PFF_PAYSTACK_PLUGIN_PATH. 'includes/paystack-invoice.php', 'top');
165+
// add_rewrite_rule('paystackinvoice/$', KKD_PFF_PAYSTACK_PLUGIN_PATH. 'includes/paystack-invoice.php', 'top');
166+
// // add_rewrite_rule('paystackinvoice/$', plugins_url( 'includes/paystack-invoice.php', __FILE__ ), 'top');
167+
// $wp_rewrite->flush_rules(true); // This should really be done in a plugin activation
168+
// }
169+
170+
add_action( 'init', 'kkd_pff_init' );
171+
function kkd_pff_init() {
172+
add_rewrite_rule( '^paystackinvoice$', 'index.php?kkd_pff_stats=true', 'top' );
160173
}
161174

162-
add_action( 'init', 'kkd_pff_paystack_webhook_url_rewrite' );
163-
function kkd_pff_paystack_webhook_url_rewrite(){
164-
global $wp_rewrite;
165-
$plugin_url = plugins_url( 'includes/paystack-webhook.php', __FILE__ );
166-
$plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 );
167-
$wp_rewrite->non_wp_rules['kkd_wppf_webhoook$'] = $plugin_url;
168-
$wp_rewrite->non_wp_rules['kkd_wppf_webhoook/$'] = $plugin_url;
169-
file_put_contents(ABSPATH.'.htaccess', $wp_rewrite->mod_rewrite_rules() );
170-
}
175+
// But WordPress has a whitelist of variables it allows, so we must put it on that list
176+
add_action( 'query_vars', 'kkd_pff_query_vars' );
177+
function kkd_pff_query_vars( $query_vars )
178+
{
179+
$query_vars[] = 'kkd_pff_stats';
180+
return $query_vars;
181+
}
182+
183+
// If this is done, we can access it later
184+
// This example checks very early in the process:
185+
// if the variable is set, we include our page and stop execution after it
186+
add_action( 'parse_request', 'kkd_pff_parse_request' );
187+
function kkd_pff_parse_request( &$wp )
188+
{
189+
if ( array_key_exists( 'kkd_pff_stats', $wp->query_vars ) ) {
190+
include( dirname( __FILE__ ) . '/includes/paystack-invoice.php' );
191+
exit();
192+
}
193+
}
194+
// add_action( 'init', 'kkd_pff_paystack_webhook_url_rewrite' );
195+
// function kkd_pff_paystack_webhook_url_rewrite(){
196+
// global $wp_rewrite;
197+
// $plugin_url = plugins_url( 'includes/paystack-webhook.php', __FILE__ );
198+
// $plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 );
199+
// $wp_rewrite->non_wp_rules['kkd_wppf_webhoook$'] = $plugin_url;
200+
// $wp_rewrite->non_wp_rules['kkd_wppf_webhoook/$'] = $plugin_url;
201+
// file_put_contents(ABSPATH.'.htaccess', $wp_rewrite->mod_rewrite_rules() );
202+
// }

0 commit comments

Comments
 (0)