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
This commit is contained in:
cryptochangements34 2017-08-19 10:45:57 -05:00 committed by GitHub
parent cc6dff2de7
commit 73f983e2c8
1 changed files with 9 additions and 2 deletions

View File

@ -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 "<h4>".$message."</h4>";
if($this->confirmed){
$color = "green";
}
else{
$color = "red";
}
echo "<h4><font color=$color>".$message."</font></h4>";
echo "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>";
echo "<div class='row'>
@ -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;