From 5e9bc4b0e8fcb1fb435ccb5299afa7ffb8dfab89 Mon Sep 17 00:00:00 2001 From: cryptochangements34 Date: Thu, 17 Aug 2017 19:50:14 -0500 Subject: [PATCH] Fixes payment verification Fixes problem with SQL query after payment is verified (already fixed on master) and also makes fixes to work with WordPress HTTP API instead of cURL --- monero/include/monero_payments.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index c5da38f..79c07cf 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -374,16 +374,16 @@ public function add_my_currency_symbol( $currency_symbol, $currency ) { $amount_atomic_units = $amount * 1000000000000; $get_payments_method = $this->monero_daemon->get_payments($payment_id); - if(isset($get_payments_method["payments"][0]["amount"])) + if(isset($get_payments_method['result']["payments"]["0"]["amount"])) { - if($get_payments_method["payments"][0]["amount"] >= $amount_atomic_units) + if($get_payments_method['result']["payments"][0]["amount"] >= $amount_atomic_units) { $message = "Payment has been received and confirmed. Thanks!"; $this->log->add('Monero_gateway','[SUCCESS] Payment has been recorded. Congrats!'); $paid = true; $order = wc_get_order($order_id); $order->update_status('completed', __('Payment has been received', 'monero_gateway')); - + global $wpdb; $wpdb->query("DROP TABLE $payment_id"); // Drop the table from database after payment has been confirmed as it is no longer needed $this->reloadTime = 3000000000000; // Greatly increase the reload time as it is no longer needed