Skip to content

Commit ffd30a5

Browse files
committed
Fixed update query.
1 parent d4344f0 commit ffd30a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

public/class-paystack-forms-public.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function cf_shortcode($atts) {
179179
echo(do_shortcode($obj->post_content));
180180
// echo '<br /><p>Transaction charge:'.$currency.'<b class="txn_charge">13,000</b></p>';
181181
// echo '<p>Total charge:'.$currency.'<b class="total_charge">13,000</b></p>';
182-
echo '<p> <br /><input type="submit" value="'.$paybtn.'"></p>';
182+
echo '<p> <br /><input type="submit" class="btn btn-danger" value="'.$paybtn.'" ></p>';
183183
echo '</form>';
184184
# code...
185185
}else{
@@ -405,7 +405,7 @@ function paystack_confirm_payment() {
405405
$paystack_ref = $paystack_response->data->reference;
406406

407407
if ($amount == 0) {
408-
$wpdb->query($wpdb->prepare("UPDATE $table SET paid='1',amount='".$amount_paid."' WHERE txn_code='".$paystack_ref."'"));
408+
$wpdb->update( $table, array( 'paid' => 1,'amount' =>$amount_paid),array('txn_code'=>$paystack_ref));
409409
$thankyou = get_post_meta($payment_array->post_id,'_successmsg',true);
410410
$message = $thankyou;
411411
$result = "success";
@@ -415,7 +415,7 @@ function paystack_confirm_payment() {
415415
$result = "failed";
416416
}else{
417417

418-
$wpdb->query($wpdb->prepare("UPDATE $table SET paid='1' WHERE txn_code='".$paystack_ref."'"));
418+
$wpdb->update( $table, array( 'paid' => 1),array('txn_code'=>$paystack_ref));
419419
$thankyou = get_post_meta($payment_array->post_id,'_successmsg',true);
420420
$message = $thankyou;
421421
$result = "success";

0 commit comments

Comments
 (0)