-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp for PHP 8.x and Magento 2 #13
base: master
Are you sure you want to change the base?
Conversation
Hey sorry for the wait, but I didn't get any notifications about this :( Did you already try to run it? |
Hey!.. no worries.. yes, there shouldn't be a problem to run it in docker if you follow https://github.com/napoly/docker-monero-magento/tree/monero-integration?tab=readme-ov-file#manual-setup |
Controller/Gateway/MoneroPayment.php
Outdated
$xmr_subaddress = $this->monero_daemon->create_address(0); | ||
setcookie('xmr_subaddress', $xmr_subaddress['address'], time() + 2700); | ||
} else { | ||
$xmr_subaddress = ['address' => $_COOKIE['xmr_subaddress']]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parse the address before set it to $xmr_subaddress otherwise it's an input that might be controlled by an attacker (nothing too sensitive, but..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanitized and validated.. pls check
$address_index = $address_index['index']['minor']; | ||
} | ||
else { | ||
return $txs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's something odd here..
Write
if(!isset(...)){
return $txs;
}
and move the other branch after that check :) better readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done thnx
$txs = $this->check_payment_rpc($payment_id); | ||
|
||
// If num_confirmations is 0, simply check if payment has been received | ||
if ($num_confirmations == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I'm thinking about we might want to show something in the settings if num_confirmations == 0. Also, I don't see any check for num_confirmations < 0. Are we sure nobody can actually set that value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Controller/Gateway/MoneroPayment.php
Outdated
if(isset($_GET['first'])){ | ||
|
||
if (isset($_GET['first'])) { | ||
$first = $_GET['first']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking that we might want to parse and validate all the fields..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review my comments and adjust as necessary.
Thanks a lot for the contribution!
- adds number of confirmation ability - switches to sub-addresses - added zero unlock time for tx
3c4a25d
to
fe01d21
Compare
Thanks! It's still a very rough MVP, but it would be great to hook it up on Packagist so folks can try it out and provide feedback. |
should resolve: #12
For a live demonstration that can be tested, please run a Monero wallet RPC locally (host.docker.internal) and follow the manual setup instructions for Dockerized Magento available at https://github.com/napoly/docker-monero-magento/tree/monero-integration.