Skip to content

Commit 694df0d

Browse files
committed
Bug fixes
1 parent ce61852 commit 694df0d

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

admin/class-paystack-forms-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function kkd_pff_paystack_setting_page() {
3333
?>
3434
<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></
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>
3737
<form method="post" action="options.php">
3838
<?php settings_fields( 'kkd-pff-paystack-settings-group' ); do_settings_sections( 'kkd-pff-paystack-settings-group' ); ?>
3939
<table class="form-table paystack_setting_page">

public/class-paystack-forms-public.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ function kkd_pff_paystack_send_receipt_owner($id,$currency,$amount,$name,$email,
647647
ob_end_clean();
648648
$admin_email = get_option('admin_email');
649649
$website = get_option('blogname');
650-
$headers = array("From: $website <$admin_email>" . "\r\n");
650+
// $headers = array("From: $website <$admin_email>" . "\r\n");
651651
$headers = "From: ".$website."<$admin_email>" . "\r\n";
652652
wp_mail($admin_email, $email_subject, $message,$headers);
653653

@@ -1233,16 +1233,17 @@ function kkd_pff_paystack_submit_action() {
12331233
);
12341234
$exist = $wpdb->get_results("SELECT * FROM $table WHERE (post_id = '".$insert['post_id']."'
12351235
AND email = '".$insert['email']."'
1236-
AND user_id = '".$insert['pf-user_id']."'
1236+
AND user_id = '".$insert['user_id']."'
12371237
AND amount = '".$insert['amount']."'
12381238
AND plan = '".$insert['plan']."'
12391239
AND ip = '".$insert['ip']."'
12401240
AND paid = '0'
12411241
AND metadata = '". $insert['metadata'] ."')");
12421242
if (count($exist) > 0) {
1243-
$insert['txn_code'] = $exist[0]->txn_code;
1244-
$insert['plan'] = $exist[0]->plan;
1245-
1243+
// $insert['txn_code'] = $code;
1244+
// $insert['plan'] = $exist[0]->plan;
1245+
$wpdb->update( $table, array( 'txn_code' => $code,'plan' =>$insert['plan']),array('id'=>$exist[0]->id));
1246+
12461247
} else {
12471248
$wpdb->insert(
12481249
$table,
@@ -1401,6 +1402,9 @@ function kkd_pff_paystack_confirm_payment() {
14011402
$result = "failed";
14021403
}
14031404

1405+
}else{
1406+
$message = "Payment Verifiction Failed";
1407+
$result = "failed";
14041408
}
14051409
}else{
14061410
$message = "Payment Verification Failed.";

0 commit comments

Comments
 (0)