From 73f983e2c8b38239b1f1d695a57845d945d45404 Mon Sep 17 00:00:00 2001 From: cryptochangements34 Date: Sat, 19 Aug 2017 10:45:57 -0500 Subject: [PATCH 1/2] Add color to verifypayment message based on status Unconfirmed will make it red, confirmed will make it green. This is to add visibility for people that dont know that much about crypto-currencies --- monero/include/monero_payments.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index 68e9b35..3beb527 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -4,6 +4,7 @@ class Monero_Gateway extends WC_Payment_Gateway { private $reloadTime = 30000; private $discount; + private $confirmed = false; private $monero_daemon; function __construct() { @@ -301,7 +302,13 @@ public function add_my_currency_symbol( $currency_symbol, $currency ) { $array_integrated_address["integrated_address"] = $address; } $message = $this->verify_payment($payment_id, $amount_xmr2, $order); - echo "

".$message."

"; + if($this->confirmed){ + $color = "green"; + } + else{ + $color = "red"; + } + echo "

".$message."

"; echo ""; echo "
@@ -380,7 +387,7 @@ public function add_my_currency_symbol( $currency_symbol, $currency ) { { $message = "Payment has been received and confirmed. Thanks!"; $this->log->add('Monero_gateway','[SUCCESS] Payment has been recorded. Congrats!'); - $paid = true; + $this->confirmed = true; $order = wc_get_order($order_id); $order->update_status('completed', __('Payment has been received', 'monero_gateway')); global $wpdb; From 387f653b23462cfbfa58feed4693ee8c07b56883 Mon Sep 17 00:00:00 2001 From: cryptochangements34 Date: Sat, 19 Aug 2017 10:57:08 -0500 Subject: [PATCH 2/2] Update colors --- 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 3beb527..cff05fa 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -302,11 +302,11 @@ public function add_my_currency_symbol( $currency_symbol, $currency ) { $array_integrated_address["integrated_address"] = $address; } $message = $this->verify_payment($payment_id, $amount_xmr2, $order); - if($this->confirmed){ - $color = "green"; + if(!$this->confirmed){ + $color = "006400"; } else{ - $color = "red"; + $color = "DC143C"; } echo "

".$message."

"; echo "";