Skip to content

Commit

Permalink
v2.0.7 - Fixed quantity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kendysond committed Mar 11, 2017
1 parent 249f6dc commit 57421e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions README.txt
@@ -1,10 +1,10 @@
=== Payment forms for Paystack ===
Contributors: kendysond
Donate link: https://paystack.com/demo
Tags: paystack, recurrent payments, nigeria, mastercard, visa, target,Naira,payments,verve
Tags: paystack, recurrent payments, nigeria, mastercard, visa, target,Naira,payments,verve,donation,church,NGO,form,contact form 7, form,
Requires at least: 3.1
Tested up to: 4.7
Stable tag: 2.0.6
Stable tag: 2.0.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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


== Changelog ==
= 2.0.7 =
* Bug fixes for quantity.
= 2.0.6 =
* Set transaction_charge for sub account implementation
* Copyable shortcode on admin form page
Expand Down
2 changes: 1 addition & 1 deletion admin/class-paystack-forms-admin.php
Expand Up @@ -427,7 +427,7 @@ function kkd_pff_paystack_editor_add_agreement_data() {
if ($useagreement == "") {$useagreement = 'no';}
if ($agreementlink == "") {$agreementlink = '';}
// Echo out the field
echo '<small>Allow your users pay in multiple quantity</small><p>Use agreement checkbox:</p>';
echo '<p>Use agreement checkbox:</p>';
echo '<select class="form-control" name="_useagreement" style="width:100%;">
<option value="no" '.kkd_pff_paystack_txncheck('no',$useagreement).'>No</option>
<option value="yes" '.kkd_pff_paystack_txncheck('yes',$useagreement).'>Yes</option>
Expand Down
2 changes: 1 addition & 1 deletion paystack-forms.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Payment forms for Paystack
Plugin URI: https://github.com/Kendysond/Wordpress-paystack-forms
Description: Payment forms for Paystack allows you create forms that will be used to bill clients for goods and services via Paystack.
Version: 2.0.6
Version: 2.0.7
Author: Douglas Kendyson
Author URI: http://kendyson.com
License: GPL-2.0+
Expand Down
16 changes: 11 additions & 5 deletions public/class-paystack-forms-public.php
Expand Up @@ -737,7 +737,7 @@ function kkd_pff_paystack_form_shortcode($atts) {

echo "<h1 id='pf-form".$id."'>".$obj->post_title."</h1>";
// echo get_site_url().'/paystackinvoice/?code=ddddddd';
echo '<form enctype="multipart/form-data" action="' . admin_url('admin-ajax.php') . '" url="' . admin_url() . '" method="post" class="paystack-form j-forms" novalidate>
echo '<form version="2.0.7" enctype="multipart/form-data" action="' . admin_url('admin-ajax.php') . '" url="' . admin_url() . '" method="post" class="paystack-form j-forms" novalidate>
<div class="j-row">';
echo '<input type="hidden" name="action" value="kkd_pff_paystack_submit_action">';
echo '<input type="hidden" name="pf-id" value="' . $id . '" />';
Expand Down Expand Up @@ -1419,20 +1419,26 @@ function kkd_pff_paystack_confirm_payment() {
}else{
$usequantity = get_post_meta($payment_array->post_id,'_usequantity',true);
if ($usequantity == 'no') {
$amount = (int)str_replace(' ', '', $amount);
$oamount = (int)str_replace(' ', '', $amount);
}else{
$quantity = $_POST["quantity"];
$unitamount = (int)str_replace(' ', '', $amount);
$amount = $quantity*$unitamount;
$oamount = $quantity*$unitamount;



}
if ($txncharge == 'customer') {
$oamount = kkd_pff_paystack_add_paystack_charge($oamount);
}


// if ($txncharge == 'customer') {
// $amount = kkd_pff_paystack_add_paystack_charge($amount);
// }
if( $oamount != $amount_paid ) {
echo $amount. ' - '.$amount_paid;
$message = "Invalid amount Paid. Amount required is ".$currency."<b>".number_format($amount)."</b>";
echo $oamount. ' - '.$amount_paid;
$message = "Invalid amount Paid. Amount required is ".$currency."<b>".number_format($oamount)."</b>";
$result = "failed";
}else{

Expand Down

0 comments on commit 57421e1

Please sign in to comment.