Store some basic info in metadata

This should help merchants with book keeping
This commit is contained in:
cryptochangements34 2018-02-26 19:02:32 -06:00 committed by GitHub
parent fc38605772
commit 552792625d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,6 +319,11 @@ class Monero_Gateway extends WC_Payment_Gateway
$currency = $order->get_currency();
$amount_xmr2 = $this->changeto($amount, $currency, $payment_id);
$address = $this->address;
$order->update_meta_data( "Payment ID", $payment_id);
$order->update_meta_data( "Amount requested (XMR)", $amount_xmr2);
$order->save();
if (!isset($address)) {
// If there isn't address (merchant missed that field!), $address will be the Monero address for donating :)
$address = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A";
@ -402,6 +407,10 @@ class Monero_Gateway extends WC_Payment_Gateway
$payment_id = $this->set_paymentid_cookie(8);
$currency = $order->get_currency();
$amount_xmr2 = $this->changeto($amount, $currency, $payment_id);
$order->update_meta_data( "Payment ID", $payment_id);
$order->update_meta_data( "Amount requested (XMR)", $amount_xmr2);
$order->save();
$uri = "monero:$address?tx_payment_id=$payment_id";
$array_integrated_address = $this->monero_daemon->make_integrated_address($payment_id);