Update class-monero-gateway.php

This commit is contained in:
itssteven 2019-01-12 08:57:50 +00:00 committed by SerHack
parent 8e7d258b5b
commit 21df86e4b8
1 changed files with 3 additions and 3 deletions

View File

@ -401,15 +401,15 @@ class Monero_Gateway extends WC_Payment_Gateway
} }
} }
protected static function check_payment_rpc($payment_id) protected static function check_payment_rpc($subaddress)
{ {
$txs = array(); $txs = array();
$address_index = self::$monero_wallet_rpc->get_address_index($payment_id); $address_index = self::$monero_wallet_rpc->get_address_index($subaddress);
if(isset($address_index['index']['minor'])){ if(isset($address_index['index']['minor'])){
$address_index = $address_index['index']['minor']; $address_index = $address_index['index']['minor'];
} }
else { else {
self::$log->add('Monero_Gateway', '[ERROR] Couldn\'t get address index of subaddress: ' . $payment_id); self::$log->add('Monero_Gateway', '[ERROR] Couldn\'t get address index of subaddress: ' . $subaddress);
return $txs; return $txs;
} }
$payments = self::$monero_wallet_rpc->get_transfers(array( 'in' => true, 'pool' => true, 'subaddr_indices' => array($address_index))); $payments = self::$monero_wallet_rpc->get_transfers(array( 'in' => true, 'pool' => true, 'subaddr_indices' => array($address_index)));